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"; export declare namespace PaymentRulesClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } /** * A Payment Rule lets an account act on its own payments before they reach the bank: block them, let them through, send them to review, or ask the buyer for 3D Secure. Each rule matches on a small set of payment attributes, and every condition must hold for it to apply. * * A rule's definition is fixed once created, so the payments it decided keep naming the rule that decided them. Use [Replace](/api-reference/beta/payment-rules/replace-a-payment-rule) to change one, and [List fields](/api-reference/beta/payment-rules/list-fields) for the attributes, operators and values a condition can use. */ export declare class PaymentRulesClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options?: PaymentRulesClient.Options); /** * Lists the payment rules on an account. * * @param {Whop.ListPaymentRulesRequest} request * @param {PaymentRulesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.paymentRules.list() */ list(request?: Whop.ListPaymentRulesRequest, requestOptions?: PaymentRulesClient.RequestOptions): Promise>; /** * Creates a payment rule. It is created `active` and applies its `action` to new payments that match all of its `conditions`. * * @param {Whop.CreatePaymentRulesRequest} request * @param {PaymentRulesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.paymentRules.create({ * action: "allow", * conditions: { * all: [{ * field: "risk_score", * operator: "gte", * value: 70 * }] * }, * name: "Review risky cards" * }) */ create(request: Whop.CreatePaymentRulesRequest, requestOptions?: PaymentRulesClient.RequestOptions): core.HttpResponsePromise; private __create; /** * Lists the payment attributes a rule condition can read, with the operators and values each one accepts. Small and returned in full on one page. * * @param {PaymentRulesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.paymentRules.listFields() */ listFields(requestOptions?: PaymentRulesClient.RequestOptions): core.HttpResponsePromise; private __listFields; /** * Retrieves a payment rule. * * @param {Whop.RetrievePaymentRulesRequest} request * @param {PaymentRulesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.NotFoundError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.paymentRules.retrieve({ * id: "id" * }) */ retrieve(request: Whop.RetrievePaymentRulesRequest, requestOptions?: PaymentRulesClient.RequestOptions): core.HttpResponsePromise; private __retrieve; /** * Deletes a payment rule. It stops applying to new payments but is kept, so the payments it already decided still name it. * * @param {Whop.DeletePaymentRulesRequest} request * @param {PaymentRulesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.paymentRules.delete({ * id: "id" * }) */ delete(request: Whop.DeletePaymentRulesRequest, requestOptions?: PaymentRulesClient.RequestOptions): core.HttpResponsePromise; private __delete; /** * Updates a payment rule's name or metadata, keeping its ID and everything recorded against it. A rule's `action` and `conditions` are fixed once created, so the payments it decided keep naming the rule that decided them; use `POST /payment_rules/:id/replace` to change them. * * @param {Whop.UpdatePaymentRulesRequest} request * @param {PaymentRulesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.paymentRules.update({ * id: "id" * }) */ update(request: Whop.UpdatePaymentRulesRequest, requestOptions?: PaymentRulesClient.RequestOptions): core.HttpResponsePromise; private __update; /** * Activates an inactive payment rule so it applies to new payments again. A deleted rule cannot be activated. * * @param {Whop.ActivatePaymentRulesRequest} request * @param {PaymentRulesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.paymentRules.activate({ * id: "id" * }) */ activate(request: Whop.ActivatePaymentRulesRequest, requestOptions?: PaymentRulesClient.RequestOptions): core.HttpResponsePromise; private __activate; /** * Deactivates a payment rule so it stops applying to new payments. It keeps its ID and can be activated again. * * @param {Whop.DeactivatePaymentRulesRequest} request * @param {PaymentRulesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.paymentRules.deactivate({ * id: "id" * }) */ deactivate(request: Whop.DeactivatePaymentRulesRequest, requestOptions?: PaymentRulesClient.RequestOptions): core.HttpResponsePromise; private __deactivate; /** * Changes a payment rule's `action` and `conditions` by deleting it and creating its successor in one step. The successor has a new ID and keeps the replaced rule's name, metadata, and `active` or `inactive` status. * * @param {Whop.ReplacePaymentRulesRequest} request * @param {PaymentRulesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.paymentRules.replace({ * id: "id", * action: "allow", * conditions: { * all: [{ * field: "risk_score", * operator: "gte", * value: 70 * }] * } * }) */ replace(request: Whop.ReplacePaymentRulesRequest, requestOptions?: PaymentRulesClient.RequestOptions): core.HttpResponsePromise; private __replace; }