cybersource-rest-client
Version:
Node.js SDK for the CyberSource REST API
144 lines (120 loc) • 5.55 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/Upv1capturecontextsDataOrderInformationAmountDetailsSurcharge', 'model/Upv1capturecontextsDataOrderInformationAmountDetailsTaxDetails'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Upv1capturecontextsDataOrderInformationAmountDetailsSurcharge'), require('./Upv1capturecontextsDataOrderInformationAmountDetailsTaxDetails'));
} else {
// Browser globals (root is window)
if (!root.CyberSource) {
root.CyberSource = {};
}
root.CyberSource.Upv1capturecontextsDataOrderInformationAmountDetails = factory(root.CyberSource.ApiClient, root.CyberSource.Upv1capturecontextsDataOrderInformationAmountDetailsSurcharge, root.CyberSource.Upv1capturecontextsDataOrderInformationAmountDetailsTaxDetails);
}
}(this, function(ApiClient, Upv1capturecontextsDataOrderInformationAmountDetailsSurcharge, Upv1capturecontextsDataOrderInformationAmountDetailsTaxDetails) {
'use strict';
/**
* The Upv1capturecontextsDataOrderInformationAmountDetails model module.
* @module model/Upv1capturecontextsDataOrderInformationAmountDetails
* @version 0.0.1
*/
/**
* Constructs a new <code>Upv1capturecontextsDataOrderInformationAmountDetails</code>.
* @alias module:model/Upv1capturecontextsDataOrderInformationAmountDetails
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>Upv1capturecontextsDataOrderInformationAmountDetails</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/Upv1capturecontextsDataOrderInformationAmountDetails} obj Optional instance to populate.
* @return {module:model/Upv1capturecontextsDataOrderInformationAmountDetails} The populated <code>Upv1capturecontextsDataOrderInformationAmountDetails</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('totalAmount')) {
obj['totalAmount'] = ApiClient.convertToType(data['totalAmount'], 'String');
}
if (data.hasOwnProperty('currency')) {
obj['currency'] = ApiClient.convertToType(data['currency'], 'String');
}
if (data.hasOwnProperty('surcharge')) {
obj['surcharge'] = Upv1capturecontextsDataOrderInformationAmountDetailsSurcharge.constructFromObject(data['surcharge']);
}
if (data.hasOwnProperty('discountAmount')) {
obj['discountAmount'] = ApiClient.convertToType(data['discountAmount'], 'String');
}
if (data.hasOwnProperty('subTotalAmount')) {
obj['subTotalAmount'] = ApiClient.convertToType(data['subTotalAmount'], 'String');
}
if (data.hasOwnProperty('serviceFeeAmount')) {
obj['serviceFeeAmount'] = ApiClient.convertToType(data['serviceFeeAmount'], 'String');
}
if (data.hasOwnProperty('taxAmount')) {
obj['taxAmount'] = ApiClient.convertToType(data['taxAmount'], 'String');
}
if (data.hasOwnProperty('taxDetails')) {
obj['taxDetails'] = Upv1capturecontextsDataOrderInformationAmountDetailsTaxDetails.constructFromObject(data['taxDetails']);
}
}
return obj;
}
/**
* This field defines the total order amount.
* @member {String} totalAmount
*/
exports.prototype['totalAmount'] = undefined;
/**
* This field defines the currency applicable to the order.
* @member {String} currency
*/
exports.prototype['currency'] = undefined;
/**
* @member {module:model/Upv1capturecontextsDataOrderInformationAmountDetailsSurcharge} surcharge
*/
exports.prototype['surcharge'] = undefined;
/**
* This field defines the discount amount applicable to the order.
* @member {String} discountAmount
*/
exports.prototype['discountAmount'] = undefined;
/**
* This field defines the sub total amount applicable to the order.
* @member {String} subTotalAmount
*/
exports.prototype['subTotalAmount'] = undefined;
/**
* This field defines the service fee amount applicable to the order.
* @member {String} serviceFeeAmount
*/
exports.prototype['serviceFeeAmount'] = undefined;
/**
* This field defines the tax amount applicable to the order.
* @member {String} taxAmount
*/
exports.prototype['taxAmount'] = undefined;
/**
* @member {module:model/Upv1capturecontextsDataOrderInformationAmountDetailsTaxDetails} taxDetails
*/
exports.prototype['taxDetails'] = undefined;
return exports;
}));