UNPKG

cybersource-rest-client

Version:

Node.js SDK for the CyberSource REST API

119 lines (98 loc) 6.45 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'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory(require('../ApiClient'), require('./Microformv2sessionsTransientTokenResponseOptions')); } else { // Browser globals (root is window) if (!root.CyberSource) { root.CyberSource = {}; } root.CyberSource.GenerateCaptureContextRequest = factory(root.CyberSource.ApiClient, root.CyberSource.Microformv2sessionsTransientTokenResponseOptions); } }(this, function(ApiClient, Microformv2sessionsTransientTokenResponseOptions) { 'use strict'; /** * The GenerateCaptureContextRequest model module. * @module model/GenerateCaptureContextRequest * @version 0.0.1 */ /** * Constructs a new <code>GenerateCaptureContextRequest</code>. * This is a server-to-server API request to generate the capture context that can be used to initiate an instance of Microform on an acceptance page. The capture context is a digitally signed JWT that provides authentication, one-time keys, and the target origin to the Microform Integration application. * @alias module:model/GenerateCaptureContextRequest * @class */ var exports = function() { var _this = this; }; /** * Constructs a <code>GenerateCaptureContextRequest</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/GenerateCaptureContextRequest} obj Optional instance to populate. * @return {module:model/GenerateCaptureContextRequest} The populated <code>GenerateCaptureContextRequest</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('transientTokenResponseOptions')) { obj['transientTokenResponseOptions'] = Microformv2sessionsTransientTokenResponseOptions.constructFromObject(data['transientTokenResponseOptions']); } } return obj; } /** * Specify the version of Microform 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 Microform 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\" ]<br><br> You can supply up to nine origins within the targetOrigins field for nested iframes. If the list of origins exceeds five ensure that you: - Compare the list of origins in the v2/sessions targetOrigins field against the location.ancestorOrigins of the browser. - Ensure that the count of origins and their content matches in both. If any origins are absent or mismatched, the system will prevent Microform from loading and display a client-side error message. * @member {Array.<String>} targetOrigins */ exports.prototype['targetOrigins'] = undefined; /** * The list of card networks you want to use for this Microform transaction. Microform currently supports the following card networks: - VISA - MASTERCARD - AMEX - CARNET - CARTESBANCAIRES - CUP - DINERSCLUB - DISCOVER - EFTPOS - ELO - JCB - JCREW - MADA - MAESTRO - MEEZA - PAYPAK **Important:** - When integrating Microform (Card) at least one card network should be specified in the allowedCardNetworks field in the capture context request. - When integrating Microform (ACH/eCheck) the allowedCardNetworks field is not required in the capture context request. - When integrating both Microform (Card) and Microform (ACH/eCheck) at least one card network should be specified in the allowedCardNetworks field in the capture context request. * @member {Array.<String>} allowedCardNetworks */ exports.prototype['allowedCardNetworks'] = undefined; /** * The payment types that are allowed for the merchant. Possible values when launching Microform: - CARD - CHECK <br><br> * @member {Array.<String>} allowedPaymentTypes */ exports.prototype['allowedPaymentTypes'] = undefined; /** * @member {module:model/Microformv2sessionsTransientTokenResponseOptions} transientTokenResponseOptions */ exports.prototype['transientTokenResponseOptions'] = undefined; return exports; }));