@paciolan/cybersource-sdk
Version:
CyberSource REST API Typescript SDK
526 lines (525 loc) • 31.8 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.VoidApi = exports.VoidApiFactory = exports.VoidApiFp = exports.VoidApiAxiosParamCreator = 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");
/**
* VoidApi - axios parameter creator
* @export
*/
const VoidApiAxiosParamCreator = function (configuration) {
return {
/**
* This is to void a previous payment, capture, refund, or credit that merchant does not receive a reply(Mostly due to timeout). To use this feature/API, make sure to pass unique value to field - clientReferenceInformation -> transactionId in your payment, capture, refund, or credit API call and use same transactionId in this API request payload to reverse the payment.
* @summary Timeout Void
* @param {V2VoidsBody} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
mitVoid: (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 mitVoid.');
}
const localVarPath = `/pts/v2/voids`;
// 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,
};
}),
/**
* Refund a capture API is only used, if you have requested Capture independenlty using [/pts/v2/payments/{id}/captures](https://developer.cybersource.com/api-reference-assets/index.html#payments_capture) API call. Include the capture ID in the POST request to cancel the capture.
* @summary Void a Capture
* @param {IdVoidsBody1} body
* @param {string} id The capture ID returned from a previous capture request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
voidCapture: (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 voidCapture.');
}
// 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 voidCapture.');
}
const localVarPath = `/pts/v2/captures/{id}/voids`
.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,
};
}),
/**
* Include the credit ID in the POST request to cancel the credit.
* @summary Void a Credit
* @param {IdVoidsBody3} body
* @param {string} id The credit ID returned from a previous credit request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
voidCredit: (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 voidCredit.');
}
// 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 voidCredit.');
}
const localVarPath = `/pts/v2/credits/{id}/voids`
.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,
};
}),
/**
* Void a Payment API is only used, if you have requested Authorization and Capture together in [/pts/v2/payments](https://developer.cybersource.com/api-reference-assets/index.html#payments_payments) API call. Include the payment ID in the POST request to cancel the payment.
* @summary Void a Payment
* @param {IdVoidsBody} body
* @param {string} id The payment ID returned from a previous payment request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
voidPayment: (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 voidPayment.');
}
// 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 voidPayment.');
}
const localVarPath = `/pts/v2/payments/{id}/voids`
.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,
};
}),
/**
* Include the refund ID in the POST request to cancel the refund.
* @summary Void a Refund
* @param {IdVoidsBody2} body
* @param {string} id The refund ID returned from a previous refund request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
voidRefund: (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 voidRefund.');
}
// 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 voidRefund.');
}
const localVarPath = `/pts/v2/refunds/{id}/voids`
.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,
};
}),
};
};
exports.VoidApiAxiosParamCreator = VoidApiAxiosParamCreator;
/**
* VoidApi - functional programming interface
* @export
*/
const VoidApiFp = function (configuration) {
return {
/**
* This is to void a previous payment, capture, refund, or credit that merchant does not receive a reply(Mostly due to timeout). To use this feature/API, make sure to pass unique value to field - clientReferenceInformation -> transactionId in your payment, capture, refund, or credit API call and use same transactionId in this API request payload to reverse the payment.
* @summary Timeout Void
* @param {V2VoidsBody} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
mitVoid(body, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield (0, exports.VoidApiAxiosParamCreator)(configuration).mitVoid(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);
};
});
},
/**
* Refund a capture API is only used, if you have requested Capture independenlty using [/pts/v2/payments/{id}/captures](https://developer.cybersource.com/api-reference-assets/index.html#payments_capture) API call. Include the capture ID in the POST request to cancel the capture.
* @summary Void a Capture
* @param {IdVoidsBody1} body
* @param {string} id The capture ID returned from a previous capture request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
voidCapture(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield (0, exports.VoidApiAxiosParamCreator)(configuration).voidCapture(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);
};
});
},
/**
* Include the credit ID in the POST request to cancel the credit.
* @summary Void a Credit
* @param {IdVoidsBody3} body
* @param {string} id The credit ID returned from a previous credit request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
voidCredit(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield (0, exports.VoidApiAxiosParamCreator)(configuration).voidCredit(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);
};
});
},
/**
* Void a Payment API is only used, if you have requested Authorization and Capture together in [/pts/v2/payments](https://developer.cybersource.com/api-reference-assets/index.html#payments_payments) API call. Include the payment ID in the POST request to cancel the payment.
* @summary Void a Payment
* @param {IdVoidsBody} body
* @param {string} id The payment ID returned from a previous payment request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
voidPayment(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield (0, exports.VoidApiAxiosParamCreator)(configuration).voidPayment(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);
};
});
},
/**
* Include the refund ID in the POST request to cancel the refund.
* @summary Void a Refund
* @param {IdVoidsBody2} body
* @param {string} id The refund ID returned from a previous refund request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
voidRefund(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield (0, exports.VoidApiAxiosParamCreator)(configuration).voidRefund(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.VoidApiFp = VoidApiFp;
/**
* VoidApi - factory interface
* @export
*/
const VoidApiFactory = function (configuration, basePath, axios) {
return {
/**
* This is to void a previous payment, capture, refund, or credit that merchant does not receive a reply(Mostly due to timeout). To use this feature/API, make sure to pass unique value to field - clientReferenceInformation -> transactionId in your payment, capture, refund, or credit API call and use same transactionId in this API request payload to reverse the payment.
* @summary Timeout Void
* @param {V2VoidsBody} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
mitVoid(body, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.VoidApiFp)(configuration).mitVoid(body, options).then((request) => request(axios, basePath));
});
},
/**
* Refund a capture API is only used, if you have requested Capture independenlty using [/pts/v2/payments/{id}/captures](https://developer.cybersource.com/api-reference-assets/index.html#payments_capture) API call. Include the capture ID in the POST request to cancel the capture.
* @summary Void a Capture
* @param {IdVoidsBody1} body
* @param {string} id The capture ID returned from a previous capture request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
voidCapture(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.VoidApiFp)(configuration).voidCapture(body, id, options).then((request) => request(axios, basePath));
});
},
/**
* Include the credit ID in the POST request to cancel the credit.
* @summary Void a Credit
* @param {IdVoidsBody3} body
* @param {string} id The credit ID returned from a previous credit request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
voidCredit(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.VoidApiFp)(configuration).voidCredit(body, id, options).then((request) => request(axios, basePath));
});
},
/**
* Void a Payment API is only used, if you have requested Authorization and Capture together in [/pts/v2/payments](https://developer.cybersource.com/api-reference-assets/index.html#payments_payments) API call. Include the payment ID in the POST request to cancel the payment.
* @summary Void a Payment
* @param {IdVoidsBody} body
* @param {string} id The payment ID returned from a previous payment request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
voidPayment(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.VoidApiFp)(configuration).voidPayment(body, id, options).then((request) => request(axios, basePath));
});
},
/**
* Include the refund ID in the POST request to cancel the refund.
* @summary Void a Refund
* @param {IdVoidsBody2} body
* @param {string} id The refund ID returned from a previous refund request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
voidRefund(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.VoidApiFp)(configuration).voidRefund(body, id, options).then((request) => request(axios, basePath));
});
},
};
};
exports.VoidApiFactory = VoidApiFactory;
/**
* VoidApi - object-oriented interface
* @export
* @class VoidApi
* @extends {BaseAPI}
*/
class VoidApi extends base_1.BaseAPI {
/**
* This is to void a previous payment, capture, refund, or credit that merchant does not receive a reply(Mostly due to timeout). To use this feature/API, make sure to pass unique value to field - clientReferenceInformation -> transactionId in your payment, capture, refund, or credit API call and use same transactionId in this API request payload to reverse the payment.
* @summary Timeout Void
* @param {V2VoidsBody} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof VoidApi
*/
mitVoid(body, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.VoidApiFp)(this.configuration).mitVoid(body, options).then((request) => request(this.axios, options.runEnvironment != null ? `https://${options.runEnvironment}` : this.basePath));
});
}
/**
* Refund a capture API is only used, if you have requested Capture independenlty using [/pts/v2/payments/{id}/captures](https://developer.cybersource.com/api-reference-assets/index.html#payments_capture) API call. Include the capture ID in the POST request to cancel the capture.
* @summary Void a Capture
* @param {IdVoidsBody1} body
* @param {string} id The capture ID returned from a previous capture request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof VoidApi
*/
voidCapture(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.VoidApiFp)(this.configuration).voidCapture(body, id, options).then((request) => request(this.axios, options.runEnvironment != null ? `https://${options.runEnvironment}` : this.basePath));
});
}
/**
* Include the credit ID in the POST request to cancel the credit.
* @summary Void a Credit
* @param {IdVoidsBody3} body
* @param {string} id The credit ID returned from a previous credit request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof VoidApi
*/
voidCredit(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.VoidApiFp)(this.configuration).voidCredit(body, id, options).then((request) => request(this.axios, options.runEnvironment != null ? `https://${options.runEnvironment}` : this.basePath));
});
}
/**
* Void a Payment API is only used, if you have requested Authorization and Capture together in [/pts/v2/payments](https://developer.cybersource.com/api-reference-assets/index.html#payments_payments) API call. Include the payment ID in the POST request to cancel the payment.
* @summary Void a Payment
* @param {IdVoidsBody} body
* @param {string} id The payment ID returned from a previous payment request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof VoidApi
*/
voidPayment(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.VoidApiFp)(this.configuration).voidPayment(body, id, options).then((request) => request(this.axios, options.runEnvironment != null ? `https://${options.runEnvironment}` : this.basePath));
});
}
/**
* Include the refund ID in the POST request to cancel the refund.
* @summary Void a Refund
* @param {IdVoidsBody2} body
* @param {string} id The refund ID returned from a previous refund request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof VoidApi
*/
voidRefund(body, id, options) {
return __awaiter(this, void 0, void 0, function* () {
return (0, exports.VoidApiFp)(this.configuration).voidRefund(body, id, options).then((request) => request(this.axios, options.runEnvironment != null ? `https://${options.runEnvironment}` : this.basePath));
});
}
}
exports.VoidApi = VoidApi;