cybersource-rest-client
Version:
Node.js SDK for the CyberSource REST API
154 lines (138 loc) • 5.91 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/Acpv1mppcredentialsChallengeEncryptionJwk'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Acpv1mppcredentialsChallengeEncryptionJwk'));
} else {
// Browser globals (root is window)
if (!root.CyberSource) {
root.CyberSource = {};
}
root.CyberSource.Acpv1mppcredentialsChallenge = factory(root.CyberSource.ApiClient, root.CyberSource.Acpv1mppcredentialsChallengeEncryptionJwk);
}
}(this, function(ApiClient, Acpv1mppcredentialsChallengeEncryptionJwk) {
'use strict';
/**
* The Acpv1mppcredentialsChallenge model module.
* @module model/Acpv1mppcredentialsChallenge
* @version 0.0.1
*/
/**
* Constructs a new <code>Acpv1mppcredentialsChallenge</code>.
* MPP challenge context received from the merchant's 402 response.
* @alias module:model/Acpv1mppcredentialsChallenge
* @class
* @param id {String} Unique challenge identifier issued by the merchant server.
* @param realm {String} Merchant realm (typically the API domain).
* @param amount {String} Amount in the smallest currency unit (e.g., '4999' = $49.99).
* @param currency {String} Three-letter ISO 4217 currency code, lowercase (e.g., 'usd').
* @param acceptedNetworks {Array.<String>} Card networks accepted by the merchant (e.g., ['visa', 'mastercard']).
* @param merchantId {String} Merchant identifier (maps to 'recipient' in MPP spec request object).
* @param merchantName {String} Human-readable merchant name.
* @param encryptionJwk {module:model/Acpv1mppcredentialsChallengeEncryptionJwk}
*/
var exports = function(id, realm, amount, currency, acceptedNetworks, merchantId, merchantName, encryptionJwk) {
var _this = this;
_this['id'] = id;
_this['realm'] = realm;
_this['amount'] = amount;
_this['currency'] = currency;
_this['acceptedNetworks'] = acceptedNetworks;
_this['merchantId'] = merchantId;
_this['merchantName'] = merchantName;
_this['encryption_jwk'] = encryptionJwk;
};
/**
* Constructs a <code>Acpv1mppcredentialsChallenge</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/Acpv1mppcredentialsChallenge} obj Optional instance to populate.
* @return {module:model/Acpv1mppcredentialsChallenge} The populated <code>Acpv1mppcredentialsChallenge</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'String');
}
if (data.hasOwnProperty('realm')) {
obj['realm'] = ApiClient.convertToType(data['realm'], '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('acceptedNetworks')) {
obj['acceptedNetworks'] = ApiClient.convertToType(data['acceptedNetworks'], ['String']);
}
if (data.hasOwnProperty('merchantId')) {
obj['merchantId'] = ApiClient.convertToType(data['merchantId'], 'String');
}
if (data.hasOwnProperty('merchantName')) {
obj['merchantName'] = ApiClient.convertToType(data['merchantName'], 'String');
}
if (data.hasOwnProperty('encryption_jwk')) {
obj['encryption_jwk'] = Acpv1mppcredentialsChallengeEncryptionJwk.constructFromObject(data['encryption_jwk']);
}
}
return obj;
}
/**
* Unique challenge identifier issued by the merchant server.
* @member {String} id
*/
exports.prototype['id'] = undefined;
/**
* Merchant realm (typically the API domain).
* @member {String} realm
*/
exports.prototype['realm'] = undefined;
/**
* Amount in the smallest currency unit (e.g., '4999' = $49.99).
* @member {String} amount
*/
exports.prototype['amount'] = undefined;
/**
* Three-letter ISO 4217 currency code, lowercase (e.g., 'usd').
* @member {String} currency
*/
exports.prototype['currency'] = undefined;
/**
* Card networks accepted by the merchant (e.g., ['visa', 'mastercard']).
* @member {Array.<String>} acceptedNetworks
*/
exports.prototype['acceptedNetworks'] = undefined;
/**
* Merchant identifier (maps to 'recipient' in MPP spec request object).
* @member {String} merchantId
*/
exports.prototype['merchantId'] = undefined;
/**
* Human-readable merchant name.
* @member {String} merchantName
*/
exports.prototype['merchantName'] = undefined;
/**
* @member {module:model/Acpv1mppcredentialsChallengeEncryptionJwk} encryption_jwk
*/
exports.prototype['encryption_jwk'] = undefined;
return exports;
}));