UNPKG

@circle-fin/circle-sdk

Version:
325 lines (324 loc) 27.2 kB
/** * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; import { Configuration } from "../configuration"; import { RequestArgs, BaseAPI } from "../base"; import { CancelCreationRequest } from "../models"; import { CancelPaymentResponse } from "../models"; import { CaptureCreationRequest } from "../models"; import { CreatePaymentResponse } from "../models"; import { CreateWirePaymentResponse } from "../models"; import { GetPaymentResponse } from "../models"; import { ListPaymentsResponse } from "../models"; import { MockWirePaymentRequest } from "../models"; import { PaymentCreationRequest } from "../models"; import { RefundCreationRequest } from "../models"; import { RefundPaymentResponse } from "../models"; /** * PaymentsApi - axios parameter creator * @export */ export declare const PaymentsApiAxiosParamCreator: (configuration?: Configuration) => { /** * 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?: AxiosRequestConfig) => Promise<RequestArgs>; /** * 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?: AxiosRequestConfig) => Promise<RequestArgs>; /** * 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?: AxiosRequestConfig) => Promise<RequestArgs>; /** * * @summary Create a payment * @param {PaymentCreationRequest} [paymentCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ createPayment: (paymentCreationRequest?: PaymentCreationRequest, options?: AxiosRequestConfig) => Promise<RequestArgs>; /** * * @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?: AxiosRequestConfig) => Promise<RequestArgs>; /** * * @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?: AxiosRequestConfig) => Promise<RequestArgs>; /** * 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?: AxiosRequestConfig) => Promise<RequestArgs>; }; /** * PaymentsApi - functional programming interface * @export */ export declare const PaymentsApiFp: (configuration?: Configuration) => { /** * 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?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CancelPaymentResponse>>; /** * 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?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>; /** * 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?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateWirePaymentResponse>>; /** * * @summary Create a payment * @param {PaymentCreationRequest} [paymentCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ createPayment(paymentCreationRequest?: PaymentCreationRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreatePaymentResponse>>; /** * * @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?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetPaymentResponse>>; /** * * @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?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListPaymentsResponse>>; /** * 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?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RefundPaymentResponse>>; }; /** * PaymentsApi - factory interface * @export */ export declare const PaymentsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => { /** * 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>; /** * 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>; /** * 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>; /** * * @summary Create a payment * @param {PaymentCreationRequest} [paymentCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ createPayment(paymentCreationRequest?: PaymentCreationRequest, options?: any): AxiosPromise<CreatePaymentResponse>; /** * * @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>; /** * * @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>; /** * 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>; }; /** * PaymentsApi - object-oriented interface * @export * @class PaymentsApi * @extends {BaseAPI} */ export declare 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 */ cancelPayment(id: string, cancelCreationRequest?: CancelCreationRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CancelPaymentResponse, any>>; /** * 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 */ capturePayment(id: string, captureCreationRequest?: CaptureCreationRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any>>; /** * 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 */ createMockWirePayment(mockWirePaymentRequest?: MockWirePaymentRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateWirePaymentResponse, any>>; /** * * @summary Create a payment * @param {PaymentCreationRequest} [paymentCreationRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PaymentsApi */ createPayment(paymentCreationRequest?: PaymentCreationRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreatePaymentResponse, any>>; /** * * @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 */ getPayment(id: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetPaymentResponse, any>>; /** * * @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 */ 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<import("axios").AxiosResponse<ListPaymentsResponse, any>>; /** * 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 */ refundPayment(id: string, refundCreationRequest?: RefundCreationRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<RefundPaymentResponse, any>>; }