@paciolan/cybersource-sdk
Version:
CyberSource REST API Typescript SDK
446 lines (445 loc) • 45 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.PaymentInstrumentApi = exports.PaymentInstrumentApiFactory = exports.PaymentInstrumentApiFp = exports.PaymentInstrumentApiAxiosParamCreator = void 0;
/* tslint:disable */
/* eslint-disable */
/**
* 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
* Do not edit the class manually.
*/
const axios_1 = __importDefault(require("axios"));
const AuthenticationHeader_1 = require("../authentication/core/AuthenticationHeader");
// Some imports not used depending on template conditions
// @ts-ignore
const base_1 = require("../base");
/**
* PaymentInstrumentApi - axios parameter creator
* @export
*/
const PaymentInstrumentApiAxiosParamCreator = function (configuration) {
return {
/**
* | | | | | --- | --- | --- | |**Standalone Payment Instruments**<br>A Payment Instrument represents tokenized payment information such as expiration date, billing address & card type.<br>A Payment Instrument token does not store the card number. A Payment Instrument is associated with an [Instrument Identifier](#token-management_instrument-identifier_create-an-instrument-identifier) that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.<br>**Standalone Payment Instruments do not belong to a [Customer](#token-management_customer_create-a-customer).**| |**Deleting a Payment Instrument**<br>Your system can use this API to delete an existing Payment Instrument.<br>Any Instrument Identifiers representing the card number will also be deleted if they are not associated with any other Payment Instruments.
* @summary Delete a Payment Instrument
* @param {string} paymentInstrumentId The Id of a payment instrument.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deletePaymentInstrument: (paymentInstrumentId, profileId, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'paymentInstrumentId' is not null or undefined
if (paymentInstrumentId === null || paymentInstrumentId === undefined) {
throw new base_1.RequiredError('paymentInstrumentId', 'Required parameter paymentInstrumentId was null or undefined when calling deletePaymentInstrument.');
}
const localVarPath = `/tms/v1/paymentinstruments/{paymentInstrumentId}`
.replace(`{${"paymentInstrumentId"}}`, encodeURIComponent(String(paymentInstrumentId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (profileId !== undefined && profileId !== null) {
localVarHeaderParameter['profile-id'] = String(profileId);
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
const authHeader = new AuthenticationHeader_1.AuthenticationHeader();
authHeader.setConfiguration(Object.assign(Object.assign({}, configuration), options));
localVarRequestOptions.headers = authHeader.callAuthenticationHeader(localVarRequestOptions.method, localVarPath, localVarRequestOptions.data, localVarRequestOptions.headers);
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* | | | | | --- | --- | --- | |**Standalone Payment Instruments**<br>A Payment Instrument represents tokenized payment information such as expiration date, billing address & card type.<br>A Payment Instrument token does not store the card number. A Payment Instrument is associated with an [Instrument Identifier](#token-management_instrument-identifier_create-an-instrument-identifier) that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.<br>**Standalone Payment Instruments do not belong to a [Customer](#token-management_customer_create-a-customer).**| |**Retrieving a Payment Instrument**<br>Your system can use this API to retrieve an existing Payment Instrument.<br>To perform a payment with a particular Payment Instrument simply specify the [Payment Instrument Id in the payments request](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-using-tokens_authorization-with-customer-payment-instrument-and-shipping-address-token-id_liveconsole-tab-request-body).
* @summary Retrieve a Payment Instrument
* @param {string} paymentInstrumentId The Id of a payment instrument.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPaymentInstrument: (paymentInstrumentId, profileId, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'paymentInstrumentId' is not null or undefined
if (paymentInstrumentId === null || paymentInstrumentId === undefined) {
throw new base_1.RequiredError('paymentInstrumentId', 'Required parameter paymentInstrumentId was null or undefined when calling getPaymentInstrument.');
}
const localVarPath = `/tms/v1/paymentinstruments/{paymentInstrumentId}`
.replace(`{${"paymentInstrumentId"}}`, encodeURIComponent(String(paymentInstrumentId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (profileId !== undefined && profileId !== null) {
localVarHeaderParameter['profile-id'] = String(profileId);
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
const authHeader = new AuthenticationHeader_1.AuthenticationHeader();
authHeader.setConfiguration(Object.assign(Object.assign({}, configuration), options));
localVarRequestOptions.headers = authHeader.callAuthenticationHeader(localVarRequestOptions.method, localVarPath, localVarRequestOptions.data, localVarRequestOptions.headers);
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* | | | | | --- | --- | --- | |**Standalone Payment Instruments**<br>A Payment Instrument represents tokenized payment information such as expiration date, billing address & card type.<br>A Payment Instrument token does not store the card number. A Payment Instrument is associated with an [Instrument Identifier](#token-management_instrument-identifier_create-an-instrument-identifier) that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.<br>**Standalone Payment Instruments do not belong to a [Customer](#token-management_customer_create-a-customer).**| |**Updating a Payment Instrument**<br>Your system can use this API to update an existing Payment Instrument.
* @summary Update a Payment Instrument
* @param {PaymentinstrumentsPaymentInstrumentIdBody1} body
* @param {string} paymentInstrumentId The Id of a payment instrument.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {string} [ifMatch] Contains an ETag value from a GET request to make the request conditional.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
patchPaymentInstrument: (body, paymentInstrumentId, profileId, ifMatch, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new base_1.RequiredError('body', 'Required parameter body was null or undefined when calling patchPaymentInstrument.');
}
// verify required parameter 'paymentInstrumentId' is not null or undefined
if (paymentInstrumentId === null || paymentInstrumentId === undefined) {
throw new base_1.RequiredError('paymentInstrumentId', 'Required parameter paymentInstrumentId was null or undefined when calling patchPaymentInstrument.');
}
const localVarPath = `/tms/v1/paymentinstruments/{paymentInstrumentId}`
.replace(`{${"paymentInstrumentId"}}`, encodeURIComponent(String(paymentInstrumentId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (profileId !== undefined && profileId !== null) {
localVarHeaderParameter['profile-id'] = String(profileId);
}
if (ifMatch !== undefined && ifMatch !== null) {
localVarHeaderParameter['if-match'] = String(ifMatch);
}
localVarHeaderParameter['Content-Type'] = 'application/json;charset=utf-8';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
const authHeader = new AuthenticationHeader_1.AuthenticationHeader();
authHeader.setConfiguration(Object.assign(Object.assign({}, configuration), options));
localVarRequestOptions.headers = authHeader.callAuthenticationHeader(localVarRequestOptions.method, localVarPath, localVarRequestOptions.data, localVarRequestOptions.headers);
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* | | | | | --- | --- | --- | |**Standalone Payment Instruments**<br>A Payment Instrument represents tokenized payment information such as expiration date, billing address & card type.<br>A Payment Instrument token does not store the card number. A Payment Instrument is associated with an [Instrument Identifier](#token-management_instrument-identifier_create-an-instrument-identifier) that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.<br>**Standalone Payment Instruments do not belong to a [Customer](#token-management_customer_create-a-customer).**<br><br>**Creating a Payment Instrument**<br>It is recommended you [create a Payment Instrument via a Payment Authorization](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-with-token-create_authorization-with-customer-token-creation_liveconsole-tab-request-body), this can be for a zero amount.<br>In Europe: You should perform Payer Authentication alongside the Authorization.| |**Payment Network Tokens**<br>Network tokens perform better than regular card numbers and they are not necessarily invalidated when a cardholder loses their card, or it expires.<br>A Payment Network Token will be automatically created and used in future payments if you are enabled for the service.<br>A Payment Network Token can also be [provisioned for an existing Instrument Identifier](#token-management_instrument-identifier_enroll-an-instrument-identifier-for-payment-network-token).<br>For more information about Payment Network Tokens see the Developer Guide.<br><br>**Payments with Payment Instruments**<br>To perform a payment with a particular Payment Instrument specify the [Payment Instrument in the payment request](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-using-tokens_authorization-with-customer-payment-instrument-and-shipping-address-token-id_liveconsole-tab-request-body).
* @summary Create a Payment Instrument
* @param {V1PaymentinstrumentsBody} body
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
postPaymentInstrument: (body, profileId, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new base_1.RequiredError('body', 'Required parameter body was null or undefined when calling postPaymentInstrument.');
}
const localVarPath = `/tms/v1/paymentinstruments`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (profileId !== undefined && profileId !== null) {
localVarHeaderParameter['profile-id'] = String(profileId);
}
localVarHeaderParameter['Content-Type'] = 'application/json;charset=utf-8';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
const authHeader = new AuthenticationHeader_1.AuthenticationHeader();
authHeader.setConfiguration(Object.assign(Object.assign({}, configuration), options));
localVarRequestOptions.headers = authHeader.callAuthenticationHeader(localVarRequestOptions.method, localVarPath, localVarRequestOptions.data, localVarRequestOptions.headers);
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
};
};
exports.PaymentInstrumentApiAxiosParamCreator = PaymentInstrumentApiAxiosParamCreator;
/**
* PaymentInstrumentApi - functional programming interface
* @export
*/
const PaymentInstrumentApiFp = function (configuration) {
return {
/**
* | | | | | --- | --- | --- | |**Standalone Payment Instruments**<br>A Payment Instrument represents tokenized payment information such as expiration date, billing address & card type.<br>A Payment Instrument token does not store the card number. A Payment Instrument is associated with an [Instrument Identifier](#token-management_instrument-identifier_create-an-instrument-identifier) that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.<br>**Standalone Payment Instruments do not belong to a [Customer](#token-management_customer_create-a-customer).**| |**Deleting a Payment Instrument**<br>Your system can use this API to delete an existing Payment Instrument.<br>Any Instrument Identifiers representing the card number will also be deleted if they are not associated with any other Payment Instruments.
* @summary Delete a Payment Instrument
* @param {string} paymentInstrumentId The Id of a payment instrument.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deletePaymentInstrument(paymentInstrumentId, profileId, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield (0, exports.PaymentInstrumentApiAxiosParamCreator)(configuration).deletePaymentInstrument(paymentInstrumentId, profileId, options);
return (axios = axios_1.default, basePath = base_1.BASE_PATH) => {
const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
return axios.request(axiosRequestArgs);
};
});
},
/**
* | | | | | --- | --- | --- | |**Standalone Payment Instruments**<br>A Payment Instrument represents tokenized payment information such as expiration date, billing address & card type.<br>A Payment Instrument token does not store the card number. A Payment Instrument is associated with an [Instrument Identifier](#token-management_instrument-identifier_create-an-instrument-identifier) that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.<br>**Standalone Payment Instruments do not belong to a [Customer](#token-management_customer_create-a-customer).**| |**Retrieving a Payment Instrument**<br>Your system can use this API to retrieve an existing Payment Instrument.<br>To perform a payment with a particular Payment Instrument simply specify the [Payment Instrument Id in the payments request](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-using-tokens_authorization-with-customer-payment-instrument-and-shipping-address-token-id_liveconsole-tab-request-body).
* @summary Retrieve a Payment Instrument
* @param {string} paymentInstrumentId The Id of a payment instrument.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPaymentInstrument(paymentInstrumentId, profileId, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield (0, exports.PaymentInstrumentApiAxiosParamCreator)(configuration).getPaymentInstrument(paymentInstrumentId, profileId, options);
return (axios = axios_1.default, basePath = base_1.BASE_PATH) => {
const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
return axios.request(axiosRequestArgs);
};
});
},
/**
* | | | | | --- | --- | --- | |**Standalone Payment Instruments**<br>A Payment Instrument represents tokenized payment information such as expiration date, billing address & card type.<br>A Payment Instrument token does not store the card number. A Payment Instrument is associated with an [Instrument Identifier](#token-management_instrument-identifier_create-an-instrument-identifier) that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.<br>**Standalone Payment Instruments do not belong to a [Customer](#token-management_customer_create-a-customer).**| |**Updating a Payment Instrument**<br>Your system can use this API to update an existing Payment Instrument.
* @summary Update a Payment Instrument
* @param {PaymentinstrumentsPaymentInstrumentIdBody1} body
* @param {string} paymentInstrumentId The Id of a payment instrument.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {string} [ifMatch] Contains an ETag value from a GET request to make the request conditional.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
patchPaymentInstrument(body, paymentInstrumentId, profileId, ifMatch, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield (0, exports.PaymentInstrumentApiAxiosParamCreator)(configuration).patchPaymentInstrument(body, paymentInstrumentId, profileId, ifMatch, options);
return (axios = axios_1.default, basePath = base_1.BASE_PATH) => {
const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
return axios.request(axiosRequestArgs);
};
});
},
/**
* | | | | | --- | --- | --- | |**Standalone Payment Instruments**<br>A Payment Instrument represents tokenized payment information such as expiration date, billing address & card type.<br>A Payment Instrument token does not store the card number. A Payment Instrument is associated with an [Instrument Identifier](#token-management_instrument-identifier_create-an-instrument-identifier) that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.<br>**Standalone Payment Instruments do not belong to a [Customer](#token-management_customer_create-a-customer).**<br><br>**Creating a Payment Instrument**<br>It is recommended you [create a Payment Instrument via a Payment Authorization](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-with-token-create_authorization-with-customer-token-creation_liveconsole-tab-request-body), this can be for a zero amount.<br>In Europe: You should perform Payer Authentication alongside the Authorization.| |**Payment Network Tokens**<br>Network tokens perform better than regular card numbers and they are not necessarily invalidated when a cardholder loses their card, or it expires.<br>A Payment Network Token will be automatically created and used in future payments if you are enabled for the service.<br>A Payment Network Token can also be [provisioned for an existing Instrument Identifier](#token-management_instrument-identifier_enroll-an-instrument-identifier-for-payment-network-token).<br>For more information about Payment Network Tokens see the Developer Guide.<br><br>**Payments with Payment Instruments**<br>To perform a payment with a particular Payment Instrument specify the [Payment Instrument in the payment request](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-using-tokens_authorization-with-customer-payment-instrument-and-shipping-address-token-id_liveconsole-tab-request-body).
* @summary Create a Payment Instrument
* @param {V1PaymentinstrumentsBody} body
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
postPaymentInstrument(body, profileId, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield (0, exports.PaymentInstrumentApiAxiosParamCreator)(configuration).postPaymentInstrument(body, profileId, options);
return (axios = axios_1.default, basePath = base_1.BASE_PATH) => {
const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
return axios.request(axiosRequestArgs);
};
});
},
};
};
exports.PaymentInstrumentApiFp = PaymentInstrumentApiFp;
/**
* PaymentInstrumentApi - factory interface
* @export
*/
const PaymentInstrumentApiFactory = function (configuration, basePath, axios) {
return {
/**
* | | | | | --- | --- | --- | |**Standalone Payment Instruments**<br>A Payment Instrument represents tokenized payment information such as expiration date, billing address & card type.<br>A Payment Instrument token does not store the card number. A Payment Instrument is associated with an [Instrument Identifier](#token-management_instrument-identifier_create-an-instrument-identifier) that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.<br>**Standalone Payment Instruments do not belong to a [Customer](#token-management_customer_create-a-customer).**| |**Deleting a Payment Instrument**<br>Your system can use this API to delete an existing Payment Instrument.<br>Any Instrument Identifiers representing the card number will also be deleted if they are not associated with any other Payment Instruments.
* @summary Delete a Payment Instrument
* @param {string} paymentInstrumentId The Id of a payment instrument.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deletePaymentInstrument(paymentInstrumentId, profileId, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.PaymentInstrumentApiFp)(configuration).deletePaymentInstrument(paymentInstrumentId, profileId, options).then((request) => request(axios, basePath));
});
},
/**
* | | | | | --- | --- | --- | |**Standalone Payment Instruments**<br>A Payment Instrument represents tokenized payment information such as expiration date, billing address & card type.<br>A Payment Instrument token does not store the card number. A Payment Instrument is associated with an [Instrument Identifier](#token-management_instrument-identifier_create-an-instrument-identifier) that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.<br>**Standalone Payment Instruments do not belong to a [Customer](#token-management_customer_create-a-customer).**| |**Retrieving a Payment Instrument**<br>Your system can use this API to retrieve an existing Payment Instrument.<br>To perform a payment with a particular Payment Instrument simply specify the [Payment Instrument Id in the payments request](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-using-tokens_authorization-with-customer-payment-instrument-and-shipping-address-token-id_liveconsole-tab-request-body).
* @summary Retrieve a Payment Instrument
* @param {string} paymentInstrumentId The Id of a payment instrument.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPaymentInstrument(paymentInstrumentId, profileId, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.PaymentInstrumentApiFp)(configuration).getPaymentInstrument(paymentInstrumentId, profileId, options).then((request) => request(axios, basePath));
});
},
/**
* | | | | | --- | --- | --- | |**Standalone Payment Instruments**<br>A Payment Instrument represents tokenized payment information such as expiration date, billing address & card type.<br>A Payment Instrument token does not store the card number. A Payment Instrument is associated with an [Instrument Identifier](#token-management_instrument-identifier_create-an-instrument-identifier) that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.<br>**Standalone Payment Instruments do not belong to a [Customer](#token-management_customer_create-a-customer).**| |**Updating a Payment Instrument**<br>Your system can use this API to update an existing Payment Instrument.
* @summary Update a Payment Instrument
* @param {PaymentinstrumentsPaymentInstrumentIdBody1} body
* @param {string} paymentInstrumentId The Id of a payment instrument.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {string} [ifMatch] Contains an ETag value from a GET request to make the request conditional.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
patchPaymentInstrument(body, paymentInstrumentId, profileId, ifMatch, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.PaymentInstrumentApiFp)(configuration).patchPaymentInstrument(body, paymentInstrumentId, profileId, ifMatch, options).then((request) => request(axios, basePath));
});
},
/**
* | | | | | --- | --- | --- | |**Standalone Payment Instruments**<br>A Payment Instrument represents tokenized payment information such as expiration date, billing address & card type.<br>A Payment Instrument token does not store the card number. A Payment Instrument is associated with an [Instrument Identifier](#token-management_instrument-identifier_create-an-instrument-identifier) that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.<br>**Standalone Payment Instruments do not belong to a [Customer](#token-management_customer_create-a-customer).**<br><br>**Creating a Payment Instrument**<br>It is recommended you [create a Payment Instrument via a Payment Authorization](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-with-token-create_authorization-with-customer-token-creation_liveconsole-tab-request-body), this can be for a zero amount.<br>In Europe: You should perform Payer Authentication alongside the Authorization.| |**Payment Network Tokens**<br>Network tokens perform better than regular card numbers and they are not necessarily invalidated when a cardholder loses their card, or it expires.<br>A Payment Network Token will be automatically created and used in future payments if you are enabled for the service.<br>A Payment Network Token can also be [provisioned for an existing Instrument Identifier](#token-management_instrument-identifier_enroll-an-instrument-identifier-for-payment-network-token).<br>For more information about Payment Network Tokens see the Developer Guide.<br><br>**Payments with Payment Instruments**<br>To perform a payment with a particular Payment Instrument specify the [Payment Instrument in the payment request](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-using-tokens_authorization-with-customer-payment-instrument-and-shipping-address-token-id_liveconsole-tab-request-body).
* @summary Create a Payment Instrument
* @param {V1PaymentinstrumentsBody} body
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
postPaymentInstrument(body, profileId, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.PaymentInstrumentApiFp)(configuration).postPaymentInstrument(body, profileId, options).then((request) => request(axios, basePath));
});
},
};
};
exports.PaymentInstrumentApiFactory = PaymentInstrumentApiFactory;
/**
* PaymentInstrumentApi - object-oriented interface
* @export
* @class PaymentInstrumentApi
* @extends {BaseAPI}
*/
class PaymentInstrumentApi extends base_1.BaseAPI {
/**
* | | | | | --- | --- | --- | |**Standalone Payment Instruments**<br>A Payment Instrument represents tokenized payment information such as expiration date, billing address & card type.<br>A Payment Instrument token does not store the card number. A Payment Instrument is associated with an [Instrument Identifier](#token-management_instrument-identifier_create-an-instrument-identifier) that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.<br>**Standalone Payment Instruments do not belong to a [Customer](#token-management_customer_create-a-customer).**| |**Deleting a Payment Instrument**<br>Your system can use this API to delete an existing Payment Instrument.<br>Any Instrument Identifiers representing the card number will also be deleted if they are not associated with any other Payment Instruments.
* @summary Delete a Payment Instrument
* @param {string} paymentInstrumentId The Id of a payment instrument.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PaymentInstrumentApi
*/
deletePaymentInstrument(paymentInstrumentId, profileId, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.PaymentInstrumentApiFp)(this.configuration).deletePaymentInstrument(paymentInstrumentId, profileId, options).then((request) => request(this.axios, options.runEnvironment != null ? `https://${options.runEnvironment}` : this.basePath));
});
}
/**
* | | | | | --- | --- | --- | |**Standalone Payment Instruments**<br>A Payment Instrument represents tokenized payment information such as expiration date, billing address & card type.<br>A Payment Instrument token does not store the card number. A Payment Instrument is associated with an [Instrument Identifier](#token-management_instrument-identifier_create-an-instrument-identifier) that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.<br>**Standalone Payment Instruments do not belong to a [Customer](#token-management_customer_create-a-customer).**| |**Retrieving a Payment Instrument**<br>Your system can use this API to retrieve an existing Payment Instrument.<br>To perform a payment with a particular Payment Instrument simply specify the [Payment Instrument Id in the payments request](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-using-tokens_authorization-with-customer-payment-instrument-and-shipping-address-token-id_liveconsole-tab-request-body).
* @summary Retrieve a Payment Instrument
* @param {string} paymentInstrumentId The Id of a payment instrument.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PaymentInstrumentApi
*/
getPaymentInstrument(paymentInstrumentId, profileId, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.PaymentInstrumentApiFp)(this.configuration).getPaymentInstrument(paymentInstrumentId, profileId, options).then((request) => request(this.axios, options.runEnvironment != null ? `https://${options.runEnvironment}` : this.basePath));
});
}
/**
* | | | | | --- | --- | --- | |**Standalone Payment Instruments**<br>A Payment Instrument represents tokenized payment information such as expiration date, billing address & card type.<br>A Payment Instrument token does not store the card number. A Payment Instrument is associated with an [Instrument Identifier](#token-management_instrument-identifier_create-an-instrument-identifier) that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.<br>**Standalone Payment Instruments do not belong to a [Customer](#token-management_customer_create-a-customer).**| |**Updating a Payment Instrument**<br>Your system can use this API to update an existing Payment Instrument.
* @summary Update a Payment Instrument
* @param {PaymentinstrumentsPaymentInstrumentIdBody1} body
* @param {string} paymentInstrumentId The Id of a payment instrument.
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {string} [ifMatch] Contains an ETag value from a GET request to make the request conditional.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PaymentInstrumentApi
*/
patchPaymentInstrument(body, paymentInstrumentId, profileId, ifMatch, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.PaymentInstrumentApiFp)(this.configuration).patchPaymentInstrument(body, paymentInstrumentId, profileId, ifMatch, options).then((request) => request(this.axios, options.runEnvironment != null ? `https://${options.runEnvironment}` : this.basePath));
});
}
/**
* | | | | | --- | --- | --- | |**Standalone Payment Instruments**<br>A Payment Instrument represents tokenized payment information such as expiration date, billing address & card type.<br>A Payment Instrument token does not store the card number. A Payment Instrument is associated with an [Instrument Identifier](#token-management_instrument-identifier_create-an-instrument-identifier) that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.<br>**Standalone Payment Instruments do not belong to a [Customer](#token-management_customer_create-a-customer).**<br><br>**Creating a Payment Instrument**<br>It is recommended you [create a Payment Instrument via a Payment Authorization](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-with-token-create_authorization-with-customer-token-creation_liveconsole-tab-request-body), this can be for a zero amount.<br>In Europe: You should perform Payer Authentication alongside the Authorization.| |**Payment Network Tokens**<br>Network tokens perform better than regular card numbers and they are not necessarily invalidated when a cardholder loses their card, or it expires.<br>A Payment Network Token will be automatically created and used in future payments if you are enabled for the service.<br>A Payment Network Token can also be [provisioned for an existing Instrument Identifier](#token-management_instrument-identifier_enroll-an-instrument-identifier-for-payment-network-token).<br>For more information about Payment Network Tokens see the Developer Guide.<br><br>**Payments with Payment Instruments**<br>To perform a payment with a particular Payment Instrument specify the [Payment Instrument in the payment request](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-using-tokens_authorization-with-customer-payment-instrument-and-shipping-address-token-id_liveconsole-tab-request-body).
* @summary Create a Payment Instrument
* @param {V1PaymentinstrumentsBody} body
* @param {string} [profileId] The Id of a profile containing user specific TMS configuration.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PaymentInstrumentApi
*/
postPaymentInstrument(body, profileId, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.PaymentInstrumentApiFp)(this.configuration).postPaymentInstrument(body, profileId, options).then((request) => request(this.axios, options.runEnvironment != null ? `https://${options.runEnvironment}` : this.basePath));
});
}
}
exports.PaymentInstrumentApi = PaymentInstrumentApi;