cybersource-rest-client
Version:
Node.js SDK for the CyberSource REST API
158 lines (137 loc) • 6.33 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/Acpv1instructionsDeclineThreshold', 'model/Acpv1instructionsRecurringPaymentInformation'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Acpv1instructionsDeclineThreshold'), require('./Acpv1instructionsRecurringPaymentInformation'));
} else {
// Browser globals (root is window)
if (!root.CyberSource) {
root.CyberSource = {};
}
root.CyberSource.Acpv1instructionsMandates = factory(root.CyberSource.ApiClient, root.CyberSource.Acpv1instructionsDeclineThreshold, root.CyberSource.Acpv1instructionsRecurringPaymentInformation);
}
}(this, function(ApiClient, Acpv1instructionsDeclineThreshold, Acpv1instructionsRecurringPaymentInformation) {
'use strict';
/**
* The Acpv1instructionsMandates model module.
* @module model/Acpv1instructionsMandates
* @version 0.0.1
*/
/**
* Constructs a new <code>Acpv1instructionsMandates</code>.
* Mandate data. Defines the consumer's spending authorization for a purchase intent, including merchant preferences, amount limits, and product details.
* @alias module:model/Acpv1instructionsMandates
* @class
* @param mandateId {String} Unique identifier with in the context of a purchase-intent for the mandate. Assigned by Partner. Id shall not be reused when a mandate is updated/deleted.
* @param declineThreshold {module:model/Acpv1instructionsDeclineThreshold}
* @param effectiveUntilTime {String} UTC time in Unix epoch format.
* @param description {String} Description of the product.
*/
var exports = function(mandateId, declineThreshold, effectiveUntilTime, description) {
var _this = this;
_this['mandateId'] = mandateId;
_this['declineThreshold'] = declineThreshold;
_this['effectiveUntilTime'] = effectiveUntilTime;
_this['description'] = description;
};
/**
* Constructs a <code>Acpv1instructionsMandates</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/Acpv1instructionsMandates} obj Optional instance to populate.
* @return {module:model/Acpv1instructionsMandates} The populated <code>Acpv1instructionsMandates</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('mandateId')) {
obj['mandateId'] = ApiClient.convertToType(data['mandateId'], 'String');
}
if (data.hasOwnProperty('preferredMerchantName')) {
obj['preferredMerchantName'] = ApiClient.convertToType(data['preferredMerchantName'], 'String');
}
if (data.hasOwnProperty('merchantCategory')) {
obj['merchantCategory'] = ApiClient.convertToType(data['merchantCategory'], 'String');
}
if (data.hasOwnProperty('merchantCategoryCode')) {
obj['merchantCategoryCode'] = ApiClient.convertToType(data['merchantCategoryCode'], 'String');
}
if (data.hasOwnProperty('declineThreshold')) {
obj['declineThreshold'] = Acpv1instructionsDeclineThreshold.constructFromObject(data['declineThreshold']);
}
if (data.hasOwnProperty('recurringPaymentInformation')) {
obj['recurringPaymentInformation'] = Acpv1instructionsRecurringPaymentInformation.constructFromObject(data['recurringPaymentInformation']);
}
if (data.hasOwnProperty('effectiveUntilTime')) {
obj['effectiveUntilTime'] = ApiClient.convertToType(data['effectiveUntilTime'], 'String');
}
if (data.hasOwnProperty('quantity')) {
obj['quantity'] = ApiClient.convertToType(data['quantity'], 'String');
}
if (data.hasOwnProperty('description')) {
obj['description'] = ApiClient.convertToType(data['description'], 'String');
}
}
return obj;
}
/**
* Unique identifier with in the context of a purchase-intent for the mandate. Assigned by Partner. Id shall not be reused when a mandate is updated/deleted.
* @member {String} mandateId
*/
exports.prototype['mandateId'] = undefined;
/**
* User merchant preference.
* @member {String} preferredMerchantName
*/
exports.prototype['preferredMerchantName'] = undefined;
/**
* Merchant category Description.
* @member {String} merchantCategory
*/
exports.prototype['merchantCategory'] = undefined;
/**
* Merchant category Code. Once it is checked, it has to be valid merchant category code. Ex:\" 5311\"
* @member {String} merchantCategoryCode
*/
exports.prototype['merchantCategoryCode'] = undefined;
/**
* @member {module:model/Acpv1instructionsDeclineThreshold} declineThreshold
*/
exports.prototype['declineThreshold'] = undefined;
/**
* @member {module:model/Acpv1instructionsRecurringPaymentInformation} recurringPaymentInformation
*/
exports.prototype['recurringPaymentInformation'] = undefined;
/**
* UTC time in Unix epoch format.
* @member {String} effectiveUntilTime
*/
exports.prototype['effectiveUntilTime'] = undefined;
/**
* Quantity of the product.
* @member {String} quantity
*/
exports.prototype['quantity'] = undefined;
/**
* Description of the product.
* @member {String} description
*/
exports.prototype['description'] = undefined;
return exports;
}));