/* tslint:disable */ /* eslint-disable */ /** * cards * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded, } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap, } from '../base'; // @ts-ignore import type { AccountBalances } from '../models'; // @ts-ignore import type { AuthorizationHold } from '../models'; // @ts-ignore import type { AuthorizationHoldAmountAdjustmentRequest } from '../models'; // @ts-ignore import type { CardTransactionInput } from '../models'; // @ts-ignore import type { CardTransactionOutput } from '../models'; // @ts-ignore import type { CardTransactionReversal } from '../models'; // @ts-ignore import type { ErrorResponse } from '../models'; // @ts-ignore import type { GetAuthorizationHold } from '../models'; // @ts-ignore import type { GetCardTransaction } from '../models'; // @ts-ignore import type { PatchOperation } from '../models'; /** * CardsApi - axios parameter creator */ export const CardsApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * * @summary Create an authorization hold corresponding to a given card. * @param {string} cardReferenceToken The token used to externally identify the card. * @param {AuthorizationHold} authorizationHold The authorization hold to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createAuthorizationHold: async ( cardReferenceToken: string, authorizationHold: AuthorizationHold, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'cardReferenceToken' is not null or undefined assertParamExists( 'createAuthorizationHold', 'cardReferenceToken', cardReferenceToken, ); // verify required parameter 'authorizationHold' is not null or undefined assertParamExists( 'createAuthorizationHold', 'authorizationHold', authorizationHold, ); const localVarPath = `/cards/{cardReferenceToken}/authorizationholds`.replace( `{${'cardReferenceToken'}}`, encodeURIComponent(String(cardReferenceToken)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( authorizationHold, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Create a financial transaction corresponding to a given card * @param {string} cardReferenceToken The token used to externally identify the card. * @param {CardTransactionInput} cardTransactionInput The financial transaction to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createCardTransaction: async ( cardReferenceToken: string, cardTransactionInput: CardTransactionInput, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'cardReferenceToken' is not null or undefined assertParamExists( 'createCardTransaction', 'cardReferenceToken', cardReferenceToken, ); // verify required parameter 'cardTransactionInput' is not null or undefined assertParamExists( 'createCardTransaction', 'cardTransactionInput', cardTransactionInput, ); const localVarPath = `/cards/{cardReferenceToken}/financialtransactions`.replace( `{${'cardReferenceToken'}}`, encodeURIComponent(String(cardReferenceToken)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( cardTransactionInput, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Decreases the amount of an authorization hold. If the amount is greater or equal to the authorization hold amount, then the authorization hold is reversed. * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} authorizationHoldExternalReferenceId The ID used to reference the authorization hold. * @param {AuthorizationHoldAmountAdjustmentRequest} authorizationHoldAmountAdjustmentRequest Represents the information to decrease the amount of an authorization hold. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ decreaseAuthorizationHold: async ( cardReferenceToken: string, authorizationHoldExternalReferenceId: string, authorizationHoldAmountAdjustmentRequest: AuthorizationHoldAmountAdjustmentRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'cardReferenceToken' is not null or undefined assertParamExists( 'decreaseAuthorizationHold', 'cardReferenceToken', cardReferenceToken, ); // verify required parameter 'authorizationHoldExternalReferenceId' is not null or undefined assertParamExists( 'decreaseAuthorizationHold', 'authorizationHoldExternalReferenceId', authorizationHoldExternalReferenceId, ); // verify required parameter 'authorizationHoldAmountAdjustmentRequest' is not null or undefined assertParamExists( 'decreaseAuthorizationHold', 'authorizationHoldAmountAdjustmentRequest', authorizationHoldAmountAdjustmentRequest, ); const localVarPath = `/cards/{cardReferenceToken}/authorizationholds/{authorizationHoldExternalReferenceId}:decrease` .replace( `{${'cardReferenceToken'}}`, encodeURIComponent(String(cardReferenceToken)), ) .replace( `{${'authorizationHoldExternalReferenceId'}}`, encodeURIComponent(String(authorizationHoldExternalReferenceId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( authorizationHoldAmountAdjustmentRequest, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get account balances using card tokens * @param {string} cardReferenceToken The token used to externally identify the card. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAccountBalances: async ( cardReferenceToken: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'cardReferenceToken' is not null or undefined assertParamExists( 'getAccountBalances', 'cardReferenceToken', cardReferenceToken, ); const localVarPath = `/cards/{cardReferenceToken}/balanceInquiry`.replace( `{${'cardReferenceToken'}}`, encodeURIComponent(String(cardReferenceToken)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get card authorization hold * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} authorizationHoldExternalReferenceId The ID used to reference the authorization hold. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAuthorizationHoldById: async ( cardReferenceToken: string, authorizationHoldExternalReferenceId: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'cardReferenceToken' is not null or undefined assertParamExists( 'getAuthorizationHoldById', 'cardReferenceToken', cardReferenceToken, ); // verify required parameter 'authorizationHoldExternalReferenceId' is not null or undefined assertParamExists( 'getAuthorizationHoldById', 'authorizationHoldExternalReferenceId', authorizationHoldExternalReferenceId, ); const localVarPath = `/cards/{cardReferenceToken}/authorizationholds/{authorizationHoldExternalReferenceId}` .replace( `{${'cardReferenceToken'}}`, encodeURIComponent(String(cardReferenceToken)), ) .replace( `{${'authorizationHoldExternalReferenceId'}}`, encodeURIComponent(String(authorizationHoldExternalReferenceId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get card transaction * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} cardTransactionExternalReferenceId The external reference of a card transaction used to identify the card transaction. * @param {GetCardTransactionDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCardTransaction: async ( cardReferenceToken: string, cardTransactionExternalReferenceId: string, detailsLevel?: GetCardTransactionDetailsLevelEnum, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'cardReferenceToken' is not null or undefined assertParamExists( 'getCardTransaction', 'cardReferenceToken', cardReferenceToken, ); // verify required parameter 'cardTransactionExternalReferenceId' is not null or undefined assertParamExists( 'getCardTransaction', 'cardTransactionExternalReferenceId', cardTransactionExternalReferenceId, ); const localVarPath = `/cards/{cardReferenceToken}/financialtransactions/{cardTransactionExternalReferenceId}` .replace( `{${'cardReferenceToken'}}`, encodeURIComponent(String(cardReferenceToken)), ) .replace( `{${'cardTransactionExternalReferenceId'}}`, encodeURIComponent(String(cardTransactionExternalReferenceId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); if (detailsLevel !== undefined) { localVarQueryParameter['detailsLevel'] = detailsLevel; } localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Increase authorization hold amount * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} authorizationHoldExternalReferenceId The ID used to reference the authorization hold. * @param {AuthorizationHoldAmountAdjustmentRequest} authorizationHoldAmountAdjustmentRequest Represents the information to increase the amount of an authorization hold. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ increaseAuthorizationHold: async ( cardReferenceToken: string, authorizationHoldExternalReferenceId: string, authorizationHoldAmountAdjustmentRequest: AuthorizationHoldAmountAdjustmentRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'cardReferenceToken' is not null or undefined assertParamExists( 'increaseAuthorizationHold', 'cardReferenceToken', cardReferenceToken, ); // verify required parameter 'authorizationHoldExternalReferenceId' is not null or undefined assertParamExists( 'increaseAuthorizationHold', 'authorizationHoldExternalReferenceId', authorizationHoldExternalReferenceId, ); // verify required parameter 'authorizationHoldAmountAdjustmentRequest' is not null or undefined assertParamExists( 'increaseAuthorizationHold', 'authorizationHoldAmountAdjustmentRequest', authorizationHoldAmountAdjustmentRequest, ); const localVarPath = `/cards/{cardReferenceToken}/authorizationholds/{authorizationHoldExternalReferenceId}:increase` .replace( `{${'cardReferenceToken'}}`, encodeURIComponent(String(cardReferenceToken)), ) .replace( `{${'authorizationHoldExternalReferenceId'}}`, encodeURIComponent(String(authorizationHoldExternalReferenceId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( authorizationHoldAmountAdjustmentRequest, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Partially update an authorization hold * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} authorizationHoldExternalReferenceId The ID used to reference the authorization hold. * @param {Array} patchOperation Patch operations to be applied to a resource. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ patchAuthorizationHold: async ( cardReferenceToken: string, authorizationHoldExternalReferenceId: string, patchOperation: Array, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'cardReferenceToken' is not null or undefined assertParamExists( 'patchAuthorizationHold', 'cardReferenceToken', cardReferenceToken, ); // verify required parameter 'authorizationHoldExternalReferenceId' is not null or undefined assertParamExists( 'patchAuthorizationHold', 'authorizationHoldExternalReferenceId', authorizationHoldExternalReferenceId, ); // verify required parameter 'patchOperation' is not null or undefined assertParamExists( 'patchAuthorizationHold', 'patchOperation', patchOperation, ); const localVarPath = `/cards/{cardReferenceToken}/authorizationholds/{authorizationHoldExternalReferenceId}` .replace( `{${'cardReferenceToken'}}`, encodeURIComponent(String(cardReferenceToken)), ) .replace( `{${'authorizationHoldExternalReferenceId'}}`, encodeURIComponent(String(authorizationHoldExternalReferenceId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( patchOperation, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Reverse a card authorization hold. * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} authorizationHoldExternalReferenceId The ID used to reference the authorization hold. * @param {*} [options] Override http request option. * @throws {RequiredError} */ reverseAuthorizationHold: async ( cardReferenceToken: string, authorizationHoldExternalReferenceId: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'cardReferenceToken' is not null or undefined assertParamExists( 'reverseAuthorizationHold', 'cardReferenceToken', cardReferenceToken, ); // verify required parameter 'authorizationHoldExternalReferenceId' is not null or undefined assertParamExists( 'reverseAuthorizationHold', 'authorizationHoldExternalReferenceId', authorizationHoldExternalReferenceId, ); const localVarPath = `/cards/{cardReferenceToken}/authorizationholds/{authorizationHoldExternalReferenceId}` .replace( `{${'cardReferenceToken'}}`, encodeURIComponent(String(cardReferenceToken)), ) .replace( `{${'authorizationHoldExternalReferenceId'}}`, encodeURIComponent(String(authorizationHoldExternalReferenceId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Reverse card transaction * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} cardTransactionExternalReferenceId The external reference of a card transaction used to identify the card transaction. * @param {CardTransactionReversal} cardTransactionReversal The card transaction to be reversed. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ reverseCardTransaction: async ( cardReferenceToken: string, cardTransactionExternalReferenceId: string, cardTransactionReversal: CardTransactionReversal, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'cardReferenceToken' is not null or undefined assertParamExists( 'reverseCardTransaction', 'cardReferenceToken', cardReferenceToken, ); // verify required parameter 'cardTransactionExternalReferenceId' is not null or undefined assertParamExists( 'reverseCardTransaction', 'cardTransactionExternalReferenceId', cardTransactionExternalReferenceId, ); // verify required parameter 'cardTransactionReversal' is not null or undefined assertParamExists( 'reverseCardTransaction', 'cardTransactionReversal', cardTransactionReversal, ); const localVarPath = `/cards/{cardReferenceToken}/financialtransactions/{cardTransactionExternalReferenceId}:decrease` .replace( `{${'cardReferenceToken'}}`, encodeURIComponent(String(cardReferenceToken)), ) .replace( `{${'cardTransactionExternalReferenceId'}}`, encodeURIComponent(String(cardTransactionExternalReferenceId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( cardTransactionReversal, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * CardsApi - functional programming interface */ export const CardsApiFp = function (configuration?: Configuration) { const localVarAxiosParamCreator = CardsApiAxiosParamCreator(configuration); return { /** * * @summary Create an authorization hold corresponding to a given card. * @param {string} cardReferenceToken The token used to externally identify the card. * @param {AuthorizationHold} authorizationHold The authorization hold to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createAuthorizationHold( cardReferenceToken: string, authorizationHold: AuthorizationHold, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.createAuthorizationHold( cardReferenceToken, authorizationHold, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CardsApi.createAuthorizationHold']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Create a financial transaction corresponding to a given card * @param {string} cardReferenceToken The token used to externally identify the card. * @param {CardTransactionInput} cardTransactionInput The financial transaction to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createCardTransaction( cardReferenceToken: string, cardTransactionInput: CardTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.createCardTransaction( cardReferenceToken, cardTransactionInput, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CardsApi.createCardTransaction']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Decreases the amount of an authorization hold. If the amount is greater or equal to the authorization hold amount, then the authorization hold is reversed. * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} authorizationHoldExternalReferenceId The ID used to reference the authorization hold. * @param {AuthorizationHoldAmountAdjustmentRequest} authorizationHoldAmountAdjustmentRequest Represents the information to decrease the amount of an authorization hold. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async decreaseAuthorizationHold( cardReferenceToken: string, authorizationHoldExternalReferenceId: string, authorizationHoldAmountAdjustmentRequest: AuthorizationHoldAmountAdjustmentRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.decreaseAuthorizationHold( cardReferenceToken, authorizationHoldExternalReferenceId, authorizationHoldAmountAdjustmentRequest, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CardsApi.decreaseAuthorizationHold']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get account balances using card tokens * @param {string} cardReferenceToken The token used to externally identify the card. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAccountBalances( cardReferenceToken: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getAccountBalances( cardReferenceToken, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CardsApi.getAccountBalances']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get card authorization hold * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} authorizationHoldExternalReferenceId The ID used to reference the authorization hold. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAuthorizationHoldById( cardReferenceToken: string, authorizationHoldExternalReferenceId: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getAuthorizationHoldById( cardReferenceToken, authorizationHoldExternalReferenceId, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CardsApi.getAuthorizationHoldById']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get card transaction * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} cardTransactionExternalReferenceId The external reference of a card transaction used to identify the card transaction. * @param {GetCardTransactionDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getCardTransaction( cardReferenceToken: string, cardTransactionExternalReferenceId: string, detailsLevel?: GetCardTransactionDetailsLevelEnum, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getCardTransaction( cardReferenceToken, cardTransactionExternalReferenceId, detailsLevel, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CardsApi.getCardTransaction']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Increase authorization hold amount * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} authorizationHoldExternalReferenceId The ID used to reference the authorization hold. * @param {AuthorizationHoldAmountAdjustmentRequest} authorizationHoldAmountAdjustmentRequest Represents the information to increase the amount of an authorization hold. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async increaseAuthorizationHold( cardReferenceToken: string, authorizationHoldExternalReferenceId: string, authorizationHoldAmountAdjustmentRequest: AuthorizationHoldAmountAdjustmentRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.increaseAuthorizationHold( cardReferenceToken, authorizationHoldExternalReferenceId, authorizationHoldAmountAdjustmentRequest, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CardsApi.increaseAuthorizationHold']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Partially update an authorization hold * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} authorizationHoldExternalReferenceId The ID used to reference the authorization hold. * @param {Array} patchOperation Patch operations to be applied to a resource. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async patchAuthorizationHold( cardReferenceToken: string, authorizationHoldExternalReferenceId: string, patchOperation: Array, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.patchAuthorizationHold( cardReferenceToken, authorizationHoldExternalReferenceId, patchOperation, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CardsApi.patchAuthorizationHold']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Reverse a card authorization hold. * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} authorizationHoldExternalReferenceId The ID used to reference the authorization hold. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async reverseAuthorizationHold( cardReferenceToken: string, authorizationHoldExternalReferenceId: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.reverseAuthorizationHold( cardReferenceToken, authorizationHoldExternalReferenceId, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CardsApi.reverseAuthorizationHold']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Reverse card transaction * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} cardTransactionExternalReferenceId The external reference of a card transaction used to identify the card transaction. * @param {CardTransactionReversal} cardTransactionReversal The card transaction to be reversed. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async reverseCardTransaction( cardReferenceToken: string, cardTransactionExternalReferenceId: string, cardTransactionReversal: CardTransactionReversal, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.reverseCardTransaction( cardReferenceToken, cardTransactionExternalReferenceId, cardTransactionReversal, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CardsApi.reverseCardTransaction']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * CardsApi - factory interface */ export const CardsApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = CardsApiFp(configuration); return { /** * * @summary Create an authorization hold corresponding to a given card. * @param {string} cardReferenceToken The token used to externally identify the card. * @param {AuthorizationHold} authorizationHold The authorization hold to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createAuthorizationHold( cardReferenceToken: string, authorizationHold: AuthorizationHold, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .createAuthorizationHold( cardReferenceToken, authorizationHold, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Create a financial transaction corresponding to a given card * @param {string} cardReferenceToken The token used to externally identify the card. * @param {CardTransactionInput} cardTransactionInput The financial transaction to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createCardTransaction( cardReferenceToken: string, cardTransactionInput: CardTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .createCardTransaction( cardReferenceToken, cardTransactionInput, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Decreases the amount of an authorization hold. If the amount is greater or equal to the authorization hold amount, then the authorization hold is reversed. * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} authorizationHoldExternalReferenceId The ID used to reference the authorization hold. * @param {AuthorizationHoldAmountAdjustmentRequest} authorizationHoldAmountAdjustmentRequest Represents the information to decrease the amount of an authorization hold. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ decreaseAuthorizationHold( cardReferenceToken: string, authorizationHoldExternalReferenceId: string, authorizationHoldAmountAdjustmentRequest: AuthorizationHoldAmountAdjustmentRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .decreaseAuthorizationHold( cardReferenceToken, authorizationHoldExternalReferenceId, authorizationHoldAmountAdjustmentRequest, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Get account balances using card tokens * @param {string} cardReferenceToken The token used to externally identify the card. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAccountBalances( cardReferenceToken: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getAccountBalances(cardReferenceToken, options) .then((request) => request(axios, basePath)); }, /** * * @summary Get card authorization hold * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} authorizationHoldExternalReferenceId The ID used to reference the authorization hold. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAuthorizationHoldById( cardReferenceToken: string, authorizationHoldExternalReferenceId: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getAuthorizationHoldById( cardReferenceToken, authorizationHoldExternalReferenceId, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Get card transaction * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} cardTransactionExternalReferenceId The external reference of a card transaction used to identify the card transaction. * @param {GetCardTransactionDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCardTransaction( cardReferenceToken: string, cardTransactionExternalReferenceId: string, detailsLevel?: GetCardTransactionDetailsLevelEnum, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getCardTransaction( cardReferenceToken, cardTransactionExternalReferenceId, detailsLevel, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Increase authorization hold amount * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} authorizationHoldExternalReferenceId The ID used to reference the authorization hold. * @param {AuthorizationHoldAmountAdjustmentRequest} authorizationHoldAmountAdjustmentRequest Represents the information to increase the amount of an authorization hold. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ increaseAuthorizationHold( cardReferenceToken: string, authorizationHoldExternalReferenceId: string, authorizationHoldAmountAdjustmentRequest: AuthorizationHoldAmountAdjustmentRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .increaseAuthorizationHold( cardReferenceToken, authorizationHoldExternalReferenceId, authorizationHoldAmountAdjustmentRequest, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Partially update an authorization hold * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} authorizationHoldExternalReferenceId The ID used to reference the authorization hold. * @param {Array} patchOperation Patch operations to be applied to a resource. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ patchAuthorizationHold( cardReferenceToken: string, authorizationHoldExternalReferenceId: string, patchOperation: Array, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .patchAuthorizationHold( cardReferenceToken, authorizationHoldExternalReferenceId, patchOperation, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Reverse a card authorization hold. * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} authorizationHoldExternalReferenceId The ID used to reference the authorization hold. * @param {*} [options] Override http request option. * @throws {RequiredError} */ reverseAuthorizationHold( cardReferenceToken: string, authorizationHoldExternalReferenceId: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .reverseAuthorizationHold( cardReferenceToken, authorizationHoldExternalReferenceId, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Reverse card transaction * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} cardTransactionExternalReferenceId The external reference of a card transaction used to identify the card transaction. * @param {CardTransactionReversal} cardTransactionReversal The card transaction to be reversed. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ reverseCardTransaction( cardReferenceToken: string, cardTransactionExternalReferenceId: string, cardTransactionReversal: CardTransactionReversal, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .reverseCardTransaction( cardReferenceToken, cardTransactionExternalReferenceId, cardTransactionReversal, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, }; }; /** * CardsApi - object-oriented interface */ export class CardsApi extends BaseAPI { /** * * @summary Create an authorization hold corresponding to a given card. * @param {string} cardReferenceToken The token used to externally identify the card. * @param {AuthorizationHold} authorizationHold The authorization hold to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public createAuthorizationHold( cardReferenceToken: string, authorizationHold: AuthorizationHold, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return CardsApiFp(this.configuration) .createAuthorizationHold( cardReferenceToken, authorizationHold, idempotencyKey, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Create a financial transaction corresponding to a given card * @param {string} cardReferenceToken The token used to externally identify the card. * @param {CardTransactionInput} cardTransactionInput The financial transaction to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public createCardTransaction( cardReferenceToken: string, cardTransactionInput: CardTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return CardsApiFp(this.configuration) .createCardTransaction( cardReferenceToken, cardTransactionInput, idempotencyKey, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Decreases the amount of an authorization hold. If the amount is greater or equal to the authorization hold amount, then the authorization hold is reversed. * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} authorizationHoldExternalReferenceId The ID used to reference the authorization hold. * @param {AuthorizationHoldAmountAdjustmentRequest} authorizationHoldAmountAdjustmentRequest Represents the information to decrease the amount of an authorization hold. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public decreaseAuthorizationHold( cardReferenceToken: string, authorizationHoldExternalReferenceId: string, authorizationHoldAmountAdjustmentRequest: AuthorizationHoldAmountAdjustmentRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return CardsApiFp(this.configuration) .decreaseAuthorizationHold( cardReferenceToken, authorizationHoldExternalReferenceId, authorizationHoldAmountAdjustmentRequest, idempotencyKey, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get account balances using card tokens * @param {string} cardReferenceToken The token used to externally identify the card. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getAccountBalances( cardReferenceToken: string, options?: RawAxiosRequestConfig, ) { return CardsApiFp(this.configuration) .getAccountBalances(cardReferenceToken, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get card authorization hold * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} authorizationHoldExternalReferenceId The ID used to reference the authorization hold. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getAuthorizationHoldById( cardReferenceToken: string, authorizationHoldExternalReferenceId: string, options?: RawAxiosRequestConfig, ) { return CardsApiFp(this.configuration) .getAuthorizationHoldById( cardReferenceToken, authorizationHoldExternalReferenceId, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get card transaction * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} cardTransactionExternalReferenceId The external reference of a card transaction used to identify the card transaction. * @param {GetCardTransactionDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getCardTransaction( cardReferenceToken: string, cardTransactionExternalReferenceId: string, detailsLevel?: GetCardTransactionDetailsLevelEnum, options?: RawAxiosRequestConfig, ) { return CardsApiFp(this.configuration) .getCardTransaction( cardReferenceToken, cardTransactionExternalReferenceId, detailsLevel, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Increase authorization hold amount * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} authorizationHoldExternalReferenceId The ID used to reference the authorization hold. * @param {AuthorizationHoldAmountAdjustmentRequest} authorizationHoldAmountAdjustmentRequest Represents the information to increase the amount of an authorization hold. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public increaseAuthorizationHold( cardReferenceToken: string, authorizationHoldExternalReferenceId: string, authorizationHoldAmountAdjustmentRequest: AuthorizationHoldAmountAdjustmentRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return CardsApiFp(this.configuration) .increaseAuthorizationHold( cardReferenceToken, authorizationHoldExternalReferenceId, authorizationHoldAmountAdjustmentRequest, idempotencyKey, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Partially update an authorization hold * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} authorizationHoldExternalReferenceId The ID used to reference the authorization hold. * @param {Array} patchOperation Patch operations to be applied to a resource. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public patchAuthorizationHold( cardReferenceToken: string, authorizationHoldExternalReferenceId: string, patchOperation: Array, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return CardsApiFp(this.configuration) .patchAuthorizationHold( cardReferenceToken, authorizationHoldExternalReferenceId, patchOperation, idempotencyKey, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Reverse a card authorization hold. * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} authorizationHoldExternalReferenceId The ID used to reference the authorization hold. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public reverseAuthorizationHold( cardReferenceToken: string, authorizationHoldExternalReferenceId: string, options?: RawAxiosRequestConfig, ) { return CardsApiFp(this.configuration) .reverseAuthorizationHold( cardReferenceToken, authorizationHoldExternalReferenceId, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Reverse card transaction * @param {string} cardReferenceToken The token used to externally identify the card. * @param {string} cardTransactionExternalReferenceId The external reference of a card transaction used to identify the card transaction. * @param {CardTransactionReversal} cardTransactionReversal The card transaction to be reversed. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public reverseCardTransaction( cardReferenceToken: string, cardTransactionExternalReferenceId: string, cardTransactionReversal: CardTransactionReversal, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return CardsApiFp(this.configuration) .reverseCardTransaction( cardReferenceToken, cardTransactionExternalReferenceId, cardTransactionReversal, idempotencyKey, options, ) .then((request) => request(this.axios, this.basePath)); } } export const GetCardTransactionDetailsLevelEnum = { Basic: 'BASIC', Full: 'FULL', } as const; export type GetCardTransactionDetailsLevelEnum = (typeof GetCardTransactionDetailsLevelEnum)[keyof typeof GetCardTransactionDetailsLevelEnum];