import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; import * as core from "../../../../core/index.js"; import * as Whop from "../../../index.js"; import { DirectClient } from "../resources/direct/client/Client.js"; export declare namespace SetupIntentsClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } /** * A Setup Intent saves a buyer's payment method for later without taking money now. Create one from a confirmation token the payment elements collected in setup mode, or from a payment method already on file to re-verify it. It runs the same collection flow a payment does, so the buyer may still owe a step: 3D Secure on a card, a hosted enrollment, or linking a bank account. * * The create response is the setup intent as created, not its outcome. Hand its `client_secret` to the elements' `handleNextAction`, or poll [Retrieve status](/api-reference/beta/setup-intents/retrieve-setup-status) for how far the setup has gone and what is outstanding. Once it reaches `succeeded`, `payment_method_id` names the saved method and Create Payment charges it. */ export declare class SetupIntentsClient { protected readonly _options: NormalizedClientOptionsWithAuth; protected _direct: DirectClient | undefined; constructor(options?: SetupIntentsClient.Options); get direct(): DirectClient; /** * Lists setup intents newest first. An account API key lists its own account; a user token lists every account it can read, or one account with `account_id`. * * @param {Whop.ListSetupIntentsRequest} request * @param {SetupIntentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.setupIntents.list() */ list(request?: Whop.ListSetupIntentsRequest, requestOptions?: SetupIntentsClient.RequestOptions): Promise>; /** * Saves a buyer's payment method for later without charging it — one the buyer just supplied through the payment elements in setup mode, or one already on file to re-verify. The setup completes in the background, so the response is the setup intent as created, not its outcome: hand `client_secret` to the elements' `handleNextAction`, or poll Retrieve setup status. A buyer's own token holding `member:payment_methods:use` may create a setup intent for itself from a confirmation token. * * @param {Whop.CreateSetupIntentsRequest} request * @param {SetupIntentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.setupIntents.create({ * account_id: "biz_xxxxxxxxxxxxxx" * }) */ create(request: Whop.CreateSetupIntentsRequest, requestOptions?: SetupIntentsClient.RequestOptions): core.HttpResponsePromise; private __create; /** * Retrieves a setup intent. Once its `status` is `succeeded`, charge the saved method by its `payment_method_id`. The buyer's own token may retrieve a setup intent that belongs to it. * * @param {Whop.RetrieveSetupIntentsRequest} request * @param {SetupIntentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.setupIntents.retrieve({ * id: "id" * }) */ retrieve(request: Whop.RetrieveSetupIntentsRequest, requestOptions?: SetupIntentsClient.RequestOptions): core.HttpResponsePromise; private __retrieve; /** * Changes where the buyer lands after completing an off-site step, up until they return. Accepts either a secret key or the setup's own `client_secret` in the body, so the surface that knows the final destination can set it. * * @param {Whop.UpdateReturnUrlSetupIntentsRequest} request * @param {SetupIntentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.setupIntents.updateReturnUrl({ * setup_intent_id: "setup_intent_id", * return_url: "https://shinetime.example/checkout/thanks" * }) */ updateReturnUrl(request: Whop.UpdateReturnUrlSetupIntentsRequest, requestOptions?: SetupIntentsClient.RequestOptions): core.HttpResponsePromise; private __updateReturnUrl; /** * Retrieves how far a setup has got and what the buyer must do next, if anything. Collection runs in the background, so poll this rather than reading the create response. Accepts either a secret key or the setup's own `client_secret` as a query parameter, so the surface collecting the payment method can poll it directly. * * @param {Whop.RetrieveStatusSetupIntentsRequest} request * @param {SetupIntentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.setupIntents.retrieveStatus({ * setup_intent_id: "setup_intent_id" * }) */ retrieveStatus(request: Whop.RetrieveStatusSetupIntentsRequest, requestOptions?: SetupIntentsClient.RequestOptions): core.HttpResponsePromise; private __retrieveStatus; }