cybersource-rest-client
Version:
Node.js SDK for the CyberSource REST API
199 lines (168 loc) • 10.8 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/TmsMerchantInformation', 'model/TmsPaymentInstrumentProcessingInfo', 'model/Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBankAccount', 'model/Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBillTo', 'model/Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBuyerInformation', 'model/Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentCard', 'model/Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentEmbedded', 'model/Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentInstrumentIdentifier', 'model/Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentLinks', 'model/Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentMetadata'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./TmsMerchantInformation'), require('./TmsPaymentInstrumentProcessingInfo'), require('./Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBankAccount'), require('./Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBillTo'), require('./Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBuyerInformation'), require('./Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentCard'), require('./Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentEmbedded'), require('./Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentInstrumentIdentifier'), require('./Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentLinks'), require('./Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentMetadata'));
} else {
// Browser globals (root is window)
if (!root.CyberSource) {
root.CyberSource = {};
}
root.CyberSource.PostCustomerPaymentInstrumentRequest = factory(root.CyberSource.ApiClient, root.CyberSource.TmsMerchantInformation, root.CyberSource.TmsPaymentInstrumentProcessingInfo, root.CyberSource.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBankAccount, root.CyberSource.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBillTo, root.CyberSource.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBuyerInformation, root.CyberSource.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentCard, root.CyberSource.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentEmbedded, root.CyberSource.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentInstrumentIdentifier, root.CyberSource.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentLinks, root.CyberSource.Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentMetadata);
}
}(this, function(ApiClient, TmsMerchantInformation, TmsPaymentInstrumentProcessingInfo, Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBankAccount, Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBillTo, Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBuyerInformation, Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentCard, Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentEmbedded, Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentInstrumentIdentifier, Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentLinks, Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentMetadata) {
'use strict';
/**
* The PostCustomerPaymentInstrumentRequest model module.
* @module model/PostCustomerPaymentInstrumentRequest
* @version 0.0.1
*/
/**
* Constructs a new <code>PostCustomerPaymentInstrumentRequest</code>.
* @alias module:model/PostCustomerPaymentInstrumentRequest
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>PostCustomerPaymentInstrumentRequest</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/PostCustomerPaymentInstrumentRequest} obj Optional instance to populate.
* @return {module:model/PostCustomerPaymentInstrumentRequest} The populated <code>PostCustomerPaymentInstrumentRequest</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('_links')) {
obj['_links'] = Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentLinks.constructFromObject(data['_links']);
}
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'String');
}
if (data.hasOwnProperty('object')) {
obj['object'] = ApiClient.convertToType(data['object'], 'String');
}
if (data.hasOwnProperty('default')) {
obj['default'] = ApiClient.convertToType(data['default'], 'Boolean');
}
if (data.hasOwnProperty('state')) {
obj['state'] = ApiClient.convertToType(data['state'], 'String');
}
if (data.hasOwnProperty('type')) {
obj['type'] = ApiClient.convertToType(data['type'], 'String');
}
if (data.hasOwnProperty('bankAccount')) {
obj['bankAccount'] = Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBankAccount.constructFromObject(data['bankAccount']);
}
if (data.hasOwnProperty('card')) {
obj['card'] = Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentCard.constructFromObject(data['card']);
}
if (data.hasOwnProperty('buyerInformation')) {
obj['buyerInformation'] = Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBuyerInformation.constructFromObject(data['buyerInformation']);
}
if (data.hasOwnProperty('billTo')) {
obj['billTo'] = Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBillTo.constructFromObject(data['billTo']);
}
if (data.hasOwnProperty('processingInformation')) {
obj['processingInformation'] = TmsPaymentInstrumentProcessingInfo.constructFromObject(data['processingInformation']);
}
if (data.hasOwnProperty('merchantInformation')) {
obj['merchantInformation'] = TmsMerchantInformation.constructFromObject(data['merchantInformation']);
}
if (data.hasOwnProperty('instrumentIdentifier')) {
obj['instrumentIdentifier'] = Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentInstrumentIdentifier.constructFromObject(data['instrumentIdentifier']);
}
if (data.hasOwnProperty('metadata')) {
obj['metadata'] = Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentMetadata.constructFromObject(data['metadata']);
}
if (data.hasOwnProperty('_embedded')) {
obj['_embedded'] = Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentEmbedded.constructFromObject(data['_embedded']);
}
}
return obj;
}
/**
* @member {module:model/Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentLinks} _links
*/
exports.prototype['_links'] = undefined;
/**
* The Id of the Payment Instrument Token.
* @member {String} id
*/
exports.prototype['id'] = undefined;
/**
* The type. Possible Values: - paymentInstrument
* @member {String} object
*/
exports.prototype['object'] = undefined;
/**
* Flag that indicates whether customer payment instrument is the dafault. Possible Values: - `true`: Payment instrument is customer's default. - `false`: Payment instrument is not customer's default.
* @member {Boolean} default
*/
exports.prototype['default'] = undefined;
/**
* Issuers state for the card number. Possible Values: - ACTIVE - CLOSED : The account has been closed.
* @member {String} state
*/
exports.prototype['state'] = undefined;
/**
* The type of Payment Instrument. Possible Values: - cardHash
* @member {String} type
*/
exports.prototype['type'] = undefined;
/**
* @member {module:model/Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBankAccount} bankAccount
*/
exports.prototype['bankAccount'] = undefined;
/**
* @member {module:model/Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentCard} card
*/
exports.prototype['card'] = undefined;
/**
* @member {module:model/Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBuyerInformation} buyerInformation
*/
exports.prototype['buyerInformation'] = undefined;
/**
* @member {module:model/Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentBillTo} billTo
*/
exports.prototype['billTo'] = undefined;
/**
* @member {module:model/TmsPaymentInstrumentProcessingInfo} processingInformation
*/
exports.prototype['processingInformation'] = undefined;
/**
* @member {module:model/TmsMerchantInformation} merchantInformation
*/
exports.prototype['merchantInformation'] = undefined;
/**
* @member {module:model/Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentInstrumentIdentifier} instrumentIdentifier
*/
exports.prototype['instrumentIdentifier'] = undefined;
/**
* @member {module:model/Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentMetadata} metadata
*/
exports.prototype['metadata'] = undefined;
/**
* @member {module:model/Tmsv2tokenizeTokenInformationCustomerEmbeddedDefaultPaymentInstrumentEmbedded} _embedded
*/
exports.prototype['_embedded'] = undefined;
return exports;
}));