UNPKG

cybersource-rest-client

Version:

Node.js SDK for the CyberSource REST API

579 lines (491 loc) 31 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(['Authentication/MLEUtility', 'ApiClient', 'model/InlineResponse2001', 'model/InlineResponse2002', 'model/InlineResponse2011', 'model/InlineResponse400', 'model/InlineResponse403', 'model/InlineResponse404', 'model/InlineResponse409', 'model/InlineResponse410', 'model/InlineResponse424', 'model/InlineResponse500', 'model/PostIssuerLifeCycleSimulationRequest', 'model/PostPaymentCredentialsRequest', 'model/PostPaymentCredentialsRequest1', 'model/PostTokenizedCardRequest', 'model/TmsTokenizedCardDeleteRequest'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory(require('../authentication/util/MLEUtility'), require('../ApiClient'), require('../model/InlineResponse2001'), require('../model/InlineResponse2002'), require('../model/InlineResponse2011'), require('../model/InlineResponse400'), require('../model/InlineResponse403'), require('../model/InlineResponse404'), require('../model/InlineResponse409'), require('../model/InlineResponse410'), require('../model/InlineResponse424'), require('../model/InlineResponse500'), require('../model/PostIssuerLifeCycleSimulationRequest'), require('../model/PostPaymentCredentialsRequest'), require('../model/PostPaymentCredentialsRequest1'), require('../model/PostTokenizedCardRequest'), require('../model/TmsTokenizedCardDeleteRequest')); } else { // Browser globals (root is window) if (!root.CyberSource) { root.CyberSource = {}; } root.CyberSource.NetworkTokensApi = factory(root.Authentication.MLEUtility, root.CyberSource.ApiClient, root.CyberSource.InlineResponse2001, root.CyberSource.InlineResponse2002, root.CyberSource.InlineResponse2011, root.CyberSource.InlineResponse400, root.CyberSource.InlineResponse403, root.CyberSource.InlineResponse404, root.CyberSource.InlineResponse409, root.CyberSource.InlineResponse410, root.CyberSource.InlineResponse424, root.CyberSource.InlineResponse500, root.CyberSource.PostIssuerLifeCycleSimulationRequest, root.CyberSource.PostPaymentCredentialsRequest, root.CyberSource.PostPaymentCredentialsRequest1, root.CyberSource.PostTokenizedCardRequest, root.CyberSource.TmsTokenizedCardDeleteRequest); } }(this, function(MLEUtility, ApiClient, InlineResponse2001, InlineResponse2002, InlineResponse2011, InlineResponse400, InlineResponse403, InlineResponse404, InlineResponse409, InlineResponse410, InlineResponse424, InlineResponse500, PostIssuerLifeCycleSimulationRequest, PostPaymentCredentialsRequest, PostPaymentCredentialsRequest1, PostTokenizedCardRequest, TmsTokenizedCardDeleteRequest) { 'use strict'; /** * NetworkTokens service. * @module api/NetworkTokensApi * @version 0.0.1 */ /** * Constructs a new NetworkTokensApi. * @alias module:api/NetworkTokensApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, * default to {@link module:ApiClient#instance} if unspecified. */ var exports = function(configObject, apiClient) { this.apiClient = apiClient || ApiClient.instance; this.apiClient.setConfiguration(configObject); /** * Callback function to receive the result of the getCardArtAsset operation. * @callback module:api/NetworkTokensApi~getCardArtAssetCallback * @param {String} error Error message, if any. * @param {module:model/InlineResponse2002} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Retrieve Card Art * Retrieves Card Art for a specific Instrument Identifier. The Card Art is a visual representation of the cardholder's payment card. Card Art is only available if a Network Token is successfully provisioned. * @param {String} instrumentIdentifierId The Id of an Instrument Identifier. * @param {module:model/String} tokenProvider The token provider. * @param {module:model/String} assetType The type of asset. * @param {module:api/NetworkTokensApi~getCardArtAssetCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/InlineResponse2002} */ this.getCardArtAsset = function(instrumentIdentifierId, tokenProvider, assetType, callback) { var postBody = null; if ('GET' == 'POST') { postBody = '{}'; } // verify the required parameter 'instrumentIdentifierId' is set if (instrumentIdentifierId === undefined || instrumentIdentifierId === null) { throw new Error("Missing the required parameter 'instrumentIdentifierId' when calling getCardArtAsset"); } // verify the required parameter 'tokenProvider' is set if (tokenProvider === undefined || tokenProvider === null) { throw new Error("Missing the required parameter 'tokenProvider' when calling getCardArtAsset"); } // verify the required parameter 'assetType' is set if (assetType === undefined || assetType === null) { throw new Error("Missing the required parameter 'assetType' when calling getCardArtAsset"); } var pathParams = { 'instrumentIdentifierId': instrumentIdentifierId, 'tokenProvider': tokenProvider, 'assetType': assetType }; var queryParams = { }; var headerParams = { }; var formParams = { }; var authNames = []; var contentTypes = ['application/json;charset=utf-8']; var accepts = ['application/json;charset=utf-8']; var returnType = InlineResponse2002; //check isMLE for an api method 'this.getCardArtAsset' var inboundMLEStatus = 'false'; var isMLEForApi = MLEUtility.checkIsMLEForAPI(this.apiClient.merchantConfig, inboundMLEStatus, 'getCardArtAsset'); const isResponseMLEForApi = MLEUtility.checkIsResponseMLEForAPI(this.apiClient.merchantConfig, ['getCardArtAsset']); if (isMLEForApi === true) { MLEUtility.encryptRequestPayload(this.apiClient.merchantConfig, postBody).then(postBody => { return this.apiClient.callApi( '/tms/v2/tokens/{instrumentIdentifierId}/{tokenProvider}/assets/{assetType}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, isResponseMLEForApi, callback ); }); } else { return this.apiClient.callApi( '/tms/v2/tokens/{instrumentIdentifierId}/{tokenProvider}/assets/{assetType}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, isResponseMLEForApi, callback ); } } /** * Callback function to receive the result of the getTokenizedCard operation. * @callback module:api/NetworkTokensApi~getTokenizedCardCallback * @param {String} error Error message, if any. * @param {module:model/InlineResponse2001} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Retrieve a Tokenized Card * |**Tokenized Cards**<br>A Tokenized Card represents a network token. Network tokens perform better than regular card numbers and they are not necessarily invalidated when a cardholder loses their card, or it expires. This API returns the details of a tokenized card stored in TMS. You can use this API to check the status of a tokenized card and retrieve details such as the last four digits of the underlying card, expiration date, and card type. * @param {String} tokenizedCardId The Id of a tokenized card. * @param {Object} opts Optional parameters * @param {String} opts.profileId The Id of a profile containing user specific TMS configuration. * @param {module:api/NetworkTokensApi~getTokenizedCardCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/InlineResponse2001} */ this.getTokenizedCard = function(tokenizedCardId, opts, callback) { opts = opts || {}; var postBody = null; if ('GET' == 'POST') { postBody = '{}'; } // verify the required parameter 'tokenizedCardId' is set if (tokenizedCardId === undefined || tokenizedCardId === null) { throw new Error("Missing the required parameter 'tokenizedCardId' when calling getTokenizedCard"); } var pathParams = { 'tokenizedCardId': tokenizedCardId }; var queryParams = { }; var headerParams = { 'profile-id': opts['profileId'] }; var formParams = { }; var authNames = []; var contentTypes = ['application/json;charset=utf-8']; var accepts = ['application/json;charset=utf-8']; var returnType = InlineResponse2001; //check isMLE for an api method 'this.getTokenizedCard' var inboundMLEStatus = 'false'; var isMLEForApi = MLEUtility.checkIsMLEForAPI(this.apiClient.merchantConfig, inboundMLEStatus, 'getTokenizedCard'); const isResponseMLEForApi = MLEUtility.checkIsResponseMLEForAPI(this.apiClient.merchantConfig, ['getTokenizedCard']); if (isMLEForApi === true) { MLEUtility.encryptRequestPayload(this.apiClient.merchantConfig, postBody).then(postBody => { return this.apiClient.callApi( '/tms/v2/tokenized-cards/{tokenizedCardId}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, isResponseMLEForApi, callback ); }); } else { return this.apiClient.callApi( '/tms/v2/tokenized-cards/{tokenizedCardId}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, isResponseMLEForApi, callback ); } } /** * Callback function to receive the result of the postIssuerLifeCycleSimulation operation. * @callback module:api/NetworkTokensApi~postIssuerLifeCycleSimulationCallback * @param {String} error Error message, if any. * @param data This operation does not return a value. * @param {String} response The complete HTTP response. */ /** * Simulate Issuer Life Cycle Management Events * **Lifecycle Management Events**<br>Simulates an issuer life cycle manegement event for updates on the tokenized card. The events that can be simulated are: - Token status changes (e.g. active, suspended, deleted) - Updates to the underlying card, including card art changes, expiration date changes, and card number suffix. **Note:** This is only available in CAS environment. * @param {String} profileId The Id of a profile containing user specific TMS configuration. * @param {String} tokenizedCardId The Id of a tokenized card. * @param {module:model/PostIssuerLifeCycleSimulationRequest} postIssuerLifeCycleSimulationRequest * @param {module:api/NetworkTokensApi~postIssuerLifeCycleSimulationCallback} callback The callback function, accepting three arguments: error, data, response */ this.postIssuerLifeCycleSimulation = function(profileId, tokenizedCardId, postIssuerLifeCycleSimulationRequest, callback) { var postBody = postIssuerLifeCycleSimulationRequest; // verify the required parameter 'profileId' is set if (profileId === undefined || profileId === null) { throw new Error("Missing the required parameter 'profileId' when calling postIssuerLifeCycleSimulation"); } // verify the required parameter 'tokenizedCardId' is set if (tokenizedCardId === undefined || tokenizedCardId === null) { throw new Error("Missing the required parameter 'tokenizedCardId' when calling postIssuerLifeCycleSimulation"); } // verify the required parameter 'postIssuerLifeCycleSimulationRequest' is set if (postIssuerLifeCycleSimulationRequest === undefined || postIssuerLifeCycleSimulationRequest === null) { throw new Error("Missing the required parameter 'postIssuerLifeCycleSimulationRequest' when calling postIssuerLifeCycleSimulation"); } var SdkTracker = require('../utilities/tracking/SdkTracker'); var sdkTracker = new SdkTracker(); postBody = sdkTracker.insertDeveloperIdTracker(postBody, 'module:model/PostIssuerLifeCycleSimulationRequest', this.apiClient.merchantConfig.runEnvironment, this.apiClient.merchantConfig.defaultDeveloperId); var pathParams = { 'tokenizedCardId': tokenizedCardId }; var queryParams = { }; var headerParams = { 'profile-id': profileId }; var formParams = { }; var authNames = []; var contentTypes = ['application/json;charset=utf-8']; var accepts = ['application/json;charset=utf-8']; var returnType = null; //check isMLE for an api method 'this.postIssuerLifeCycleSimulation' var inboundMLEStatus = 'false'; var isMLEForApi = MLEUtility.checkIsMLEForAPI(this.apiClient.merchantConfig, inboundMLEStatus, 'postIssuerLifeCycleSimulation'); const isResponseMLEForApi = MLEUtility.checkIsResponseMLEForAPI(this.apiClient.merchantConfig, ['postIssuerLifeCycleSimulation']); if (isMLEForApi === true) { MLEUtility.encryptRequestPayload(this.apiClient.merchantConfig, postBody).then(postBody => { return this.apiClient.callApi( '/tms/v2/tokenized-cards/{tokenizedCardId}/issuer-life-cycle-event-simulations', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, isResponseMLEForApi, callback ); }); } else { return this.apiClient.callApi( '/tms/v2/tokenized-cards/{tokenizedCardId}/issuer-life-cycle-event-simulations', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, isResponseMLEForApi, callback ); } } /** * Callback function to receive the result of the postTokenPaymentCredentials operation. * @callback module:api/NetworkTokensApi~postTokenPaymentCredentialsCallback * @param {String} error Error message, if any. * @param {'String'} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Generate Payment Credentials v2 * **Note**: This resource will be replace by [payment credentials version 3](#/paths/~1tms~1v3~1tokens~1{tokenId}~1payment-credentials/post). The SDK will remain available for now; however, it will no longer be documented or maintain in the Developer Centre.<br> **Token**<br>A Token can represent your tokenized Customer, Payment Instrument, Instrument Identifier or Tokenized Card information.<br> **Payment Credentials**<br>Contains payment information such as the network token, generated cryptogram for Visa & MasterCard or dynamic CVV for Amex in a JSON Web Encryption (JWE) response.<br>Your system can use this API to retrieve the Payment Credentials for an existing Customer, Payment Instrument, Instrument Identifier or Tokenized Card.<br>Optionally, **authenticated identities** information from Passkey authentication can be provided to potentially achieve liability shift, which may result in the return of an e-commerce indicator of 5 if successful. * @param {String} tokenId The Id of a token representing a Customer, Payment Instrument or Instrument Identifier. * @param {module:model/PostPaymentCredentialsRequest1} postPaymentCredentialsRequest * @param {Object} opts Optional parameters * @param {String} opts.profileId The Id of a profile containing user specific TMS configuration. * @param {module:api/NetworkTokensApi~postTokenPaymentCredentialsCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link 'String'} */ this.postTokenPaymentCredentials = function(tokenId, postPaymentCredentialsRequest, opts, callback) { opts = opts || {}; var postBody = postPaymentCredentialsRequest; // verify the required parameter 'tokenId' is set if (tokenId === undefined || tokenId === null) { throw new Error("Missing the required parameter 'tokenId' when calling postTokenPaymentCredentials"); } // verify the required parameter 'postPaymentCredentialsRequest' is set if (postPaymentCredentialsRequest === undefined || postPaymentCredentialsRequest === null) { throw new Error("Missing the required parameter 'postPaymentCredentialsRequest' when calling postTokenPaymentCredentials"); } var SdkTracker = require('../utilities/tracking/SdkTracker'); var sdkTracker = new SdkTracker(); postBody = sdkTracker.insertDeveloperIdTracker(postBody, 'module:model/PostPaymentCredentialsRequest1', this.apiClient.merchantConfig.runEnvironment, this.apiClient.merchantConfig.defaultDeveloperId); var pathParams = { 'tokenId': tokenId }; var queryParams = { }; var headerParams = { 'profile-id': opts['profileId'] }; var formParams = { }; var authNames = []; var contentTypes = ['application/json;charset=utf-8']; var accepts = ['application/jose;charset=utf-8']; var returnType = 'String'; //check isMLE for an api method 'this.postTokenPaymentCredentials' var inboundMLEStatus = 'optional'; var isMLEForApi = MLEUtility.checkIsMLEForAPI(this.apiClient.merchantConfig, inboundMLEStatus, 'postTokenPaymentCredentials'); const isResponseMLEForApi = MLEUtility.checkIsResponseMLEForAPI(this.apiClient.merchantConfig, ['postTokenPaymentCredentials']); if (isMLEForApi === true) { MLEUtility.encryptRequestPayload(this.apiClient.merchantConfig, postBody).then(postBody => { return this.apiClient.callApi( '/tms/v2/tokens/{tokenId}/payment-credentials', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, isResponseMLEForApi, callback ); }); } else { return this.apiClient.callApi( '/tms/v2/tokens/{tokenId}/payment-credentials', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, isResponseMLEForApi, callback ); } } /** * Callback function to receive the result of the postTokenPaymentCredentialsV3 operation. * @callback module:api/NetworkTokensApi~postTokenPaymentCredentialsV3Callback * @param {String} error Error message, if any. * @param {module:model/InlineResponse2011} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Generate Payment Credentials Latest Version v3 * **Payment Credentials**<br>Contains payment information such as the network token, generated TAVV cryptogram for Visa & MasterCard, dynamic CVV for Amex, or DTVV cryptogram for VISA. This latest version (v3) returns the Primary Account Number details, if the network token is not present. The response is provided in JSON Web Encryption (JWE) format. <br>Your system can use this API to retrieve the Payment Credentials for an existing Customer, Payment Instrument, Instrument Identifier or Tokenized Card.<br>Optionally, **authenticated identities** information from Passkey authentication can be provided to potentially achieve liability shift, which may result in the return of an e-commerce indicator of 5 if successful. * @param {String} tokenId The Id of a token representing a Customer, Payment Instrument or Instrument Identifier. * @param {module:model/PostPaymentCredentialsRequest} postPaymentCredentialsRequest * @param {Object} opts Optional parameters * @param {String} opts.profileId The Id of a profile containing user specific TMS configuration. * @param {module:api/NetworkTokensApi~postTokenPaymentCredentialsV3Callback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/InlineResponse2011} */ this.postTokenPaymentCredentialsV3 = function(tokenId, postPaymentCredentialsRequest, opts, callback) { opts = opts || {}; var postBody = postPaymentCredentialsRequest; // verify the required parameter 'tokenId' is set if (tokenId === undefined || tokenId === null) { throw new Error("Missing the required parameter 'tokenId' when calling postTokenPaymentCredentialsV3"); } // verify the required parameter 'postPaymentCredentialsRequest' is set if (postPaymentCredentialsRequest === undefined || postPaymentCredentialsRequest === null) { throw new Error("Missing the required parameter 'postPaymentCredentialsRequest' when calling postTokenPaymentCredentialsV3"); } var SdkTracker = require('../utilities/tracking/SdkTracker'); var sdkTracker = new SdkTracker(); postBody = sdkTracker.insertDeveloperIdTracker(postBody, 'module:model/PostPaymentCredentialsRequest', this.apiClient.merchantConfig.runEnvironment, this.apiClient.merchantConfig.defaultDeveloperId); var pathParams = { 'tokenId': tokenId }; var queryParams = { }; var headerParams = { 'profile-id': opts['profileId'] }; var formParams = { }; var authNames = []; var contentTypes = ['application/json;charset=utf-8']; var accepts = ['application/jose;charset=utf-8']; var returnType = InlineResponse2011; //check isMLE for an api method 'this.postTokenPaymentCredentialsV3' var inboundMLEStatus = 'optional'; var isMLEForApi = MLEUtility.checkIsMLEForAPI(this.apiClient.merchantConfig, inboundMLEStatus, 'postTokenPaymentCredentialsV3'); const isResponseMLEForApi = MLEUtility.checkIsResponseMLEForAPI(this.apiClient.merchantConfig, ['postTokenPaymentCredentialsV3']); if (isMLEForApi === true) { MLEUtility.encryptRequestPayload(this.apiClient.merchantConfig, postBody).then(postBody => { return this.apiClient.callApi( '/tms/v3/tokens/{tokenId}/payment-credentials', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, isResponseMLEForApi, callback ); }); } else { return this.apiClient.callApi( '/tms/v3/tokens/{tokenId}/payment-credentials', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, isResponseMLEForApi, callback ); } } /** * Callback function to receive the result of the postTokenizedCard operation. * @callback module:api/NetworkTokensApi~postTokenizedCardCallback * @param {String} error Error message, if any. * @param {module:model/InlineResponse2001} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Create a Tokenized Card * **Tokenized cards**<br>A Tokenized card represents a network token. Network tokens perform better than regular card numbers and they are not necessarily invalidated when a cardholder loses their card, or it expires. This API submits a request to the card association to create a network token. If successful, a tokenized card will be created in TMS to represent the network token. * @param {module:model/PostTokenizedCardRequest} postTokenizedCardRequest * @param {Object} opts Optional parameters * @param {String} opts.profileId The Id of a profile containing user specific TMS configuration. * @param {module:api/NetworkTokensApi~postTokenizedCardCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/InlineResponse2001} */ this.postTokenizedCard = function(postTokenizedCardRequest, opts, callback) { opts = opts || {}; var postBody = postTokenizedCardRequest; // verify the required parameter 'postTokenizedCardRequest' is set if (postTokenizedCardRequest === undefined || postTokenizedCardRequest === null) { throw new Error("Missing the required parameter 'postTokenizedCardRequest' when calling postTokenizedCard"); } var SdkTracker = require('../utilities/tracking/SdkTracker'); var sdkTracker = new SdkTracker(); postBody = sdkTracker.insertDeveloperIdTracker(postBody, 'module:model/PostTokenizedCardRequest', this.apiClient.merchantConfig.runEnvironment, this.apiClient.merchantConfig.defaultDeveloperId); var pathParams = { }; var queryParams = { }; var headerParams = { 'profile-id': opts['profileId'] }; var formParams = { }; var authNames = []; var contentTypes = ['application/json;charset=utf-8']; var accepts = ['application/json;charset=utf-8']; var returnType = InlineResponse2001; //check isMLE for an api method 'this.postTokenizedCard' var inboundMLEStatus = 'optional'; var isMLEForApi = MLEUtility.checkIsMLEForAPI(this.apiClient.merchantConfig, inboundMLEStatus, 'postTokenizedCard'); const isResponseMLEForApi = MLEUtility.checkIsResponseMLEForAPI(this.apiClient.merchantConfig, ['postTokenizedCard']); if (isMLEForApi === true) { MLEUtility.encryptRequestPayload(this.apiClient.merchantConfig, postBody).then(postBody => { return this.apiClient.callApi( '/tms/v2/tokenized-cards', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, isResponseMLEForApi, callback ); }); } else { return this.apiClient.callApi( '/tms/v2/tokenized-cards', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, isResponseMLEForApi, callback ); } } /** * Callback function to receive the result of the postTokenizedCardDelete operation. * @callback module:api/NetworkTokensApi~postTokenizedCardDeleteCallback * @param {String} error Error message, if any. * @param data This operation does not return a value. * @param {String} response The complete HTTP response. */ /** * Delete a Tokenized Card * This API attempts to delete a network token from the card association with a specified reason. | If successful, the corresponding tokenized card will be deleted. | The reason for deletion can be specified to provide context for the deletion operation. * @param {String} tokenizedCardId The Id of a tokenized card. * @param {Object} opts Optional parameters * @param {String} opts.profileId The Id of a profile containing user specific TMS configuration. * @param {module:model/TmsTokenizedCardDeleteRequest} opts.postTokenizedCardDeleteRequest * @param {module:api/NetworkTokensApi~postTokenizedCardDeleteCallback} callback The callback function, accepting three arguments: error, data, response */ this.postTokenizedCardDelete = function(tokenizedCardId, opts, callback) { opts = opts || {}; var postBody = opts['postTokenizedCardDeleteRequest']; // verify the required parameter 'tokenizedCardId' is set if (tokenizedCardId === undefined || tokenizedCardId === null) { throw new Error("Missing the required parameter 'tokenizedCardId' when calling postTokenizedCardDelete"); } var SdkTracker = require('../utilities/tracking/SdkTracker'); var sdkTracker = new SdkTracker(); postBody = sdkTracker.insertDeveloperIdTracker(postBody, 'module:model/TmsTokenizedCardDeleteRequest', this.apiClient.merchantConfig.runEnvironment, this.apiClient.merchantConfig.defaultDeveloperId); var pathParams = { 'tokenizedCardId': tokenizedCardId }; var queryParams = { }; var headerParams = { 'profile-id': opts['profileId'] }; var formParams = { }; var authNames = []; var contentTypes = ['application/json;charset=utf-8']; var accepts = ['application/json;charset=utf-8']; var returnType = null; //check isMLE for an api method 'this.postTokenizedCardDelete' var inboundMLEStatus = 'optional'; var isMLEForApi = MLEUtility.checkIsMLEForAPI(this.apiClient.merchantConfig, inboundMLEStatus, 'postTokenizedCardDelete'); const isResponseMLEForApi = MLEUtility.checkIsResponseMLEForAPI(this.apiClient.merchantConfig, ['postTokenizedCardDelete']); if (isMLEForApi === true) { MLEUtility.encryptRequestPayload(this.apiClient.merchantConfig, postBody).then(postBody => { return this.apiClient.callApi( '/tms/v2/tokenized-cards/{tokenizedCardId}/delete', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, isResponseMLEForApi, callback ); }); } else { return this.apiClient.callApi( '/tms/v2/tokenized-cards/{tokenizedCardId}/delete', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, isResponseMLEForApi, callback ); } } }; return exports; }));