cybersource-rest-client
Version:
Node.js SDK for the CyberSource REST API
100 lines (82 loc) • 4.37 kB
JavaScript
/**
* CyberSource Merged Spec
* All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
*
* OpenAPI spec version: 0.0.1
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.38
*
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Acpv1tokensPaymentInformationCustomer', 'model/Acpv1tokensPaymentInformationInstrumentIdentifier', 'model/Acpv1tokensPaymentInformationPaymentInstrument'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Acpv1tokensPaymentInformationCustomer'), require('./Acpv1tokensPaymentInformationInstrumentIdentifier'), require('./Acpv1tokensPaymentInformationPaymentInstrument'));
} else {
// Browser globals (root is window)
if (!root.CyberSource) {
root.CyberSource = {};
}
root.CyberSource.Acpv1tokensPaymentInformation = factory(root.CyberSource.ApiClient, root.CyberSource.Acpv1tokensPaymentInformationCustomer, root.CyberSource.Acpv1tokensPaymentInformationInstrumentIdentifier, root.CyberSource.Acpv1tokensPaymentInformationPaymentInstrument);
}
}(this, function(ApiClient, Acpv1tokensPaymentInformationCustomer, Acpv1tokensPaymentInformationInstrumentIdentifier, Acpv1tokensPaymentInformationPaymentInstrument) {
'use strict';
/**
* The Acpv1tokensPaymentInformation model module.
* @module model/Acpv1tokensPaymentInformation
* @version 0.0.1
*/
/**
* Constructs a new <code>Acpv1tokensPaymentInformation</code>.
* Payment Information data. References the tokenized payment card to use for this transaction. At least one of customer, paymentInstrument, or instrumentIdentifier must be provided. The instrumentIdentifier is the most commonly used reference. If you have a TMS instrument identifier, provide it in instrumentIdentifier.id.
* @alias module:model/Acpv1tokensPaymentInformation
* @class
* @param instrumentIdentifier {module:model/Acpv1tokensPaymentInformationInstrumentIdentifier}
*/
var exports = function(instrumentIdentifier) {
var _this = this;
_this['instrumentIdentifier'] = instrumentIdentifier;
};
/**
* Constructs a <code>Acpv1tokensPaymentInformation</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/Acpv1tokensPaymentInformation} obj Optional instance to populate.
* @return {module:model/Acpv1tokensPaymentInformation} The populated <code>Acpv1tokensPaymentInformation</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('customer')) {
obj['customer'] = Acpv1tokensPaymentInformationCustomer.constructFromObject(data['customer']);
}
if (data.hasOwnProperty('paymentInstrument')) {
obj['paymentInstrument'] = Acpv1tokensPaymentInformationPaymentInstrument.constructFromObject(data['paymentInstrument']);
}
if (data.hasOwnProperty('instrumentIdentifier')) {
obj['instrumentIdentifier'] = Acpv1tokensPaymentInformationInstrumentIdentifier.constructFromObject(data['instrumentIdentifier']);
}
}
return obj;
}
/**
* @member {module:model/Acpv1tokensPaymentInformationCustomer} customer
*/
exports.prototype['customer'] = undefined;
/**
* @member {module:model/Acpv1tokensPaymentInformationPaymentInstrument} paymentInstrument
*/
exports.prototype['paymentInstrument'] = undefined;
/**
* @member {module:model/Acpv1tokensPaymentInformationInstrumentIdentifier} instrumentIdentifier
*/
exports.prototype['instrumentIdentifier'] = undefined;
return exports;
}));