import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient"; import * as core from "../../../../core"; import type * as Square from "../../../index"; export declare namespace PaymentsClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } export declare class PaymentsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options?: PaymentsClient.Options); /** * Retrieves a list of payments taken by the account making the request. * * Results are eventually consistent, and new payments or changes to payments might take several * seconds to appear. * * The maximum results per page is 100. * * @param {Square.ListPaymentsRequest} request * @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.payments.list({ * beginTime: "begin_time", * endTime: "end_time", * sortOrder: "sort_order", * cursor: "cursor", * locationId: "location_id", * total: BigInt("1000000"), * last4: "last_4", * cardBrand: "card_brand", * limit: 1, * isOfflinePayment: true, * offlineBeginTime: "offline_begin_time", * offlineEndTime: "offline_end_time", * updatedAtBeginTime: "updated_at_begin_time", * updatedAtEndTime: "updated_at_end_time", * sortField: "CREATED_AT" * }) */ list(request?: Square.ListPaymentsRequest, requestOptions?: PaymentsClient.RequestOptions): Promise>; /** * Creates a payment using the provided source. You can use this endpoint * to charge a card (credit/debit card or * Square gift card) or record a payment that the seller received outside of Square * (cash payment from a buyer or a payment that an external entity * processed on behalf of the seller). * * The endpoint creates a * `Payment` object and returns it in the response. * * @param {Square.CreatePaymentRequest} request * @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.payments.create({ * sourceId: "ccof:GaJGNaZa8x4OgDJn4GB", * idempotencyKey: "7b0f3ec5-086a-4871-8f13-3c81b3875218", * amountMoney: { * amount: BigInt("1000"), * currency: "USD" * }, * appFeeMoney: { * amount: BigInt("10"), * currency: "USD" * }, * autocomplete: true, * customerId: "W92WH6P11H4Z77CTET0RNTGFW8", * locationId: "L88917AVBK2S5", * referenceId: "123456", * note: "Brief description" * }) */ create(request: Square.CreatePaymentRequest, requestOptions?: PaymentsClient.RequestOptions): core.HttpResponsePromise; private __create; /** * Cancels (voids) a payment identified by the idempotency key that is specified in the * request. * * Use this method when the status of a `CreatePayment` request is unknown (for example, after you send a * `CreatePayment` request, a network error occurs and you do not get a response). In this case, you can * direct Square to cancel the payment using this endpoint. In the request, you provide the same * idempotency key that you provided in your `CreatePayment` request that you want to cancel. After * canceling the payment, you can submit your `CreatePayment` request again. * * Note that if no payment with the specified idempotency key is found, no action is taken and the endpoint * returns successfully. * * @param {Square.CancelPaymentByIdempotencyKeyRequest} request * @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.payments.cancelByIdempotencyKey({ * idempotencyKey: "a7e36d40-d24b-11e8-b568-0800200c9a66" * }) */ cancelByIdempotencyKey(request: Square.CancelPaymentByIdempotencyKeyRequest, requestOptions?: PaymentsClient.RequestOptions): core.HttpResponsePromise; private __cancelByIdempotencyKey; /** * Retrieves details for a specific payment. * * @param {Square.GetPaymentsRequest} request * @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.payments.get({ * paymentId: "payment_id" * }) */ get(request: Square.GetPaymentsRequest, requestOptions?: PaymentsClient.RequestOptions): core.HttpResponsePromise; private __get; /** * Updates a payment with the APPROVED status. * You can update the `amount_money` and `tip_money` using this endpoint. * * @param {Square.UpdatePaymentRequest} request * @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.payments.update({ * paymentId: "payment_id", * payment: { * amountMoney: { * amount: BigInt("1000"), * currency: "USD" * }, * tipMoney: { * amount: BigInt("100"), * currency: "USD" * }, * versionToken: "ODhwVQ35xwlzRuoZEwKXucfu7583sPTzK48c5zoGd0g6o" * }, * idempotencyKey: "956f8b13-e4ec-45d6-85e8-d1d95ef0c5de" * }) */ update(request: Square.UpdatePaymentRequest, requestOptions?: PaymentsClient.RequestOptions): core.HttpResponsePromise; private __update; /** * Cancels (voids) a payment. You can use this endpoint to cancel a payment with * the APPROVED `status`. * * @param {Square.CancelPaymentsRequest} request * @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.payments.cancel({ * paymentId: "payment_id" * }) */ cancel(request: Square.CancelPaymentsRequest, requestOptions?: PaymentsClient.RequestOptions): core.HttpResponsePromise; private __cancel; /** * Completes (captures) a payment. * By default, payments are set to complete immediately after they are created. * * You can use this endpoint to complete a payment with the APPROVED `status`. * * @param {Square.CompletePaymentRequest} request * @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.payments.complete({ * paymentId: "payment_id" * }) */ complete(request: Square.CompletePaymentRequest, requestOptions?: PaymentsClient.RequestOptions): core.HttpResponsePromise; private __complete; }