UNPKG

cybersource-rest-client

Version:

Node.js SDK for the CyberSource REST API

160 lines (134 loc) 9.46 kB
/** * 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/Microformv2sessionsTransientTokenResponseOptions', 'model/Upv1capturecontextsCaptureMandate', 'model/Upv1capturecontextsCompleteMandate', 'model/Upv1capturecontextsOrderInformation'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory(require('../ApiClient'), require('./Microformv2sessionsTransientTokenResponseOptions'), require('./Upv1capturecontextsCaptureMandate'), require('./Upv1capturecontextsCompleteMandate'), require('./Upv1capturecontextsOrderInformation')); } else { // Browser globals (root is window) if (!root.CyberSource) { root.CyberSource = {}; } root.CyberSource.GenerateUnifiedCheckoutCaptureContextRequest = factory(root.CyberSource.ApiClient, root.CyberSource.Microformv2sessionsTransientTokenResponseOptions, root.CyberSource.Upv1capturecontextsCaptureMandate, root.CyberSource.Upv1capturecontextsCompleteMandate, root.CyberSource.Upv1capturecontextsOrderInformation); } }(this, function(ApiClient, Microformv2sessionsTransientTokenResponseOptions, Upv1capturecontextsCaptureMandate, Upv1capturecontextsCompleteMandate, Upv1capturecontextsOrderInformation) { 'use strict'; /** * The GenerateUnifiedCheckoutCaptureContextRequest model module. * @module model/GenerateUnifiedCheckoutCaptureContextRequest * @version 0.0.1 */ /** * Constructs a new <code>GenerateUnifiedCheckoutCaptureContextRequest</code>. * @alias module:model/GenerateUnifiedCheckoutCaptureContextRequest * @class */ var exports = function() { var _this = this; }; /** * Constructs a <code>GenerateUnifiedCheckoutCaptureContextRequest</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/GenerateUnifiedCheckoutCaptureContextRequest} obj Optional instance to populate. * @return {module:model/GenerateUnifiedCheckoutCaptureContextRequest} The populated <code>GenerateUnifiedCheckoutCaptureContextRequest</code> instance. */ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); if (data.hasOwnProperty('clientVersion')) { obj['clientVersion'] = ApiClient.convertToType(data['clientVersion'], 'String'); } if (data.hasOwnProperty('targetOrigins')) { obj['targetOrigins'] = ApiClient.convertToType(data['targetOrigins'], ['String']); } if (data.hasOwnProperty('allowedCardNetworks')) { obj['allowedCardNetworks'] = ApiClient.convertToType(data['allowedCardNetworks'], ['String']); } if (data.hasOwnProperty('allowedPaymentTypes')) { obj['allowedPaymentTypes'] = ApiClient.convertToType(data['allowedPaymentTypes'], ['String']); } if (data.hasOwnProperty('country')) { obj['country'] = ApiClient.convertToType(data['country'], 'String'); } if (data.hasOwnProperty('locale')) { obj['locale'] = ApiClient.convertToType(data['locale'], 'String'); } if (data.hasOwnProperty('captureMandate')) { obj['captureMandate'] = Upv1capturecontextsCaptureMandate.constructFromObject(data['captureMandate']); } if (data.hasOwnProperty('completeMandate')) { obj['completeMandate'] = Upv1capturecontextsCompleteMandate.constructFromObject(data['completeMandate']); } if (data.hasOwnProperty('orderInformation')) { obj['orderInformation'] = Upv1capturecontextsOrderInformation.constructFromObject(data['orderInformation']); } if (data.hasOwnProperty('transientTokenResponseOptions')) { obj['transientTokenResponseOptions'] = Microformv2sessionsTransientTokenResponseOptions.constructFromObject(data['transientTokenResponseOptions']); } } return obj; } /** * Specify the version of Unified Checkout that you want to use. * @member {String} clientVersion */ exports.prototype['clientVersion'] = undefined; /** * The [target origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin) of the website on which you will be launching Unified Checkout is defined by the scheme (protocol), hostname (domain) and port number (if used). You must use https://hostname (unless you use http://localhost) Wildcards are NOT supported. Ensure that subdomains are included. Any valid top-level domain is supported (e.g. .com, .co.uk, .gov.br etc) Examples: - https://example.com - https://subdomain.example.com - https://example.com:8080<br><br> If you are embedding within multiple nested iframes you need to specify the origins of all the browser contexts used, for example: targetOrigins: [ \"https://example.com\", \"https://basket.example.com\", \"https://ecom.example.com\" ] * @member {Array.<String>} targetOrigins */ exports.prototype['targetOrigins'] = undefined; /** * The list of card networks you want to use for this Unified Checkout transaction. Unified Checkout currently supports the following card networks: - VISA - MASTERCARD - AMEX - CARNET - CARTESBANCAIRES - CUP - DINERSCLUB - DISCOVER - EFTPOS - ELO - JCB - JCREW - MADA - MAESTRO - MEEZA - PAYPAK * @member {Array.<String>} allowedCardNetworks */ exports.prototype['allowedCardNetworks'] = undefined; /** * The payment types that are allowed for the merchant. Possible values when launching Unified Checkout: - APPLEPAY - CHECK - CLICKTOPAY - GOOGLEPAY - PANENTRY - PAZE <br><br> Unified Checkout also supports the following Alternative Payments: - AFTERPAY<br><br> Possible values when launching Click To Pay Drop-In UI: - CLICKTOPAY <br><br> **Important:** - CLICKTOPAY only available for Visa, Mastercard and AMEX for saved cards. - Visa and Mastercard will look to tokenize using network tokenization for all Click to Pay requests. Click to Pay uses Click to Pay token requester IDs and not the merchant's existing token requester. - Apple Pay, Google Pay, Check, and Paze can be used independently without requiring PAN entry in the allowedPaymentTypes field.<br><br> **Managing Google Pay Authentication Types** When you enable Google Pay on Unified Checkout you can specify optional parameters that define the types of card authentication you receive from Google Pay.<br><br> **Managing Google Pay Authentication Types** Where Click to Pay is the payment type selected by the customer and the customer manually enters their card, the option to enroll their card in Click to Pay will be auto-checked if this field is set to \"true\". This is only available where the merchant and cardholder are based in the following countries and the billing type is set to \"FULL\" or \"PARTIAL\". - UAE - Argentina - Brazil - Chile - Colombia - Kuwait - Mexico - Peru - Qatar - Saudi Arabia - Ukraine - South Africa<br><br> If false, this is not present or not supported in the market. Enrollment in Click to Pay is not checked for the customer when completing manual card entry. * @member {Array.<String>} allowedPaymentTypes */ exports.prototype['allowedPaymentTypes'] = undefined; /** * Country the purchase is originating from (e.g. country of the merchant). Use the two-character ISO Standard * @member {String} country */ exports.prototype['country'] = undefined; /** * Localization of the User experience conforming to the ISO 639-1 language standards and two-character ISO Standard Country Code. Please refer to list of [supported locales through Unified Checkout](https://developer.cybersource.com/docs/cybs/en-us/unified-checkout/developer/all/rest/unified-checkout/uc-appendix-languages.html) * @member {String} locale */ exports.prototype['locale'] = undefined; /** * @member {module:model/Upv1capturecontextsCaptureMandate} captureMandate */ exports.prototype['captureMandate'] = undefined; /** * @member {module:model/Upv1capturecontextsCompleteMandate} completeMandate */ exports.prototype['completeMandate'] = undefined; /** * @member {module:model/Upv1capturecontextsOrderInformation} orderInformation */ exports.prototype['orderInformation'] = undefined; /** * @member {module:model/Microformv2sessionsTransientTokenResponseOptions} transientTokenResponseOptions */ exports.prototype['transientTokenResponseOptions'] = undefined; return exports; }));