cybersource-rest-client
Version:
Node.js SDK for the CyberSource REST API
131 lines (111 loc) • 5.23 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'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.CyberSource) {
root.CyberSource = {};
}
root.CyberSource.Acpv1instructionsinstructionIdcredentialsOrderInformationAmountDetail = factory(root.CyberSource.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The Acpv1instructionsinstructionIdcredentialsOrderInformationAmountDetail model module.
* @module model/Acpv1instructionsinstructionIdcredentialsOrderInformationAmountDetail
* @version 0.0.1
*/
/**
* Constructs a new <code>Acpv1instructionsinstructionIdcredentialsOrderInformationAmountDetail</code>.
* Amount Detail data. Breaks down the total transaction amount into components.
* @alias module:model/Acpv1instructionsinstructionIdcredentialsOrderInformationAmountDetail
* @class
* @param totalAmount {String} The final amount that the customer needs to pay or paid.
* @param currency {String} (Conditional) ISO 4217 currency code. Currency in which the transactionAmount, subTotal, tax, Shipping& handling or discount amount is expressed. Conditionality - Required when either transactionAmount, subTotal, tax, Shipping& handling or discount amount is present.
*/
var exports = function(totalAmount, currency) {
var _this = this;
_this['totalAmount'] = totalAmount;
_this['currency'] = currency;
};
/**
* Constructs a <code>Acpv1instructionsinstructionIdcredentialsOrderInformationAmountDetail</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/Acpv1instructionsinstructionIdcredentialsOrderInformationAmountDetail} obj Optional instance to populate.
* @return {module:model/Acpv1instructionsinstructionIdcredentialsOrderInformationAmountDetail} The populated <code>Acpv1instructionsinstructionIdcredentialsOrderInformationAmountDetail</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('subTotalAmount')) {
obj['subTotalAmount'] = ApiClient.convertToType(data['subTotalAmount'], 'String');
}
if (data.hasOwnProperty('discountAmount')) {
obj['discountAmount'] = ApiClient.convertToType(data['discountAmount'], 'String');
}
if (data.hasOwnProperty('shippingAmount')) {
obj['shippingAmount'] = ApiClient.convertToType(data['shippingAmount'], 'String');
}
if (data.hasOwnProperty('handlingAmount')) {
obj['handlingAmount'] = ApiClient.convertToType(data['handlingAmount'], 'String');
}
}
return obj;
}
/**
* The final amount that the customer needs to pay or paid.
* @member {String} totalAmount
*/
exports.prototype['totalAmount'] = undefined;
/**
* (Conditional) ISO 4217 currency code. Currency in which the transactionAmount, subTotal, tax, Shipping& handling or discount amount is expressed. Conditionality - Required when either transactionAmount, subTotal, tax, Shipping& handling or discount amount is present.
* @member {String} currency
*/
exports.prototype['currency'] = undefined;
/**
* The total transaction amount before any taxes or discounts are applied.
* @member {String} subTotalAmount
*/
exports.prototype['subTotalAmount'] = undefined;
/**
* The total discount amount applied to the transaction.
* @member {String} discountAmount
*/
exports.prototype['discountAmount'] = undefined;
/**
* The total shipping and handling cost(amount) applied to the transaction.
* @member {String} shippingAmount
*/
exports.prototype['shippingAmount'] = undefined;
/**
* The total shipping and handling cost(amount) applied to the transaction.
* @member {String} handlingAmount
*/
exports.prototype['handlingAmount'] = undefined;
return exports;
}));