cybersource-rest-client
Version:
Node.js SDK for the CyberSource REST API
155 lines (130 loc) • 6.54 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.Ptsv2paymentsOrderInformationAmountDetailsOrder = factory(root.CyberSource.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The Ptsv2paymentsOrderInformationAmountDetailsOrder model module.
* @module model/Ptsv2paymentsOrderInformationAmountDetailsOrder
* @version 0.0.1
*/
/**
* Constructs a new <code>Ptsv2paymentsOrderInformationAmountDetailsOrder</code>.
* @alias module:model/Ptsv2paymentsOrderInformationAmountDetailsOrder
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>Ptsv2paymentsOrderInformationAmountDetailsOrder</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/Ptsv2paymentsOrderInformationAmountDetailsOrder} obj Optional instance to populate.
* @return {module:model/Ptsv2paymentsOrderInformationAmountDetailsOrder} The populated <code>Ptsv2paymentsOrderInformationAmountDetailsOrder</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('handlingAmount')) {
obj['handlingAmount'] = ApiClient.convertToType(data['handlingAmount'], 'String');
}
if (data.hasOwnProperty('shippingAmount')) {
obj['shippingAmount'] = ApiClient.convertToType(data['shippingAmount'], 'String');
}
if (data.hasOwnProperty('shippingDiscountAmount')) {
obj['shippingDiscountAmount'] = ApiClient.convertToType(data['shippingDiscountAmount'], 'String');
}
if (data.hasOwnProperty('taxAmount')) {
obj['taxAmount'] = ApiClient.convertToType(data['taxAmount'], 'String');
}
if (data.hasOwnProperty('insuranceAmount')) {
obj['insuranceAmount'] = ApiClient.convertToType(data['insuranceAmount'], 'String');
}
if (data.hasOwnProperty('giftWrapAmount')) {
obj['giftWrapAmount'] = ApiClient.convertToType(data['giftWrapAmount'], 'String');
}
}
return obj;
}
/**
* Grand total for the order. This value cannot be negative. You can include a decimal point (.), but you cannot include any other special characters. CyberSource truncates the amount to the correct number of decimal places
* @member {String} totalAmount
*/
exports.prototype['totalAmount'] = undefined;
/**
* Currency used for the order
* @member {String} currency
*/
exports.prototype['currency'] = undefined;
/**
* Shipping discount amount for the transaction. If this amount has changed since the initial sessions request, you must include the new value in the order request. You must also include all additional amount fields that apply to the order and ensure the total amount equals the purchaseTotals_grandTotalAmount value.
* @member {String} subTotalAmount
*/
exports.prototype['subTotalAmount'] = undefined;
/**
* Aggregate handling charges for the transaction. If this amount has changed since the initial sessions request, you must include the new value in the order request. You must also include all additional amount fields that apply to the order and ensure the total amount equals the purchaseTotals_grandTotalAmount value.
* @member {String} handlingAmount
*/
exports.prototype['handlingAmount'] = undefined;
/**
* Aggregate shipping charges for the transaction If this amount has changed since the initial sessions request, you must include the new value in the order request. You must also include all additional amount fields that apply to the order and ensure the total amount equals the purchaseTotals_grandTotalAmount value.
* @member {String} shippingAmount
*/
exports.prototype['shippingAmount'] = undefined;
/**
* Shipping discount amount for the transaction. If this amount has changed since the initial sessions request, you must include the new value in the order request. You must also include all additional amount fields that apply to the order and ensure the total amount equals the purchaseTotals_grandTotalAmount value.
* @member {String} shippingDiscountAmount
*/
exports.prototype['shippingDiscountAmount'] = undefined;
/**
* Total tax amount. When the purchaseTotals_ taxAmount and ap_subtotalAmount fields are included in the request, do not include the tax amount as part of the subtotal amount calculation.
* @member {String} taxAmount
*/
exports.prototype['taxAmount'] = undefined;
/**
* Amount being charged for the insurance fee. Only supported when the payment_method is set to paypal.
* @member {String} insuranceAmount
*/
exports.prototype['insuranceAmount'] = undefined;
/**
* Amount being charged as gift wrap fee.
* @member {String} giftWrapAmount
*/
exports.prototype['giftWrapAmount'] = undefined;
return exports;
}));