cybersource-rest-client
Version:
Node.js SDK for the CyberSource REST API
137 lines (114 loc) • 5.93 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.Ptsv2paymentsOrderInformationAmountDetailsTaxDetails = factory(root.CyberSource.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The Ptsv2paymentsOrderInformationAmountDetailsTaxDetails model module.
* @module model/Ptsv2paymentsOrderInformationAmountDetailsTaxDetails
* @version 0.0.1
*/
/**
* Constructs a new <code>Ptsv2paymentsOrderInformationAmountDetailsTaxDetails</code>.
* @alias module:model/Ptsv2paymentsOrderInformationAmountDetailsTaxDetails
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>Ptsv2paymentsOrderInformationAmountDetailsTaxDetails</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/Ptsv2paymentsOrderInformationAmountDetailsTaxDetails} obj Optional instance to populate.
* @return {module:model/Ptsv2paymentsOrderInformationAmountDetailsTaxDetails} The populated <code>Ptsv2paymentsOrderInformationAmountDetailsTaxDetails</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('type')) {
obj['type'] = ApiClient.convertToType(data['type'], 'String');
}
if (data.hasOwnProperty('amount')) {
obj['amount'] = ApiClient.convertToType(data['amount'], 'String');
}
if (data.hasOwnProperty('rate')) {
obj['rate'] = ApiClient.convertToType(data['rate'], 'String');
}
if (data.hasOwnProperty('code')) {
obj['code'] = ApiClient.convertToType(data['code'], 'String');
}
if (data.hasOwnProperty('taxId')) {
obj['taxId'] = ApiClient.convertToType(data['taxId'], 'String');
}
if (data.hasOwnProperty('applied')) {
obj['applied'] = ApiClient.convertToType(data['applied'], 'Boolean');
}
if (data.hasOwnProperty('exemptionCode')) {
obj['exemptionCode'] = ApiClient.convertToType(data['exemptionCode'], 'String');
}
}
return obj;
}
/**
* Indicates the type of tax data for the _taxDetails_ object. Possible values: - `alternate` - `local` - `national` - `vat` - `other` - `green`
* @member {String} type
*/
exports.prototype['type'] = undefined;
/**
* Indicates the amount of tax based on the `type` field as described in the table below: | type | type description | | ------------- |:-------------:| | `alternate` | Total amount of alternate tax for the order. | | `local` | Sales tax for the order. | | `national` | National tax for the order. | | `vat` | Total amount of value added tax (VAT) included in the order. | | `other` | Other tax. | | `green` | Green tax amount for Korean Processing. |
* @member {String} amount
*/
exports.prototype['amount'] = undefined;
/**
* Rate of VAT or other tax for the order. Example 0.040 (=4%) Valid range: 0.01 to 0.99 (1% to 99%, with only whole percentage values accepted; values with additional decimal places will be truncated)
* @member {String} rate
*/
exports.prototype['rate'] = undefined;
/**
* Type of tax being applied to the item. #### FDC Nashville Global - `alternate_tax_type_applied` - `alternate_tax_type_identifier` #### Worldpay VAP - `alternate_tax_type_identifier` #### RBS WorldPay Atlanta - `tax_type_applied` #### TSYS Acquiring Solutions - `tax_type_applied` - `local_tax_indicator` #### Chase Paymentech Solutions - `tax_type_applied` #### Elavon Americas - `local_tax_indicator` #### FDC Compass - `tax_type_applied` #### OmniPay Direct - `local_tax_indicator`
* @member {String} code
*/
exports.prototype['code'] = undefined;
/**
* Your tax ID number to use for the alternate tax amount. Required if you set alternate tax amount to any value, including zero. You may send this field without sending alternate tax amount.
* @member {String} taxId
*/
exports.prototype['taxId'] = undefined;
/**
* Flag that indicates whether the alternate tax amount (`orderInformation.amountDetails.taxDetails[].amount`) is included in the request. Possible values: - `false`: alternate tax amount is not included in the request. - `true`: alternate tax amount is included in the request.
* @member {Boolean} applied
*/
exports.prototype['applied'] = undefined;
/**
* Status code for exemption from sales and use tax. This field is a pass-through, which means that CyberSource does not verify the value or modify it in any way before sending it to the processor.
* @member {String} exemptionCode
*/
exports.prototype['exemptionCode'] = undefined;
return exports;
}));