import type * as Whop from "../../../../index.mjs"; /** * @example * { * action: "allow", * conditions: { * all: [{ * field: "risk_score", * operator: "gte", * value: 70 * }] * }, * name: "Review risky cards" * } */ export interface CreatePaymentRulesRequest { /** The account to create the rule on. Defaults to the account the request is acting for. */ account_id?: string; /** What this account's rule requests when every condition matches. One applicable account-rule action wins, in this order: `allow`, `block`, `review`, `enforce_3ds`. An `allow` overrides this account's other rules, never Whop's own fraud controls. A `review` requests authorization without capture for an eligible on-session card payment through Whop Payments. Automatic capture is scheduled for 48 hours after authorization; capture or void the payment before then to decide sooner. Capture may complete later or fail. Review is skipped for unsupported methods, off-session payments, and payments already configured for manual capture. An `enforce_3ds` is skipped when the account rule cannot apply a challenge. Other 3DS requirements still apply. */ action: CreatePaymentRulesRequest.Action; /** The conditions a payment is matched against. Up to 10 conditions, and 8 KiB once serialized. */ conditions: CreatePaymentRulesRequest.Conditions; /** Custom string-to-string values for your integration. Maximum 50 keys, 40 characters per key, 500 characters per value. */ metadata?: Record; /** A name for this rule. Up to 255 characters. */ name: string; } export declare namespace CreatePaymentRulesRequest { /** What this account's rule requests when every condition matches. One applicable account-rule action wins, in this order: `allow`, `block`, `review`, `enforce_3ds`. An `allow` overrides this account's other rules, never Whop's own fraud controls. A `review` requests authorization without capture for an eligible on-session card payment through Whop Payments. Automatic capture is scheduled for 48 hours after authorization; capture or void the payment before then to decide sooner. Capture may complete later or fail. Review is skipped for unsupported methods, off-session payments, and payments already configured for manual capture. An `enforce_3ds` is skipped when the account rule cannot apply a challenge. Other 3DS requirements still apply. */ const Action: { readonly Allow: "allow"; readonly Block: "block"; readonly Review: "review"; readonly Enforce3Ds: "enforce_3ds"; }; type Action = (typeof Action)[keyof typeof Action]; /** * The conditions a payment is matched against. Up to 10 conditions, and 8 KiB once serialized. */ interface Conditions { all: Conditions.All.Item[]; } namespace Conditions { type All = All.Item[]; namespace All { interface Item { /** The payment attribute this condition reads. */ field: Item.Field; /** How the payment attribute is compared to the value. */ operator: Item.Operator; value: Whop.PaymentRuleConditionValue; } namespace Item { /** The payment attribute this condition reads. */ const Field: { readonly RiskScore: "risk_score"; readonly AmountInUsd: "amount_in_usd"; readonly CardCountry: "card_country"; readonly CardBrand: "card_brand"; readonly CardFunding: "card_funding"; readonly CardBin: "card_bin"; readonly BillingCountry: "billing_country"; readonly BillingPostalCode: "billing_postal_code"; readonly BillingCity: "billing_city"; readonly CustomerEmail: "customer_email"; readonly EmailDomain: "email_domain"; readonly IpAddress: "ip_address"; readonly IpCountry: "ip_country"; }; type Field = (typeof Field)[keyof typeof Field]; /** How the payment attribute is compared to the value. */ const Operator: { readonly Eq: "eq"; readonly Neq: "neq"; readonly Gt: "gt"; readonly Gte: "gte"; readonly Lt: "lt"; readonly Lte: "lte"; readonly In: "in"; readonly NotIn: "not_in"; readonly StartsWith: "starts_with"; readonly Contains: "contains"; readonly EndsWith: "ends_with"; readonly InCidr: "in_cidr"; }; type Operator = (typeof Operator)[keyof typeof Operator]; } } } }