cybersource-rest-client
Version:
Node.js SDK for the CyberSource REST API
173 lines (146 loc) • 7.36 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.InlineResponse2018OrderInformationCurrencyConversionOffer = factory(root.CyberSource.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The InlineResponse2018OrderInformationCurrencyConversionOffer model module.
* @module model/InlineResponse2018OrderInformationCurrencyConversionOffer
* @version 0.0.1
*/
/**
* Constructs a new <code>InlineResponse2018OrderInformationCurrencyConversionOffer</code>.
* @alias module:model/InlineResponse2018OrderInformationCurrencyConversionOffer
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>InlineResponse2018OrderInformationCurrencyConversionOffer</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/InlineResponse2018OrderInformationCurrencyConversionOffer} obj Optional instance to populate.
* @return {module:model/InlineResponse2018OrderInformationCurrencyConversionOffer} The populated <code>InlineResponse2018OrderInformationCurrencyConversionOffer</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('originalAmount')) {
obj['originalAmount'] = ApiClient.convertToType(data['originalAmount'], 'String');
}
if (data.hasOwnProperty('originalCurrency')) {
obj['originalCurrency'] = ApiClient.convertToType(data['originalCurrency'], 'String');
}
if (data.hasOwnProperty('amount')) {
obj['amount'] = ApiClient.convertToType(data['amount'], 'String');
}
if (data.hasOwnProperty('currency')) {
obj['currency'] = ApiClient.convertToType(data['currency'], 'String');
}
if (data.hasOwnProperty('exchangeRate')) {
obj['exchangeRate'] = ApiClient.convertToType(data['exchangeRate'], 'String');
}
if (data.hasOwnProperty('exchangeRateInverted')) {
obj['exchangeRateInverted'] = ApiClient.convertToType(data['exchangeRateInverted'], 'Boolean');
}
if (data.hasOwnProperty('marginRate')) {
obj['marginRate'] = ApiClient.convertToType(data['marginRate'], 'String');
}
if (data.hasOwnProperty('rateSource')) {
obj['rateSource'] = ApiClient.convertToType(data['rateSource'], 'String');
}
if (data.hasOwnProperty('exchangeRateTimeUtc')) {
obj['exchangeRateTimeUtc'] = ApiClient.convertToType(data['exchangeRateTimeUtc'], 'String');
}
if (data.hasOwnProperty('exchangeRateExpirationTimeUtc')) {
obj['exchangeRateExpirationTimeUtc'] = ApiClient.convertToType(data['exchangeRateExpirationTimeUtc'], 'String');
}
if (data.hasOwnProperty('rateId')) {
obj['rateId'] = ApiClient.convertToType(data['rateId'], 'String');
}
}
return obj;
}
/**
* The amount of the sale in the merchant's currency. For DCC this should be the same value as the request. For MCP will be 1 major unit of the merchant's base currency.
* @member {String} originalAmount
*/
exports.prototype['originalAmount'] = undefined;
/**
* Currency of the transaction in the merchant's currency. For DCC this should be the same value as the request. For MCP will be the merchant's base currency as configured on the currency conversion provider's system. Use three-character alphabetic [ISO 4271 Currency Codes.](https://developer.cybersource.com/docs/cybs/en-us/currency-codes/reference/all/na/currency-codes/currency-codes.html)
* @member {String} originalCurrency
*/
exports.prototype['originalCurrency'] = undefined;
/**
* The offer amount, calculated using the originalAmount and the exchangeRate. For DCC this is the amount in the card issuer's currency.
* @member {String} amount
*/
exports.prototype['amount'] = undefined;
/**
* Currency of the offer. For DCC this is the card's issuers currency. Use three-character alphabetic [ISO 4271 Currency Codes.](https://developer.cybersource.com/docs/cybs/en-us/currency-codes/reference/all/na/currency-codes/currency-codes.html)
* @member {String} currency
*/
exports.prototype['currency'] = undefined;
/**
* The exchange rate of the offer from 1 major unit of the sale currency including margin. This will be printed on the receipt. For example, if a USD consumer is purchasing in EUR, this field should return the amount of 1 EUR in USD including mark-up. The receipt will contain the following: `EUR 1.00 = USD 1.09998900010999` - where 1.09998900010999 is the value returned in this field.
* @member {String} exchangeRate
*/
exports.prototype['exchangeRate'] = undefined;
/**
* An inverted exchange rate is the base currency amount divided by the converted currency amount. Ex. If a USD customer is purchasing in EUR, this field should return the value of USD divided by EUR.
* @member {Boolean} exchangeRateInverted
*/
exports.prototype['exchangeRateInverted'] = undefined;
/**
* The margin between the offer exchange rate and wholesale rates, i.e. the mark up. Expressed as a percentage of 100, e.g. 3.75
* @member {String} marginRate
*/
exports.prototype['marginRate'] = undefined;
/**
* The source of the rate (excluding mark up). Optional field.
* @member {String} rateSource
*/
exports.prototype['rateSource'] = undefined;
/**
* The date and time of exchange rate in UTC. Format: `YYYY-MM-DDThh:mm:ssZ` **Example** `2023-05-17T23:47:57Z` equals May 17, 2023, at 23:47:57 (11:47:57 PM). The `T` separates the date and the time. The `Z` indicates UTC.
* @member {String} exchangeRateTimeUtc
*/
exports.prototype['exchangeRateTimeUtc'] = undefined;
/**
* The expiration time of the exchange rate in UTC. Format: `YYYY-MM-DDThh:mm:ssZ`
* @member {String} exchangeRateExpirationTimeUtc
*/
exports.prototype['exchangeRateExpirationTimeUtc'] = undefined;
/**
* A unique MCP rate identifier.
* @member {String} rateId
*/
exports.prototype['rateId'] = undefined;
return exports;
}));