@paciolan/cybersource-sdk
Version:
CyberSource REST API Typescript SDK
610 lines (609 loc) • 37.3 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.PaymentsApi = exports.PaymentsApiFactory = exports.PaymentsApiFp = exports.PaymentsApiAxiosParamCreator = 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");
/**
* PaymentsApi - axios parameter creator
* @export
*/
const PaymentsApiAxiosParamCreator = function (configuration) {
return {
/**
* Create a Payment Order Request
* @summary Create a Payment Order Request
* @param {IdIntentsBody} body
* @param {string} id Request identifier number for the order request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createOrderRequest: (body, id, 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 createOrderRequest.');
}
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new base_1.RequiredError('id', 'Required parameter id was null or undefined when calling createOrderRequest.');
}
const localVarPath = `/pts/v2/payment-references/{id}/intents`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// 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 = {};
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,
};
}),
/**
* A payment authorizes the amount for the transaction. There are a number of supported payment features, such as E-commerce and Card Present - Credit Card/Debit Card, Echeck, e-Wallets, Level II/III Data, etc.. A payment response includes the status of the request. It also includes processor-specific information when the request is successful and errors if unsuccessful. See the [Payments Developer Guides Page](https://developer.cybersource.com/docs/cybs/en-us/payments/developer/ctv/rest/payments/payments-intro.html). Authorization can be requested with Capture, Decision Manager, Payer Authentication(3ds), and Token Creation.
* @summary Process a Payment
* @param {V2PaymentsBody} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createPayment: (body, 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 createPayment.');
}
const localVarPath = `/pts/v2/payments`;
// 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 = {};
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,
};
}),
/**
* Create Alternative Payments Sessions Request
* @summary Create Alternative Payments Sessions Request
* @param {V2PaymentreferencesBody} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createSessionRequest: (body, 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 createSessionRequest.');
}
const localVarPath = `/pts/v2/payment-references`;
// 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 = {};
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,
};
}),
/**
* Use this service to authorize additional charges in a lodging or autorental transaction. Include the ID returned from the original authorization in the PATCH request to add additional charges to that authorization.
* @summary Increment an Authorization
* @param {PaymentsIdBody} body
* @param {string} id The ID returned from the original authorization request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
incrementAuth: (body, id, 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 incrementAuth.');
}
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new base_1.RequiredError('id', 'Required parameter id was null or undefined when calling incrementAuth.');
}
const localVarPath = `/pts/v2/payments/{id}`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// 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 = {};
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,
};
}),
/**
* Checks and updates the payment status
* @summary Check a Payment Status
* @param {RefreshpaymentstatusIdBody} body
* @param {string} id The payment id whose status needs to be checked and updated.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
refreshPaymentStatus: (body, id, 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 refreshPaymentStatus.');
}
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new base_1.RequiredError('id', 'Required parameter id was null or undefined when calling refreshPaymentStatus.');
}
const localVarPath = `/pts/v2/refresh-payment-status/{id}`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// 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 = {};
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,
};
}),
/**
* Update Alternative Payments Sessions Request
* @summary Update Alternative Payments Sessions Request
* @param {PaymentreferencesIdBody} body
* @param {string} id The payment ID. This ID is returned from a previous payment request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateSessionReq: (body, id, 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 updateSessionReq.');
}
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new base_1.RequiredError('id', 'Required parameter id was null or undefined when calling updateSessionReq.');
}
const localVarPath = `/pts/v2/payment-references/{id}`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// 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 = {};
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.PaymentsApiAxiosParamCreator = PaymentsApiAxiosParamCreator;
/**
* PaymentsApi - functional programming interface
* @export
*/
const PaymentsApiFp = function (configuration) {
return {
/**
* Create a Payment Order Request
* @summary Create a Payment Order Request
* @param {IdIntentsBody} body
* @param {string} id Request identifier number for the order request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createOrderRequest(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield (0, exports.PaymentsApiAxiosParamCreator)(configuration).createOrderRequest(body, id, 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);
};
});
},
/**
* A payment authorizes the amount for the transaction. There are a number of supported payment features, such as E-commerce and Card Present - Credit Card/Debit Card, Echeck, e-Wallets, Level II/III Data, etc.. A payment response includes the status of the request. It also includes processor-specific information when the request is successful and errors if unsuccessful. See the [Payments Developer Guides Page](https://developer.cybersource.com/docs/cybs/en-us/payments/developer/ctv/rest/payments/payments-intro.html). Authorization can be requested with Capture, Decision Manager, Payer Authentication(3ds), and Token Creation.
* @summary Process a Payment
* @param {V2PaymentsBody} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createPayment(body, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield (0, exports.PaymentsApiAxiosParamCreator)(configuration).createPayment(body, 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);
};
});
},
/**
* Create Alternative Payments Sessions Request
* @summary Create Alternative Payments Sessions Request
* @param {V2PaymentreferencesBody} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createSessionRequest(body, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield (0, exports.PaymentsApiAxiosParamCreator)(configuration).createSessionRequest(body, 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);
};
});
},
/**
* Use this service to authorize additional charges in a lodging or autorental transaction. Include the ID returned from the original authorization in the PATCH request to add additional charges to that authorization.
* @summary Increment an Authorization
* @param {PaymentsIdBody} body
* @param {string} id The ID returned from the original authorization request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
incrementAuth(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield (0, exports.PaymentsApiAxiosParamCreator)(configuration).incrementAuth(body, id, 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);
};
});
},
/**
* Checks and updates the payment status
* @summary Check a Payment Status
* @param {RefreshpaymentstatusIdBody} body
* @param {string} id The payment id whose status needs to be checked and updated.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
refreshPaymentStatus(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield (0, exports.PaymentsApiAxiosParamCreator)(configuration).refreshPaymentStatus(body, id, 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);
};
});
},
/**
* Update Alternative Payments Sessions Request
* @summary Update Alternative Payments Sessions Request
* @param {PaymentreferencesIdBody} body
* @param {string} id The payment ID. This ID is returned from a previous payment request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateSessionReq(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield (0, exports.PaymentsApiAxiosParamCreator)(configuration).updateSessionReq(body, id, 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.PaymentsApiFp = PaymentsApiFp;
/**
* PaymentsApi - factory interface
* @export
*/
const PaymentsApiFactory = function (configuration, basePath, axios) {
return {
/**
* Create a Payment Order Request
* @summary Create a Payment Order Request
* @param {IdIntentsBody} body
* @param {string} id Request identifier number for the order request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createOrderRequest(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.PaymentsApiFp)(configuration).createOrderRequest(body, id, options).then((request) => request(axios, basePath));
});
},
/**
* A payment authorizes the amount for the transaction. There are a number of supported payment features, such as E-commerce and Card Present - Credit Card/Debit Card, Echeck, e-Wallets, Level II/III Data, etc.. A payment response includes the status of the request. It also includes processor-specific information when the request is successful and errors if unsuccessful. See the [Payments Developer Guides Page](https://developer.cybersource.com/docs/cybs/en-us/payments/developer/ctv/rest/payments/payments-intro.html). Authorization can be requested with Capture, Decision Manager, Payer Authentication(3ds), and Token Creation.
* @summary Process a Payment
* @param {V2PaymentsBody} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createPayment(body, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.PaymentsApiFp)(configuration).createPayment(body, options).then((request) => request(axios, basePath));
});
},
/**
* Create Alternative Payments Sessions Request
* @summary Create Alternative Payments Sessions Request
* @param {V2PaymentreferencesBody} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createSessionRequest(body, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.PaymentsApiFp)(configuration).createSessionRequest(body, options).then((request) => request(axios, basePath));
});
},
/**
* Use this service to authorize additional charges in a lodging or autorental transaction. Include the ID returned from the original authorization in the PATCH request to add additional charges to that authorization.
* @summary Increment an Authorization
* @param {PaymentsIdBody} body
* @param {string} id The ID returned from the original authorization request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
incrementAuth(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.PaymentsApiFp)(configuration).incrementAuth(body, id, options).then((request) => request(axios, basePath));
});
},
/**
* Checks and updates the payment status
* @summary Check a Payment Status
* @param {RefreshpaymentstatusIdBody} body
* @param {string} id The payment id whose status needs to be checked and updated.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
refreshPaymentStatus(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.PaymentsApiFp)(configuration).refreshPaymentStatus(body, id, options).then((request) => request(axios, basePath));
});
},
/**
* Update Alternative Payments Sessions Request
* @summary Update Alternative Payments Sessions Request
* @param {PaymentreferencesIdBody} body
* @param {string} id The payment ID. This ID is returned from a previous payment request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateSessionReq(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.PaymentsApiFp)(configuration).updateSessionReq(body, id, options).then((request) => request(axios, basePath));
});
},
};
};
exports.PaymentsApiFactory = PaymentsApiFactory;
/**
* PaymentsApi - object-oriented interface
* @export
* @class PaymentsApi
* @extends {BaseAPI}
*/
class PaymentsApi extends base_1.BaseAPI {
/**
* Create a Payment Order Request
* @summary Create a Payment Order Request
* @param {IdIntentsBody} body
* @param {string} id Request identifier number for the order request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PaymentsApi
*/
createOrderRequest(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.PaymentsApiFp)(this.configuration).createOrderRequest(body, id, options).then((request) => request(this.axios, options.runEnvironment != null ? `https://${options.runEnvironment}` : this.basePath));
});
}
/**
* A payment authorizes the amount for the transaction. There are a number of supported payment features, such as E-commerce and Card Present - Credit Card/Debit Card, Echeck, e-Wallets, Level II/III Data, etc.. A payment response includes the status of the request. It also includes processor-specific information when the request is successful and errors if unsuccessful. See the [Payments Developer Guides Page](https://developer.cybersource.com/docs/cybs/en-us/payments/developer/ctv/rest/payments/payments-intro.html). Authorization can be requested with Capture, Decision Manager, Payer Authentication(3ds), and Token Creation.
* @summary Process a Payment
* @param {V2PaymentsBody} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PaymentsApi
*/
createPayment(body, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.PaymentsApiFp)(this.configuration).createPayment(body, options).then((request) => request(this.axios, options.runEnvironment != null ? `https://${options.runEnvironment}` : this.basePath));
});
}
/**
* Create Alternative Payments Sessions Request
* @summary Create Alternative Payments Sessions Request
* @param {V2PaymentreferencesBody} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PaymentsApi
*/
createSessionRequest(body, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.PaymentsApiFp)(this.configuration).createSessionRequest(body, options).then((request) => request(this.axios, options.runEnvironment != null ? `https://${options.runEnvironment}` : this.basePath));
});
}
/**
* Use this service to authorize additional charges in a lodging or autorental transaction. Include the ID returned from the original authorization in the PATCH request to add additional charges to that authorization.
* @summary Increment an Authorization
* @param {PaymentsIdBody} body
* @param {string} id The ID returned from the original authorization request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PaymentsApi
*/
incrementAuth(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.PaymentsApiFp)(this.configuration).incrementAuth(body, id, options).then((request) => request(this.axios, options.runEnvironment != null ? `https://${options.runEnvironment}` : this.basePath));
});
}
/**
* Checks and updates the payment status
* @summary Check a Payment Status
* @param {RefreshpaymentstatusIdBody} body
* @param {string} id The payment id whose status needs to be checked and updated.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PaymentsApi
*/
refreshPaymentStatus(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.PaymentsApiFp)(this.configuration).refreshPaymentStatus(body, id, options).then((request) => request(this.axios, options.runEnvironment != null ? `https://${options.runEnvironment}` : this.basePath));
});
}
/**
* Update Alternative Payments Sessions Request
* @summary Update Alternative Payments Sessions Request
* @param {PaymentreferencesIdBody} body
* @param {string} id The payment ID. This ID is returned from a previous payment request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PaymentsApi
*/
updateSessionReq(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.PaymentsApiFp)(this.configuration).updateSessionReq(body, id, options).then((request) => request(this.axios, options.runEnvironment != null ? `https://${options.runEnvironment}` : this.basePath));
});
}
}
exports.PaymentsApi = PaymentsApi;