UNPKG

@circle-fin/circle-sdk

Version:
1,053 lines (999 loc) 44.1 kB
/* tslint:disable */ /* eslint-disable */ /** * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; import { Configuration } from "../configuration"; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setBearerAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from "../common"; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from "../base"; // @ts-ignore import { BadRequest } from "../models"; // @ts-ignore import { CancelCreationRequest } from "../models"; // @ts-ignore import { CancelPaymentResponse } from "../models"; // @ts-ignore import { CaptureCreationRequest } from "../models"; // @ts-ignore import { CreatePaymentResponse } from "../models"; // @ts-ignore import { CreateWirePaymentResponse } from "../models"; // @ts-ignore import { GetPaymentResponse } from "../models"; // @ts-ignore import { ListPaymentsResponse } from "../models"; // @ts-ignore import { MockWirePaymentRequest } from "../models"; // @ts-ignore import { NotAuthorized } from "../models"; // @ts-ignore import { NotFound } from "../models"; // @ts-ignore import { PaymentCreationRequest } from "../models"; // @ts-ignore import { RefundCreationRequest } from "../models"; // @ts-ignore import { RefundPaymentResponse } from "../models"; /** * PaymentsApi - axios parameter creator * @export */ export const PaymentsApiAxiosParamCreator = function ( configuration?: Configuration ) { return { /** * The payment will be voided if possible meaning the payment source will not be charged & the payment will never settle. Otherwise, the payment will be refunded meaning the payment source will be charged & the payment will be refunded from deductions of future settlements. Not all payments are eligible to be cancelled. A successful response does *not* mean the payment has been cancelled; it only means the cancellation request is successfully submitted. * @summary Cancel a payment * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {CancelCreationRequest} [cancelCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ cancelPayment: async ( id: string, cancelCreationRequest?: CancelCreationRequest, options: AxiosRequestConfig = {} ): Promise<RequestArgs> => { // verify required parameter 'id' is not null or undefined assertParamExists("cancelPayment", "id", id); const localVarPath = `/v1/payments/{id}/cancel`.replace( `{${"id"}}`, encodeURIComponent(String(id)) ); // 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 bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration); localVarHeaderParameter["Content-Type"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = serializeDataIfNeeded( cancelCreationRequest, localVarRequestOptions, configuration ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Warning: Please contact Circle support if you are planning on using this feature. The given amount will be captured for the authorized payment if possible. If no amount is specified, the full amount will be captured. You can only capture once per authorization. A successful response does *not* mean the payment has been captured. It only means the capture request was successfully submitted. * @summary Capture a payment (BETA) * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {CaptureCreationRequest} [captureCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ capturePayment: async ( id: string, captureCreationRequest?: CaptureCreationRequest, options: AxiosRequestConfig = {} ): Promise<RequestArgs> => { // verify required parameter 'id' is not null or undefined assertParamExists("capturePayment", "id", id); const localVarPath = `/v1/payments/{id}/capture`.replace( `{${"id"}}`, encodeURIComponent(String(id)) ); // 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 bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration); localVarHeaderParameter["Content-Type"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = serializeDataIfNeeded( captureCreationRequest, localVarRequestOptions, configuration ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * In the sandbox environment, initiate a mock wire payment that mimics the behavior of funds sent through the bank (wire) account linked to master wallet. * @summary Create a mock Wire payment * @param {MockWirePaymentRequest} [mockWirePaymentRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ createMockWirePayment: async ( mockWirePaymentRequest?: MockWirePaymentRequest, options: AxiosRequestConfig = {} ): Promise<RequestArgs> => { const localVarPath = `/v1/mocks/payments/wire`; // 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 bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration); localVarHeaderParameter["Content-Type"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = serializeDataIfNeeded( mockWirePaymentRequest, localVarRequestOptions, configuration ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * * @summary Create a payment * @param {PaymentCreationRequest} [paymentCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ createPayment: async ( paymentCreationRequest?: PaymentCreationRequest, options: AxiosRequestConfig = {} ): Promise<RequestArgs> => { const localVarPath = `/v1/payments`; // 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 bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration); localVarHeaderParameter["Content-Type"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = serializeDataIfNeeded( paymentCreationRequest, localVarRequestOptions, configuration ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * * @summary Get a payment * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPayment: async ( id: string, options: AxiosRequestConfig = {} ): Promise<RequestArgs> => { // verify required parameter 'id' is not null or undefined assertParamExists("getPayment", "id", id); const localVarPath = `/v1/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, 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 bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration); setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * * @summary List all payments * @param {string} [source] Universally unique identifier (UUID v4) for the source. Filters results to fetch only payments made from the provdided source. * @param {string} [settlementId] Queries items with the specified settlement id. Matches any settlement id if unspecified. * @param {string} [paymentIntentId] Queries items with the specified payment intent id. * @param {Set<'card'>} [type] Source account type. Filters the results to fetch all payments made from a specified account type. Matches any source type if unspecified. * @param {'pending' | 'confirmed' | 'paid' | 'failed' | 'action_required'} [status] Queries items with the specified status. Matches any status if unspecified. * @param {string} [from] Queries items created since the specified date-time (inclusive). * @param {string} [to] Queries items created before the specified date-time (inclusive). * @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next &#x60;n&#x60; items before the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageAfter. * @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next &#x60;n&#x60; items after the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageBefore. * @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listPayments: async ( source?: string, settlementId?: string, paymentIntentId?: string, type?: Set<"card">, status?: "pending" | "confirmed" | "paid" | "failed" | "action_required", from?: string, to?: string, pageBefore?: string, pageAfter?: string, pageSize?: number, options: AxiosRequestConfig = {} ): Promise<RequestArgs> => { const localVarPath = `/v1/payments`; // 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 bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration); if (source !== undefined) { localVarQueryParameter["source"] = source; } if (settlementId !== undefined) { localVarQueryParameter["settlementId"] = settlementId; } if (paymentIntentId !== undefined) { localVarQueryParameter["paymentIntentId"] = paymentIntentId; } if (type) { localVarQueryParameter["type"] = Array.from(type); } if (status !== undefined) { localVarQueryParameter["status"] = status; } if (from !== undefined) { localVarQueryParameter["from"] = (from as any) instanceof Date ? (from as any).toISOString() : from; } if (to !== undefined) { localVarQueryParameter["to"] = (to as any) instanceof Date ? (to as any).toISOString() : to; } if (pageBefore !== undefined) { localVarQueryParameter["pageBefore"] = pageBefore; } if (pageAfter !== undefined) { localVarQueryParameter["pageAfter"] = pageAfter; } if (pageSize !== undefined) { localVarQueryParameter["pageSize"] = pageSize; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * The payment source will be refunded if possible. Not all payments are eligible to be cancelled. A successful response does *not* mean the payment has been refunded; it only means the refund request is successfully submitted. * @summary Refund a payment * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {RefundCreationRequest} [refundCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ refundPayment: async ( id: string, refundCreationRequest?: RefundCreationRequest, options: AxiosRequestConfig = {} ): Promise<RequestArgs> => { // verify required parameter 'id' is not null or undefined assertParamExists("refundPayment", "id", id); const localVarPath = `/v1/payments/{id}/refund`.replace( `{${"id"}}`, encodeURIComponent(String(id)) ); // 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 bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration); localVarHeaderParameter["Content-Type"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = serializeDataIfNeeded( refundCreationRequest, localVarRequestOptions, configuration ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; } }; }; /** * PaymentsApi - functional programming interface * @export */ export const PaymentsApiFp = function (configuration?: Configuration) { const localVarAxiosParamCreator = PaymentsApiAxiosParamCreator(configuration); return { /** * The payment will be voided if possible meaning the payment source will not be charged & the payment will never settle. Otherwise, the payment will be refunded meaning the payment source will be charged & the payment will be refunded from deductions of future settlements. Not all payments are eligible to be cancelled. A successful response does *not* mean the payment has been cancelled; it only means the cancellation request is successfully submitted. * @summary Cancel a payment * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {CancelCreationRequest} [cancelCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async cancelPayment( id: string, cancelCreationRequest?: CancelCreationRequest, options?: AxiosRequestConfig ): Promise< ( axios?: AxiosInstance, basePath?: string ) => AxiosPromise<CancelPaymentResponse> > { const localVarAxiosArgs = await localVarAxiosParamCreator.cancelPayment( id, cancelCreationRequest, options ); return createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration ); }, /** * Warning: Please contact Circle support if you are planning on using this feature. The given amount will be captured for the authorized payment if possible. If no amount is specified, the full amount will be captured. You can only capture once per authorization. A successful response does *not* mean the payment has been captured. It only means the capture request was successfully submitted. * @summary Capture a payment (BETA) * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {CaptureCreationRequest} [captureCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async capturePayment( id: string, captureCreationRequest?: CaptureCreationRequest, options?: AxiosRequestConfig ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise<void> > { const localVarAxiosArgs = await localVarAxiosParamCreator.capturePayment( id, captureCreationRequest, options ); return createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration ); }, /** * In the sandbox environment, initiate a mock wire payment that mimics the behavior of funds sent through the bank (wire) account linked to master wallet. * @summary Create a mock Wire payment * @param {MockWirePaymentRequest} [mockWirePaymentRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createMockWirePayment( mockWirePaymentRequest?: MockWirePaymentRequest, options?: AxiosRequestConfig ): Promise< ( axios?: AxiosInstance, basePath?: string ) => AxiosPromise<CreateWirePaymentResponse> > { const localVarAxiosArgs = await localVarAxiosParamCreator.createMockWirePayment( mockWirePaymentRequest, options ); return createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration ); }, /** * * @summary Create a payment * @param {PaymentCreationRequest} [paymentCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createPayment( paymentCreationRequest?: PaymentCreationRequest, options?: AxiosRequestConfig ): Promise< ( axios?: AxiosInstance, basePath?: string ) => AxiosPromise<CreatePaymentResponse> > { const localVarAxiosArgs = await localVarAxiosParamCreator.createPayment( paymentCreationRequest, options ); return createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration ); }, /** * * @summary Get a payment * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getPayment( id: string, options?: AxiosRequestConfig ): Promise< ( axios?: AxiosInstance, basePath?: string ) => AxiosPromise<GetPaymentResponse> > { const localVarAxiosArgs = await localVarAxiosParamCreator.getPayment( id, options ); return createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration ); }, /** * * @summary List all payments * @param {string} [source] Universally unique identifier (UUID v4) for the source. Filters results to fetch only payments made from the provdided source. * @param {string} [settlementId] Queries items with the specified settlement id. Matches any settlement id if unspecified. * @param {string} [paymentIntentId] Queries items with the specified payment intent id. * @param {Set<'card'>} [type] Source account type. Filters the results to fetch all payments made from a specified account type. Matches any source type if unspecified. * @param {'pending' | 'confirmed' | 'paid' | 'failed' | 'action_required'} [status] Queries items with the specified status. Matches any status if unspecified. * @param {string} [from] Queries items created since the specified date-time (inclusive). * @param {string} [to] Queries items created before the specified date-time (inclusive). * @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next &#x60;n&#x60; items before the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageAfter. * @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next &#x60;n&#x60; items after the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageBefore. * @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listPayments( source?: string, settlementId?: string, paymentIntentId?: string, type?: Set<"card">, status?: "pending" | "confirmed" | "paid" | "failed" | "action_required", from?: string, to?: string, pageBefore?: string, pageAfter?: string, pageSize?: number, options?: AxiosRequestConfig ): Promise< ( axios?: AxiosInstance, basePath?: string ) => AxiosPromise<ListPaymentsResponse> > { const localVarAxiosArgs = await localVarAxiosParamCreator.listPayments( source, settlementId, paymentIntentId, type, status, from, to, pageBefore, pageAfter, pageSize, options ); return createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration ); }, /** * The payment source will be refunded if possible. Not all payments are eligible to be cancelled. A successful response does *not* mean the payment has been refunded; it only means the refund request is successfully submitted. * @summary Refund a payment * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {RefundCreationRequest} [refundCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async refundPayment( id: string, refundCreationRequest?: RefundCreationRequest, options?: AxiosRequestConfig ): Promise< ( axios?: AxiosInstance, basePath?: string ) => AxiosPromise<RefundPaymentResponse> > { const localVarAxiosArgs = await localVarAxiosParamCreator.refundPayment( id, refundCreationRequest, options ); return createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration ); } }; }; /** * PaymentsApi - factory interface * @export */ export const PaymentsApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance ) { const localVarFp = PaymentsApiFp(configuration); return { /** * The payment will be voided if possible meaning the payment source will not be charged & the payment will never settle. Otherwise, the payment will be refunded meaning the payment source will be charged & the payment will be refunded from deductions of future settlements. Not all payments are eligible to be cancelled. A successful response does *not* mean the payment has been cancelled; it only means the cancellation request is successfully submitted. * @summary Cancel a payment * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {CancelCreationRequest} [cancelCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ cancelPayment( id: string, cancelCreationRequest?: CancelCreationRequest, options?: any ): AxiosPromise<CancelPaymentResponse> { return localVarFp .cancelPayment(id, cancelCreationRequest, options) .then((request) => request(axios, basePath)); }, /** * Warning: Please contact Circle support if you are planning on using this feature. The given amount will be captured for the authorized payment if possible. If no amount is specified, the full amount will be captured. You can only capture once per authorization. A successful response does *not* mean the payment has been captured. It only means the capture request was successfully submitted. * @summary Capture a payment (BETA) * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {CaptureCreationRequest} [captureCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ capturePayment( id: string, captureCreationRequest?: CaptureCreationRequest, options?: any ): AxiosPromise<void> { return localVarFp .capturePayment(id, captureCreationRequest, options) .then((request) => request(axios, basePath)); }, /** * In the sandbox environment, initiate a mock wire payment that mimics the behavior of funds sent through the bank (wire) account linked to master wallet. * @summary Create a mock Wire payment * @param {MockWirePaymentRequest} [mockWirePaymentRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ createMockWirePayment( mockWirePaymentRequest?: MockWirePaymentRequest, options?: any ): AxiosPromise<CreateWirePaymentResponse> { return localVarFp .createMockWirePayment(mockWirePaymentRequest, options) .then((request) => request(axios, basePath)); }, /** * * @summary Create a payment * @param {PaymentCreationRequest} [paymentCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ createPayment( paymentCreationRequest?: PaymentCreationRequest, options?: any ): AxiosPromise<CreatePaymentResponse> { return localVarFp .createPayment(paymentCreationRequest, options) .then((request) => request(axios, basePath)); }, /** * * @summary Get a payment * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPayment(id: string, options?: any): AxiosPromise<GetPaymentResponse> { return localVarFp .getPayment(id, options) .then((request) => request(axios, basePath)); }, /** * * @summary List all payments * @param {string} [source] Universally unique identifier (UUID v4) for the source. Filters results to fetch only payments made from the provdided source. * @param {string} [settlementId] Queries items with the specified settlement id. Matches any settlement id if unspecified. * @param {string} [paymentIntentId] Queries items with the specified payment intent id. * @param {Set<'card'>} [type] Source account type. Filters the results to fetch all payments made from a specified account type. Matches any source type if unspecified. * @param {'pending' | 'confirmed' | 'paid' | 'failed' | 'action_required'} [status] Queries items with the specified status. Matches any status if unspecified. * @param {string} [from] Queries items created since the specified date-time (inclusive). * @param {string} [to] Queries items created before the specified date-time (inclusive). * @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next &#x60;n&#x60; items before the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageAfter. * @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next &#x60;n&#x60; items after the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageBefore. * @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listPayments( source?: string, settlementId?: string, paymentIntentId?: string, type?: Set<"card">, status?: "pending" | "confirmed" | "paid" | "failed" | "action_required", from?: string, to?: string, pageBefore?: string, pageAfter?: string, pageSize?: number, options?: any ): AxiosPromise<ListPaymentsResponse> { return localVarFp .listPayments( source, settlementId, paymentIntentId, type, status, from, to, pageBefore, pageAfter, pageSize, options ) .then((request) => request(axios, basePath)); }, /** * The payment source will be refunded if possible. Not all payments are eligible to be cancelled. A successful response does *not* mean the payment has been refunded; it only means the refund request is successfully submitted. * @summary Refund a payment * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {RefundCreationRequest} [refundCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ refundPayment( id: string, refundCreationRequest?: RefundCreationRequest, options?: any ): AxiosPromise<RefundPaymentResponse> { return localVarFp .refundPayment(id, refundCreationRequest, options) .then((request) => request(axios, basePath)); } }; }; /** * PaymentsApi - object-oriented interface * @export * @class PaymentsApi * @extends {BaseAPI} */ export class PaymentsApi extends BaseAPI { /** * The payment will be voided if possible meaning the payment source will not be charged & the payment will never settle. Otherwise, the payment will be refunded meaning the payment source will be charged & the payment will be refunded from deductions of future settlements. Not all payments are eligible to be cancelled. A successful response does *not* mean the payment has been cancelled; it only means the cancellation request is successfully submitted. * @summary Cancel a payment * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {CancelCreationRequest} [cancelCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PaymentsApi */ public cancelPayment( id: string, cancelCreationRequest?: CancelCreationRequest, options?: AxiosRequestConfig ) { return PaymentsApiFp(this.configuration) .cancelPayment(id, cancelCreationRequest, options) .then((request) => request(this.axios, this.basePath)); } /** * Warning: Please contact Circle support if you are planning on using this feature. The given amount will be captured for the authorized payment if possible. If no amount is specified, the full amount will be captured. You can only capture once per authorization. A successful response does *not* mean the payment has been captured. It only means the capture request was successfully submitted. * @summary Capture a payment (BETA) * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {CaptureCreationRequest} [captureCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PaymentsApi */ public capturePayment( id: string, captureCreationRequest?: CaptureCreationRequest, options?: AxiosRequestConfig ) { return PaymentsApiFp(this.configuration) .capturePayment(id, captureCreationRequest, options) .then((request) => request(this.axios, this.basePath)); } /** * In the sandbox environment, initiate a mock wire payment that mimics the behavior of funds sent through the bank (wire) account linked to master wallet. * @summary Create a mock Wire payment * @param {MockWirePaymentRequest} [mockWirePaymentRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PaymentsApi */ public createMockWirePayment( mockWirePaymentRequest?: MockWirePaymentRequest, options?: AxiosRequestConfig ) { return PaymentsApiFp(this.configuration) .createMockWirePayment(mockWirePaymentRequest, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Create a payment * @param {PaymentCreationRequest} [paymentCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PaymentsApi */ public createPayment( paymentCreationRequest?: PaymentCreationRequest, options?: AxiosRequestConfig ) { return PaymentsApiFp(this.configuration) .createPayment(paymentCreationRequest, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get a payment * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PaymentsApi */ public getPayment(id: string, options?: AxiosRequestConfig) { return PaymentsApiFp(this.configuration) .getPayment(id, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary List all payments * @param {string} [source] Universally unique identifier (UUID v4) for the source. Filters results to fetch only payments made from the provdided source. * @param {string} [settlementId] Queries items with the specified settlement id. Matches any settlement id if unspecified. * @param {string} [paymentIntentId] Queries items with the specified payment intent id. * @param {Set<'card'>} [type] Source account type. Filters the results to fetch all payments made from a specified account type. Matches any source type if unspecified. * @param {'pending' | 'confirmed' | 'paid' | 'failed' | 'action_required'} [status] Queries items with the specified status. Matches any status if unspecified. * @param {string} [from] Queries items created since the specified date-time (inclusive). * @param {string} [to] Queries items created before the specified date-time (inclusive). * @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next &#x60;n&#x60; items before the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageAfter. * @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next &#x60;n&#x60; items after the id, with &#x60;n&#x60; being specified by &#x60;pageSize&#x60;. The items will be returned in the natural order of the collection. The resource will return the first page if neither &#x60;pageAfter&#x60; nor &#x60;pageBefore&#x60; are specified. SHOULD NOT be used in conjuction with pageBefore. * @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PaymentsApi */ public listPayments( source?: string, settlementId?: string, paymentIntentId?: string, type?: Set<"card">, status?: "pending" | "confirmed" | "paid" | "failed" | "action_required", from?: string, to?: string, pageBefore?: string, pageAfter?: string, pageSize?: number, options?: AxiosRequestConfig ) { return PaymentsApiFp(this.configuration) .listPayments( source, settlementId, paymentIntentId, type, status, from, to, pageBefore, pageAfter, pageSize, options ) .then((request) => request(this.axios, this.basePath)); } /** * The payment source will be refunded if possible. Not all payments are eligible to be cancelled. A successful response does *not* mean the payment has been refunded; it only means the refund request is successfully submitted. * @summary Refund a payment * @param {string} id Universally unique identifier (UUID v4) of a resource. * @param {RefundCreationRequest} [refundCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PaymentsApi */ public refundPayment( id: string, refundCreationRequest?: RefundCreationRequest, options?: AxiosRequestConfig ) { return PaymentsApiFp(this.configuration) .refundPayment(id, refundCreationRequest, options) .then((request) => request(this.axios, this.basePath)); } }