cybersource-rest-client
Version:
Node.js SDK for the CyberSource REST API
180 lines (152 loc) • 7.35 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/Ucv1sessionsDataOrderInformationAmountDetailsTaxDetails', 'model/Upv1capturecontextsDataOrderInformationAmountDetailsSurcharge'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Ucv1sessionsDataOrderInformationAmountDetailsTaxDetails'), require('./Upv1capturecontextsDataOrderInformationAmountDetailsSurcharge'));
} else {
// Browser globals (root is window)
if (!root.CyberSource) {
root.CyberSource = {};
}
root.CyberSource.Ucv1sessionsDataOrderInformationAmountDetails = factory(root.CyberSource.ApiClient, root.CyberSource.Ucv1sessionsDataOrderInformationAmountDetailsTaxDetails, root.CyberSource.Upv1capturecontextsDataOrderInformationAmountDetailsSurcharge);
}
}(this, function(ApiClient, Ucv1sessionsDataOrderInformationAmountDetailsTaxDetails, Upv1capturecontextsDataOrderInformationAmountDetailsSurcharge) {
'use strict';
/**
* The Ucv1sessionsDataOrderInformationAmountDetails model module.
* @module model/Ucv1sessionsDataOrderInformationAmountDetails
* @version 0.0.1
*/
/**
* Constructs a new <code>Ucv1sessionsDataOrderInformationAmountDetails</code>.
* @alias module:model/Ucv1sessionsDataOrderInformationAmountDetails
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>Ucv1sessionsDataOrderInformationAmountDetails</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/Ucv1sessionsDataOrderInformationAmountDetails} obj Optional instance to populate.
* @return {module:model/Ucv1sessionsDataOrderInformationAmountDetails} The populated <code>Ucv1sessionsDataOrderInformationAmountDetails</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('freightAmount')) {
obj['freightAmount'] = ApiClient.convertToType(data['freightAmount'], 'String');
}
if (data.hasOwnProperty('dutyAmount')) {
obj['dutyAmount'] = ApiClient.convertToType(data['dutyAmount'], 'String');
}
if (data.hasOwnProperty('discountAmount')) {
obj['discountAmount'] = ApiClient.convertToType(data['discountAmount'], 'String');
}
if (data.hasOwnProperty('taxAppliedAfterDiscount')) {
obj['taxAppliedAfterDiscount'] = ApiClient.convertToType(data['taxAppliedAfterDiscount'], 'String');
}
if (data.hasOwnProperty('taxAppliedLevel')) {
obj['taxAppliedLevel'] = ApiClient.convertToType(data['taxAppliedLevel'], '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('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'] = ApiClient.convertToType(data['taxDetails'], [Ucv1sessionsDataOrderInformationAmountDetailsTaxDetails]);
}
}
return obj;
}
/**
* This field defines the total order amount.
* @member {String} totalAmount
*/
exports.prototype['totalAmount'] = undefined;
/**
* Total freight or shipping and handling charges for the order. When you include this field in your request, you must also include the **totalAmount** field.
* @member {String} freightAmount
*/
exports.prototype['freightAmount'] = undefined;
/**
* Total charges for any import or export duties included in the order.
* @member {String} dutyAmount
*/
exports.prototype['dutyAmount'] = undefined;
/**
* Total discount amount applied to the order.
* @member {String} discountAmount
*/
exports.prototype['discountAmount'] = undefined;
/**
* Flag that indicates how the merchant manages discounts. Possible values: - **0**: no invoice level discount included - **1**: tax calculated on the postdiscount invoice total - **2**: tax calculated on the prediscount invoice total
* @member {String} taxAppliedAfterDiscount
*/
exports.prototype['taxAppliedAfterDiscount'] = undefined;
/**
* Flag that indicates how you calculate tax. Possible values: - **0**: net prices with tax calculated at line item level - **1**: net prices with tax calculated at invoice level - **2**: gross prices with tax provided at line item level - **3**: gross prices with tax provided at invoice level - **4**: no tax applies on the invoice for the transaction
* @member {String} taxAppliedLevel
*/
exports.prototype['taxAppliedLevel'] = 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 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 {Array.<module:model/Ucv1sessionsDataOrderInformationAmountDetailsTaxDetails>} taxDetails
*/
exports.prototype['taxDetails'] = undefined;
return exports;
}));