cybersource-rest-client
Version:
Node.js SDK for the CyberSource REST API
286 lines (246 loc) • 11.9 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/Ptsv1pullfundstransferSenderInformationAccount', 'model/Ptsv1pullfundstransferSenderInformationConsumerAuthentication', 'model/Ptsv1pullfundstransferSenderInformationPaymentInformation', 'model/Ptsv1pullfundstransferSenderInformationPersonalIdentification'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Ptsv1pullfundstransferSenderInformationAccount'), require('./Ptsv1pullfundstransferSenderInformationConsumerAuthentication'), require('./Ptsv1pullfundstransferSenderInformationPaymentInformation'), require('./Ptsv1pullfundstransferSenderInformationPersonalIdentification'));
} else {
// Browser globals (root is window)
if (!root.CyberSource) {
root.CyberSource = {};
}
root.CyberSource.Ptsv1pullfundstransferSenderInformation = factory(root.CyberSource.ApiClient, root.CyberSource.Ptsv1pullfundstransferSenderInformationAccount, root.CyberSource.Ptsv1pullfundstransferSenderInformationConsumerAuthentication, root.CyberSource.Ptsv1pullfundstransferSenderInformationPaymentInformation, root.CyberSource.Ptsv1pullfundstransferSenderInformationPersonalIdentification);
}
}(this, function(ApiClient, Ptsv1pullfundstransferSenderInformationAccount, Ptsv1pullfundstransferSenderInformationConsumerAuthentication, Ptsv1pullfundstransferSenderInformationPaymentInformation, Ptsv1pullfundstransferSenderInformationPersonalIdentification) {
'use strict';
/**
* The Ptsv1pullfundstransferSenderInformation model module.
* @module model/Ptsv1pullfundstransferSenderInformation
* @version 0.0.1
*/
/**
* Constructs a new <code>Ptsv1pullfundstransferSenderInformation</code>.
* @alias module:model/Ptsv1pullfundstransferSenderInformation
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>Ptsv1pullfundstransferSenderInformation</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/Ptsv1pullfundstransferSenderInformation} obj Optional instance to populate.
* @return {module:model/Ptsv1pullfundstransferSenderInformation} The populated <code>Ptsv1pullfundstransferSenderInformation</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('postalCode')) {
obj['postalCode'] = ApiClient.convertToType(data['postalCode'], 'String');
}
if (data.hasOwnProperty('firstName')) {
obj['firstName'] = ApiClient.convertToType(data['firstName'], 'String');
}
if (data.hasOwnProperty('middleInitial')) {
obj['middleInitial'] = ApiClient.convertToType(data['middleInitial'], 'String');
}
if (data.hasOwnProperty('middleName')) {
obj['middleName'] = ApiClient.convertToType(data['middleName'], 'String');
}
if (data.hasOwnProperty('lastName')) {
obj['lastName'] = ApiClient.convertToType(data['lastName'], 'String');
}
if (data.hasOwnProperty('address1')) {
obj['address1'] = ApiClient.convertToType(data['address1'], 'String');
}
if (data.hasOwnProperty('address2')) {
obj['address2'] = ApiClient.convertToType(data['address2'], 'String');
}
if (data.hasOwnProperty('locality')) {
obj['locality'] = ApiClient.convertToType(data['locality'], 'String');
}
if (data.hasOwnProperty('administrativeArea')) {
obj['administrativeArea'] = ApiClient.convertToType(data['administrativeArea'], 'String');
}
if (data.hasOwnProperty('country')) {
obj['country'] = ApiClient.convertToType(data['country'], 'String');
}
if (data.hasOwnProperty('paymentInformation')) {
obj['paymentInformation'] = Ptsv1pullfundstransferSenderInformationPaymentInformation.constructFromObject(data['paymentInformation']);
}
if (data.hasOwnProperty('consumerAuthentication')) {
obj['consumerAuthentication'] = Ptsv1pullfundstransferSenderInformationConsumerAuthentication.constructFromObject(data['consumerAuthentication']);
}
if (data.hasOwnProperty('personalIdentification')) {
obj['personalIdentification'] = Ptsv1pullfundstransferSenderInformationPersonalIdentification.constructFromObject(data['personalIdentification']);
}
if (data.hasOwnProperty('referenceNumber')) {
obj['referenceNumber'] = ApiClient.convertToType(data['referenceNumber'], 'String');
}
if (data.hasOwnProperty('account')) {
obj['account'] = Ptsv1pullfundstransferSenderInformationAccount.constructFromObject(data['account']);
}
if (data.hasOwnProperty('aliasName')) {
obj['aliasName'] = ApiClient.convertToType(data['aliasName'], 'String');
}
if (data.hasOwnProperty('countryOfBirth')) {
obj['countryOfBirth'] = ApiClient.convertToType(data['countryOfBirth'], 'String');
}
if (data.hasOwnProperty('dateOfBirth')) {
obj['dateOfBirth'] = ApiClient.convertToType(data['dateOfBirth'], 'String');
}
if (data.hasOwnProperty('email')) {
obj['email'] = ApiClient.convertToType(data['email'], 'String');
}
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
}
if (data.hasOwnProperty('nationality')) {
obj['nationality'] = ApiClient.convertToType(data['nationality'], 'String');
}
if (data.hasOwnProperty('occupation')) {
obj['occupation'] = ApiClient.convertToType(data['occupation'], 'String');
}
if (data.hasOwnProperty('phoneNumber')) {
obj['phoneNumber'] = ApiClient.convertToType(data['phoneNumber'], 'String');
}
if (data.hasOwnProperty('type')) {
obj['type'] = ApiClient.convertToType(data['type'], 'String');
}
}
return obj;
}
/**
* Sender's postal code. This field is conditional: it is required if using neither a Customer nor Payment Instrument token.
* @member {String} postalCode
*/
exports.prototype['postalCode'] = undefined;
/**
* First name of sender. This field is conditional: it is required if using neither a Customer nor Payment Instrument token.
* @member {String} firstName
*/
exports.prototype['firstName'] = undefined;
/**
* Middle Initial of sender
* @member {String} middleInitial
*/
exports.prototype['middleInitial'] = undefined;
/**
* This field contains the middle name of the entity funding the transaction.
* @member {String} middleName
*/
exports.prototype['middleName'] = undefined;
/**
* Last name of sender. This field is conditional: it is required if using neither a Customer nor Payment Instrument token.
* @member {String} lastName
*/
exports.prototype['lastName'] = undefined;
/**
* Street address of sender. This field is conditional: it is required if using neither a Customer nor Payment Instrument token.
* @member {String} address1
*/
exports.prototype['address1'] = undefined;
/**
* Second line of the sender's address.
* @member {String} address2
*/
exports.prototype['address2'] = undefined;
/**
* City of sender. This field is conditional: it is required if using neither a Customer nor Payment Instrument token.
* @member {String} locality
*/
exports.prototype['locality'] = undefined;
/**
* Sender's state. Use the **State, Province, and Territory Codes for the United States and Canada**. This field is conditional: it is required if in the United States or Canada, and transaction is using neither a Customer nor Payment Instrument token. Value must be an ISO Standard State Code: [https://developer.cybersource.com/library/documentation/sbc/quickref/states_and_provinces.pdf](https://developer.cybersource.com/library/documentation/sbc/quickref/states_and_provinces.pdf)
* @member {String} administrativeArea
*/
exports.prototype['administrativeArea'] = undefined;
/**
* Country of sender. Check that this field contains 2 character alpha ISO 3166-1 standard values. This field is conditional: it is required if using neither a Customer nor Payment Instrument token.
* @member {String} country
*/
exports.prototype['country'] = undefined;
/**
* @member {module:model/Ptsv1pullfundstransferSenderInformationPaymentInformation} paymentInformation
*/
exports.prototype['paymentInformation'] = undefined;
/**
* @member {module:model/Ptsv1pullfundstransferSenderInformationConsumerAuthentication} consumerAuthentication
*/
exports.prototype['consumerAuthentication'] = undefined;
/**
* @member {module:model/Ptsv1pullfundstransferSenderInformationPersonalIdentification} personalIdentification
*/
exports.prototype['personalIdentification'] = undefined;
/**
* Visa Direct(16 characters) If the transaction is a money transfer, pre-paid load, or credit card bill pay, and if the sender intends to fund the transaction with a non-financial instrument (for example, cash), a reference number unique to the sender is required. If the transaction is a funds disbursement, the field is required.
* @member {String} referenceNumber
*/
exports.prototype['referenceNumber'] = undefined;
/**
* @member {module:model/Ptsv1pullfundstransferSenderInformationAccount} account
*/
exports.prototype['account'] = undefined;
/**
* Sender's alias name.
* @member {String} aliasName
*/
exports.prototype['aliasName'] = undefined;
/**
* Account Owner Country of Birth.
* @member {String} countryOfBirth
*/
exports.prototype['countryOfBirth'] = undefined;
/**
* Sender's date of birth. Format: YYYYMMDD.
* @member {String} dateOfBirth
*/
exports.prototype['dateOfBirth'] = undefined;
/**
* Account Owner email address
* @member {String} email
*/
exports.prototype['email'] = undefined;
/**
* Name of sender. Use this field if the sender is a business.
* @member {String} name
*/
exports.prototype['name'] = undefined;
/**
* Account Owner Nationality
* @member {String} nationality
*/
exports.prototype['nationality'] = undefined;
/**
* Account Owner Occupation.
* @member {String} occupation
*/
exports.prototype['occupation'] = undefined;
/**
* Sender's phone number.
* @member {String} phoneNumber
*/
exports.prototype['phoneNumber'] = undefined;
/**
* This field identifies if the sender is a business or an individual. The valid values are: • `B` (Business) • `I` (Individual)
* @member {String} type
*/
exports.prototype['type'] = undefined;
return exports;
}));