@whop/elements 1.0.0-beta.3 → 1.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/_framework.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  /** The locales this app's elements are built with (the default locale first) — element UI
2
2
  * text ships in each of these. Any other value falls back to the default locale. Validate
3
3
  * dynamic strings with `WHOP_ELEMENTS_LOCALES.includes(...)` from the package root. */
4
- export type WhopElementsLocale = "en" | "es" | "zh" | "nl" | "pt" | "de" | "it" | "fr" | "ja" | "pl" | "tr";
4
+ export type WhopElementsLocale = "en" | "es" | "zh" | "nl" | "pt" | "de" | "hu" | "it" | "fr" | "ja" | "pl" | "tr";
5
5
 
6
6
  /**
7
7
  * A CSS property value, as a string (include units: `"12px"`, not `12`).
@@ -172,6 +172,11 @@ export interface FrameworkGlobals {
172
172
  * ("Payment method added", "Payment failed") rendered in the bottom-right corner. Set
173
173
  * `false` to turn them off entirely. @default true */
174
174
  toasts?: boolean;
175
+ /** Skip linking element analytics to the Whop pixel's visitor id on pages that run the
176
+ * pixel — a one-time identity link that makes element activity joinable to your
177
+ * ad-attribution data in Whop's identity graph. Usage analytics themselves are unaffected
178
+ * (turn those off per handle with `analytics: false`). @default false */
179
+ skipPixel?: boolean;
175
180
  /** Origin serving the hosted element pages — for testing against a different environment.
176
181
  * Cannot change after load.
177
182
  * @internal */
package/_framework.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /** The locales this app's elements are built with (the default locale first) — element UI
2
2
  * text ships in each of these. Any other value falls back to the default locale. Validate
3
3
  * dynamic strings with `WHOP_ELEMENTS_LOCALES.includes(...)` from the package root. */
4
- export type WhopElementsLocale = "en" | "es" | "zh" | "nl" | "pt" | "de" | "it" | "fr" | "ja" | "pl" | "tr";
4
+ export type WhopElementsLocale = "en" | "es" | "zh" | "nl" | "pt" | "de" | "hu" | "it" | "fr" | "ja" | "pl" | "tr";
5
5
 
6
6
  /**
7
7
  * A CSS property value, as a string (include units: `"12px"`, not `12`).
@@ -172,6 +172,11 @@ export interface FrameworkGlobals {
172
172
  * ("Payment method added", "Payment failed") rendered in the bottom-right corner. Set
173
173
  * `false` to turn them off entirely. @default true */
174
174
  toasts?: boolean;
175
+ /** Skip linking element analytics to the Whop pixel's visitor id on pages that run the
176
+ * pixel — a one-time identity link that makes element activity joinable to your
177
+ * ad-attribution data in Whop's identity graph. Usage analytics themselves are unaffected
178
+ * (turn those off per handle with `analytics: false`). @default false */
179
+ skipPixel?: boolean;
175
180
  /** Origin serving the hosted element pages — for testing against a different environment.
176
181
  * Cannot change after load.
177
182
  * @internal */
package/checkout.d.cts CHANGED
@@ -15,7 +15,7 @@ export interface CheckoutOptions {
15
15
  */
16
16
  plan?: string;
17
17
  /**
18
- * Existing checkout configuration ID, prefixed `ch_`. The element creates the checkout session from it: the configuration names the plan being sold and seeds its own affiliate code, metadata, redirect and payment-method presets — an option passed here beside it wins over the configuration’s copy, field by field. Pass `plan` alongside only to set `quantity`; it must be the configuration’s own plan, which can never be swapped out from under its presets. Set at create only.
18
+ * Existing checkout configuration ID, prefixed `ch_`. The element creates the checkout session from it: the configuration names the plan being sold (or, in `setup` mode, no plan — the checkout saves a payment method and charges nothing) and seeds its own affiliate code, metadata, redirect and payment-method presets — an option passed here beside it wins over the configuration’s copy, field by field. Pass `plan` alongside only to set `quantity`; it must be the configuration’s own plan, which can never be swapped out from under its presets. Set at create only.
19
19
  */
20
20
  checkoutConfiguration?: string;
21
21
  /**
@@ -190,7 +190,7 @@ export interface CheckoutHandle {
190
190
  */
191
191
  create(name: "checkout", options?: CheckoutElementCreateOptions): CheckoutElementHandle;
192
192
  /**
193
- * One-press Apple Pay and Google Pay buttons for a checkout — the OS payment sheet collects whatever the session still needs (the buyer's email, a shipping address for physical goods, and in Apple Pay a promo code where the seller offers entry) and one press finishes the purchase. It shares the checkout's entry slot with the full checkout element, so a handle mounts exactly one of the two: this button alone where the purchase is simple enough for a sheet to finish, or the full checkout surface for everything else. Renders only the wallets the buyer's device can actually pay with — and the checkout's own payment method configuration allows — using the served button art, and renders nothing where no wallet is available. Apple Pay additionally requires the page's domain to be a verified payment method domain: first-party whop.com pages are pre-approved, and any other site must register its domain through the Payment Method Domains API before the button renders there. A checkout the sheet cannot honestly finish — a waitlist join, a transfer, a form question only a page can ask — refuses loudly instead of rendering a doomed button.
193
+ * One-press Apple Pay and Google Pay buttons for a checkout — the OS payment sheet collects whatever the session still needs (the buyer's email, a phone number where the seller collects one, a shipping address for physical goods, and in Apple Pay a promo code where the seller offers entry) and one press finishes the purchase. It shares the checkout's entry slot with the full checkout element, so a handle mounts exactly one of the two: this button alone where the purchase is simple enough for a sheet to finish, or the full checkout surface for everything else. Renders only the wallets the buyer's device can actually pay with — and the checkout's own payment method configuration allows — using the served button art, and renders nothing where no wallet is available. Apple Pay additionally requires the page's domain to be a verified payment method domain: first-party whop.com pages are pre-approved, and any other site must register its domain through the Payment Method Domains API before the button renders there. A checkout the sheet cannot honestly finish — a waitlist join, a transfer, a form question only a page can ask — refuses loudly instead of rendering a doomed button.
194
194
  * Exclusive slot `entry`. Mount exactly one of: checkout | expressCheckout.
195
195
  */
196
196
  create(name: "expressCheckout", options?: ExpressCheckoutElementCreateOptions): ExpressCheckoutElementHandle;
package/checkout.d.ts CHANGED
@@ -15,7 +15,7 @@ export interface CheckoutOptions {
15
15
  */
16
16
  plan?: string;
17
17
  /**
18
- * Existing checkout configuration ID, prefixed `ch_`. The element creates the checkout session from it: the configuration names the plan being sold and seeds its own affiliate code, metadata, redirect and payment-method presets — an option passed here beside it wins over the configuration’s copy, field by field. Pass `plan` alongside only to set `quantity`; it must be the configuration’s own plan, which can never be swapped out from under its presets. Set at create only.
18
+ * Existing checkout configuration ID, prefixed `ch_`. The element creates the checkout session from it: the configuration names the plan being sold (or, in `setup` mode, no plan — the checkout saves a payment method and charges nothing) and seeds its own affiliate code, metadata, redirect and payment-method presets — an option passed here beside it wins over the configuration’s copy, field by field. Pass `plan` alongside only to set `quantity`; it must be the configuration’s own plan, which can never be swapped out from under its presets. Set at create only.
19
19
  */
20
20
  checkoutConfiguration?: string;
21
21
  /**
@@ -190,7 +190,7 @@ export interface CheckoutHandle {
190
190
  */
191
191
  create(name: "checkout", options?: CheckoutElementCreateOptions): CheckoutElementHandle;
192
192
  /**
193
- * One-press Apple Pay and Google Pay buttons for a checkout — the OS payment sheet collects whatever the session still needs (the buyer's email, a shipping address for physical goods, and in Apple Pay a promo code where the seller offers entry) and one press finishes the purchase. It shares the checkout's entry slot with the full checkout element, so a handle mounts exactly one of the two: this button alone where the purchase is simple enough for a sheet to finish, or the full checkout surface for everything else. Renders only the wallets the buyer's device can actually pay with — and the checkout's own payment method configuration allows — using the served button art, and renders nothing where no wallet is available. Apple Pay additionally requires the page's domain to be a verified payment method domain: first-party whop.com pages are pre-approved, and any other site must register its domain through the Payment Method Domains API before the button renders there. A checkout the sheet cannot honestly finish — a waitlist join, a transfer, a form question only a page can ask — refuses loudly instead of rendering a doomed button.
193
+ * One-press Apple Pay and Google Pay buttons for a checkout — the OS payment sheet collects whatever the session still needs (the buyer's email, a phone number where the seller collects one, a shipping address for physical goods, and in Apple Pay a promo code where the seller offers entry) and one press finishes the purchase. It shares the checkout's entry slot with the full checkout element, so a handle mounts exactly one of the two: this button alone where the purchase is simple enough for a sheet to finish, or the full checkout surface for everything else. Renders only the wallets the buyer's device can actually pay with — and the checkout's own payment method configuration allows — using the served button art, and renders nothing where no wallet is available. Apple Pay additionally requires the page's domain to be a verified payment method domain: first-party whop.com pages are pre-approved, and any other site must register its domain through the Payment Method Domains API before the button renders there. A checkout the sheet cannot honestly finish — a waitlist join, a transfer, a form question only a page can ask — refuses loudly instead of rendering a doomed button.
194
194
  * Exclusive slot `entry`. Mount exactly one of: checkout | expressCheckout.
195
195
  */
196
196
  create(name: "expressCheckout", options?: ExpressCheckoutElementCreateOptions): ExpressCheckoutElementHandle;
package/index.cjs CHANGED
@@ -28,7 +28,7 @@ __export(npm_loader_exports, {
28
28
  module.exports = __toCommonJS(npm_loader_exports);
29
29
 
30
30
  // <define:__WHOP_ELEMENTS_LOCALES__>
31
- var define_WHOP_ELEMENTS_LOCALES_default = ["en", "es", "zh", "nl", "pt", "de", "it", "fr", "ja", "pl", "tr"];
31
+ var define_WHOP_ELEMENTS_LOCALES_default = ["en", "es", "zh", "nl", "pt", "de", "hu", "it", "fr", "ja", "pl", "tr"];
32
32
 
33
33
  // ../../packages/elements-codegen/src/cli/build/npm-loader.ts
34
34
  var ORIGIN = "https://js.whop.cloud";
package/index.d.cts CHANGED
@@ -13,7 +13,7 @@ export interface WhopGlobalConfig extends FrameworkGlobals {}
13
13
  /** The configured instance: one accessor per namespace, each carrying `create()` plus that namespace's static actions. */
14
14
  export interface Whop {
15
15
  /**
16
- * Collect a payment from a `plan_` ID or inline currency and amount. Mount PaymentElement, CardElement, or CardFields, then call `payments.createConfirmationToken` with billing details. Wallet selections open their sheet automatically. Confirm the token server-side, then pass the payment's `client_secret` to `handleNextAction` for any pending step.
16
+ * Browse account payments with PaymentsElement, collect a payment from a `plan_` ID or inline currency and amount, or save a payment method without charging with `mode: "setup"`. Mount PaymentElement, CardElement, or CardFields, then call `payments.createConfirmationToken` with billing details. Wallet selections open their sheet automatically. Confirm the token server-side, then pass the payment's or setup intent's `client_secret` to `handleNextAction` for any pending step.
17
17
  */
18
18
  payments: { create(options: PaymentsOptions): PaymentsHandle } & PaymentsStatics;
19
19
  /**
@@ -21,7 +21,7 @@ export interface Whop {
21
21
  */
22
22
  verifications: { create(options: VerificationsOptions): VerificationsHandle } & VerificationsStatics;
23
23
  /**
24
- * Drives a full hosted checkout for one plan — price summary, promo codes, the currency the buyer pays in, and the whole payment collection surface (the payments elements, composed inside) — against the Whop checkout sessions API. Mount it with a `plan` (or a `checkoutConfiguration` you authored) and the element opens the checkout session itself; the session credential never leaves the element. The buyer pays inside the element, and a finished checkout redirects the current tab to `returnUrl`, including the page that contains the element. Fulfill from webhooks rather than a browser callback. Without a `returnUrl`, the buyer rests on the element’s own success face. The element automatically drives an off-site payment step, such as 3DS or a bank page. On whop.com, it brings the buyer back into the restored checkout; in an embed, the buyer returns to the same `returnUrl`. A failed payment reopens the same checkout with the reason shown, so the buyer can pay again. Every option is set at creation: the element mints a checkout session from these values when it mounts. Changing one later with `update()` or new React props fails instead of changing the existing order. Mount a new checkout to change the purchase.
24
+ * Drives a full hosted checkout for one plan — price summary, promo codes, the currency the buyer pays in, and the whole payment collection surface (the payments elements, composed inside) — against the Whop checkout sessions API. Mount it with a `plan` (or a `checkoutConfiguration` you authored) and the element opens the checkout session itself; the session credential never leaves the element. A setup-mode checkout configuration mounts the same element as a payment-method save: nothing is charged, the buyer’s method is stored for you to charge later, and the finished checkout redirects with `setup_intent_id`. The buyer pays inside the element, and a finished checkout redirects the current tab to `returnUrl`, including the page that contains the element. Fulfill from webhooks rather than a browser callback. Without a `returnUrl`, the buyer rests on the element’s own success face. The element automatically drives an off-site payment step, such as 3DS or a bank page. On whop.com, it brings the buyer back into the restored checkout; in an embed, the buyer returns to the same `returnUrl`. A failed payment reopens the same checkout with the reason shown, so the buyer can pay again. Every option is set at creation: the element mints a checkout session from these values when it mounts. Changing one later with `update()` or new React props fails instead of changing the existing order. Mount a new checkout to change the purchase.
25
25
  */
26
26
  checkout: { create(options: CheckoutOptions): CheckoutHandle } & CheckoutStatics;
27
27
  /**
@@ -33,7 +33,7 @@ export interface Whop {
33
33
  */
34
34
  tracking: { create(options: TrackingOptions): TrackingHandle } & TrackingStatics;
35
35
  /**
36
- * Drives an account's money surfaces. `required-actions` is the outstanding-action bar from Whop's balance dashboard. `actions` renders the Deposit, Accept, Send, and Convert controls: Deposit, Send, and Convert open their Wallet overlays, while Accept opens Whop's checkout-link creator for a business account or company creation for a personal account. `deposit` returns live funding rails; `convert` swaps USD with Gold or Bitcoin and exposes FX currencies only to gated first-party users; `send` moves money to a recipient or creates a public claim link; `withdraw` lists payout methods and creates the payout when the host does not already drive that API; `balances` holds two faces — the holdings list, and the balance block drawing value over a window; `cards` is the compact issued-card list; `cardsTable` renders the full sortable card roster; `cardsChart` plots card spend; `whopCard` renders one revealable card; `activity` lists ledger movements; `activityDetail` renders a prefetched movement, or retrieves one by activity ID or card transaction ID, in a standalone drawer; and `verification` is the identity-only nudge. Every data-backed surface can use the viewer's session when no token is provided.
36
+ * Drives an account's money surfaces. `required-actions` is the outstanding-action bar from Whop's balance dashboard. `actions` renders the Deposit, Accept, Send, and Convert controls: Deposit, Send, and Convert open their Wallet overlays, while Accept opens Whop's checkout-link creator for a business account or company creation for a personal account. `deposit` returns live funding rails; `convert` swaps USD with Gold or Bitcoin and exposes FX currencies when the host enables `fxEnabled`; `send` moves money to a recipient or creates a public claim link; `withdraw` lists payout methods and creates the payout when the host does not already drive that API; `balances` holds two faces — the holdings list, and the balance block drawing value over a window; `cards` is the compact issued-card list; `cardsTable` renders the full sortable card roster; `cardsChart` plots card spend; `whopCard` renders one revealable card; `activity` lists ledger movements; `activityDetail` renders a prefetched movement, or retrieves one by activity ID or card transaction ID, in a standalone drawer; and `verification` is the identity-only nudge. Every data-backed surface can use the viewer's session when no token is provided.
37
37
  */
38
38
  wallet: { create(options: WalletOptions): WalletHandle } & WalletStatics;
39
39
  /**
package/index.d.ts CHANGED
@@ -13,7 +13,7 @@ export interface WhopGlobalConfig extends FrameworkGlobals {}
13
13
  /** The configured instance: one accessor per namespace, each carrying `create()` plus that namespace's static actions. */
14
14
  export interface Whop {
15
15
  /**
16
- * Collect a payment from a `plan_` ID or inline currency and amount. Mount PaymentElement, CardElement, or CardFields, then call `payments.createConfirmationToken` with billing details. Wallet selections open their sheet automatically. Confirm the token server-side, then pass the payment's `client_secret` to `handleNextAction` for any pending step.
16
+ * Browse account payments with PaymentsElement, collect a payment from a `plan_` ID or inline currency and amount, or save a payment method without charging with `mode: "setup"`. Mount PaymentElement, CardElement, or CardFields, then call `payments.createConfirmationToken` with billing details. Wallet selections open their sheet automatically. Confirm the token server-side, then pass the payment's or setup intent's `client_secret` to `handleNextAction` for any pending step.
17
17
  */
18
18
  payments: { create(options: PaymentsOptions): PaymentsHandle } & PaymentsStatics;
19
19
  /**
@@ -21,7 +21,7 @@ export interface Whop {
21
21
  */
22
22
  verifications: { create(options: VerificationsOptions): VerificationsHandle } & VerificationsStatics;
23
23
  /**
24
- * Drives a full hosted checkout for one plan — price summary, promo codes, the currency the buyer pays in, and the whole payment collection surface (the payments elements, composed inside) — against the Whop checkout sessions API. Mount it with a `plan` (or a `checkoutConfiguration` you authored) and the element opens the checkout session itself; the session credential never leaves the element. The buyer pays inside the element, and a finished checkout redirects the current tab to `returnUrl`, including the page that contains the element. Fulfill from webhooks rather than a browser callback. Without a `returnUrl`, the buyer rests on the element’s own success face. The element automatically drives an off-site payment step, such as 3DS or a bank page. On whop.com, it brings the buyer back into the restored checkout; in an embed, the buyer returns to the same `returnUrl`. A failed payment reopens the same checkout with the reason shown, so the buyer can pay again. Every option is set at creation: the element mints a checkout session from these values when it mounts. Changing one later with `update()` or new React props fails instead of changing the existing order. Mount a new checkout to change the purchase.
24
+ * Drives a full hosted checkout for one plan — price summary, promo codes, the currency the buyer pays in, and the whole payment collection surface (the payments elements, composed inside) — against the Whop checkout sessions API. Mount it with a `plan` (or a `checkoutConfiguration` you authored) and the element opens the checkout session itself; the session credential never leaves the element. A setup-mode checkout configuration mounts the same element as a payment-method save: nothing is charged, the buyer’s method is stored for you to charge later, and the finished checkout redirects with `setup_intent_id`. The buyer pays inside the element, and a finished checkout redirects the current tab to `returnUrl`, including the page that contains the element. Fulfill from webhooks rather than a browser callback. Without a `returnUrl`, the buyer rests on the element’s own success face. The element automatically drives an off-site payment step, such as 3DS or a bank page. On whop.com, it brings the buyer back into the restored checkout; in an embed, the buyer returns to the same `returnUrl`. A failed payment reopens the same checkout with the reason shown, so the buyer can pay again. Every option is set at creation: the element mints a checkout session from these values when it mounts. Changing one later with `update()` or new React props fails instead of changing the existing order. Mount a new checkout to change the purchase.
25
25
  */
26
26
  checkout: { create(options: CheckoutOptions): CheckoutHandle } & CheckoutStatics;
27
27
  /**
@@ -33,7 +33,7 @@ export interface Whop {
33
33
  */
34
34
  tracking: { create(options: TrackingOptions): TrackingHandle } & TrackingStatics;
35
35
  /**
36
- * Drives an account's money surfaces. `required-actions` is the outstanding-action bar from Whop's balance dashboard. `actions` renders the Deposit, Accept, Send, and Convert controls: Deposit, Send, and Convert open their Wallet overlays, while Accept opens Whop's checkout-link creator for a business account or company creation for a personal account. `deposit` returns live funding rails; `convert` swaps USD with Gold or Bitcoin and exposes FX currencies only to gated first-party users; `send` moves money to a recipient or creates a public claim link; `withdraw` lists payout methods and creates the payout when the host does not already drive that API; `balances` holds two faces — the holdings list, and the balance block drawing value over a window; `cards` is the compact issued-card list; `cardsTable` renders the full sortable card roster; `cardsChart` plots card spend; `whopCard` renders one revealable card; `activity` lists ledger movements; `activityDetail` renders a prefetched movement, or retrieves one by activity ID or card transaction ID, in a standalone drawer; and `verification` is the identity-only nudge. Every data-backed surface can use the viewer's session when no token is provided.
36
+ * Drives an account's money surfaces. `required-actions` is the outstanding-action bar from Whop's balance dashboard. `actions` renders the Deposit, Accept, Send, and Convert controls: Deposit, Send, and Convert open their Wallet overlays, while Accept opens Whop's checkout-link creator for a business account or company creation for a personal account. `deposit` returns live funding rails; `convert` swaps USD with Gold or Bitcoin and exposes FX currencies when the host enables `fxEnabled`; `send` moves money to a recipient or creates a public claim link; `withdraw` lists payout methods and creates the payout when the host does not already drive that API; `balances` holds two faces — the holdings list, and the balance block drawing value over a window; `cards` is the compact issued-card list; `cardsTable` renders the full sortable card roster; `cardsChart` plots card spend; `whopCard` renders one revealable card; `activity` lists ledger movements; `activityDetail` renders a prefetched movement, or retrieves one by activity ID or card transaction ID, in a standalone drawer; and `verification` is the identity-only nudge. Every data-backed surface can use the viewer's session when no token is provided.
37
37
  */
38
38
  wallet: { create(options: WalletOptions): WalletHandle } & WalletStatics;
39
39
  /**
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // <define:__WHOP_ELEMENTS_LOCALES__>
2
- var define_WHOP_ELEMENTS_LOCALES_default = ["en", "es", "zh", "nl", "pt", "de", "it", "fr", "ja", "pl", "tr"];
2
+ var define_WHOP_ELEMENTS_LOCALES_default = ["en", "es", "zh", "nl", "pt", "de", "hu", "it", "fr", "ja", "pl", "tr"];
3
3
 
4
4
  // ../../packages/elements-codegen/src/cli/build/npm-loader.ts
5
5
  var ORIGIN = "https://js.whop.cloud";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whop/elements",
3
- "version": "1.0.0-beta.3",
3
+ "version": "1.0.0-beta.4",
4
4
  "description": "Whop Elements — vanilla-js loader + types. Loads the hosted SDK and exposes the typed WhopElements factory.",
5
5
  "keywords": [
6
6
  "checkout",
@@ -89,5 +89,5 @@
89
89
  }
90
90
  }
91
91
  },
92
- "whopElementsApiHash": "aa5a847faaed38909df8586be24e560636b7a252df483fea1a4f981631d2d400"
92
+ "whopElementsApiHash": "643973a360d415d99bd6cf95211709b03ca2dc4b79002d7cd3539f367cd4ca71"
93
93
  }
package/payments.d.cts CHANGED
@@ -12,9 +12,17 @@
12
12
  export type PaymentsOptions = (
13
13
  | {
14
14
  /**
15
- * Account ID, prefixed `biz_`. Omit only when calling static methods without a collection surface.
15
+ * Account ID, prefixed `biz_`. Required for PaymentsElement; omit only when calling static methods without an account surface.
16
16
  */
17
17
  accountId: string;
18
+ /**
19
+ * Mount mode, `payment` by default. `setup` saves a payment method and charges nothing, now or later: only methods that can be saved are offered and amount bounds do not apply. Confirm with `createConfirmationToken()`, then create the setup intent server-side.
20
+ */
21
+ mode?: "payment";
22
+ /**
23
+ * Scoped bearer token for PaymentsElement. Requires `payment:basic:read`; buyer emails additionally require `member:email:read`. Omit only with a same-origin Whop session.
24
+ */
25
+ accessToken?: string;
18
26
  /**
19
27
  * Plan ID, prefixed `plan_`. It resolves client-side to currency, amount, and method configuration. Pass a plan or inline currency and amount, never both.
20
28
  */
@@ -28,7 +36,7 @@ export type PaymentsOptions = (
28
36
  */
29
37
  returnUrl?: string;
30
38
  /**
31
- * Displays consent to save the payment method and marks the token for `off_session` or `on_session` use.
39
+ * A setup saves the payment method for `off_session` use, the only usage a setup accepts, and displays the save consent.
32
40
  */
33
41
  setupFutureUsage?: "off_session" | "on_session";
34
42
  /**
@@ -50,11 +58,19 @@ export type PaymentsOptions = (
50
58
  }
51
59
  | {
52
60
  /**
53
- * Account ID, prefixed `biz_`. Omit only when calling static methods without a collection surface.
61
+ * Account ID, prefixed `biz_`. Required for PaymentsElement; omit only when calling static methods without an account surface.
54
62
  */
55
63
  accountId: string;
56
64
  /**
57
- * Lowercase three-letter ISO 4217 payment currency code. It filters the payment-method matrix.
65
+ * Mount mode, `payment` by default. `setup` saves a payment method and charges nothing, now or later: only methods that can be saved are offered and amount bounds do not apply. Confirm with `createConfirmationToken()`, then create the setup intent server-side.
66
+ */
67
+ mode?: "payment";
68
+ /**
69
+ * Scoped bearer token for PaymentsElement. Requires `payment:basic:read`; buyer emails additionally require `member:email:read`. Omit only with a same-origin Whop session.
70
+ */
71
+ accessToken?: string;
72
+ /**
73
+ * Lowercase three-letter ISO 4217 currency code. It filters the payment-method matrix.
58
74
  */
59
75
  currency: string;
60
76
  /**
@@ -74,7 +90,7 @@ export type PaymentsOptions = (
74
90
  */
75
91
  returnUrl?: string;
76
92
  /**
77
- * Displays consent to save the payment method and marks the token for `off_session` or `on_session` use.
93
+ * A setup saves the payment method for `off_session` use, the only usage a setup accepts, and displays the save consent.
78
94
  */
79
95
  setupFutureUsage?: "off_session" | "on_session";
80
96
  /**
@@ -96,15 +112,81 @@ export type PaymentsOptions = (
96
112
  }
97
113
  | {
98
114
  /**
99
- * Account ID, prefixed `biz_`. Omit only when calling static methods without a collection surface.
115
+ * Account ID, prefixed `biz_`. Required for PaymentsElement; omit only when calling static methods without an account surface.
116
+ */
117
+ accountId: string;
118
+ /**
119
+ * Mount mode, `payment` by default. `setup` saves a payment method and charges nothing, now or later: only methods that can be saved are offered and amount bounds do not apply. Confirm with `createConfirmationToken()`, then create the setup intent server-side.
100
120
  */
101
- accountId?: undefined;
121
+ mode: "setup";
122
+ /**
123
+ * Scoped bearer token for PaymentsElement. Requires `payment:basic:read`; buyer emails additionally require `member:email:read`. Omit only with a same-origin Whop session.
124
+ */
125
+ accessToken?: string;
126
+ /**
127
+ * Lowercase three-letter ISO 4217 currency code. It filters the payment-method matrix.
128
+ */
129
+ currency: string;
102
130
  /**
103
131
  * Plan ID, prefixed `plan_`. It resolves client-side to currency, amount, and method configuration. Pass a plan or inline currency and amount, never both.
104
132
  */
105
133
  plan?: undefined;
106
134
  /**
107
- * Lowercase three-letter ISO 4217 payment currency code. It filters the payment-method matrix.
135
+ * Payment amount in minor units. Methods whose bounds exclude it aren't offered.
136
+ */
137
+ amount?: undefined;
138
+ /**
139
+ * Minor-unit `feeInclusive` and `feeFree` totals used to gate methods when checkout re-prices `amount` for a fee-free method such as BNPL. Each method is checked against its matching total, preventing the selected fee-free method from disappearing. When omitted, `amount` gates every method.
140
+ */
141
+ offerAmounts?: undefined;
142
+ /**
143
+ * Account payment-method filters in the API's `enabled`, `disabled`, and `include_platform_defaults` format. `disabled` removes types, `enabled` restores offered types, and `include_platform_defaults: false` leaves only enabled types. Plans provide their own configuration.
144
+ */
145
+ paymentMethodConfiguration?: { enabled?: string[] | undefined; disabled?: string[] | undefined; include_platform_defaults?: boolean | undefined; };
146
+ /**
147
+ * Return URL for off-site bank or 3DS steps. Defaults to the mounting page.
148
+ */
149
+ returnUrl?: string;
150
+ /**
151
+ * A setup saves the payment method for `off_session` use, the only usage a setup accepts, and displays the save consent.
152
+ */
153
+ setupFutureUsage?: "off_session";
154
+ /**
155
+ * Wallet availability override for deterministic previews. Live checkouts probe the host.
156
+ */
157
+ previewWalletAvailability?: WalletAvailability;
158
+ /**
159
+ * Checkout session updated when a buyer signs in. Pass its `chs_`-prefixed `id` and `client_secret`. Without them, sign-in succeeds but the session does not record the buyer.
160
+ */
161
+ checkoutSession?: { id: string; clientSecret: string; };
162
+ /**
163
+ * Runs when the grouped loading state changes. The value is `true` while any mounted element is still loading.
164
+ */
165
+ onLoadingChange?: ((loading: boolean) => void);
166
+ /**
167
+ * Set `false` to turn off Whop's built-in usage analytics for this handle and its elements. The analytics identity is never threaded to its frames. A reserved option, not element data.
168
+ */
169
+ analytics?: false;
170
+ }
171
+ | {
172
+ /**
173
+ * Account ID, prefixed `biz_`. Required for PaymentsElement; omit only when calling static methods without an account surface.
174
+ */
175
+ accountId?: string;
176
+ /**
177
+ * Scoped bearer token for PaymentsElement. Requires `payment:basic:read`; buyer emails additionally require `member:email:read`. Omit only with a same-origin Whop session.
178
+ */
179
+ accessToken?: string;
180
+ /**
181
+ * Mount mode, `payment` by default. `setup` saves a payment method and charges nothing, now or later: only methods that can be saved are offered and amount bounds do not apply. Confirm with `createConfirmationToken()`, then create the setup intent server-side.
182
+ */
183
+ mode?: undefined;
184
+ /**
185
+ * Plan ID, prefixed `plan_`. It resolves client-side to currency, amount, and method configuration. Pass a plan or inline currency and amount, never both.
186
+ */
187
+ plan?: undefined;
188
+ /**
189
+ * Lowercase three-letter ISO 4217 currency code. It filters the payment-method matrix.
108
190
  */
109
191
  currency?: undefined;
110
192
  /**
@@ -124,7 +206,7 @@ export type PaymentsOptions = (
124
206
  */
125
207
  returnUrl?: string;
126
208
  /**
127
- * Displays consent to save the payment method and marks the token for `off_session` or `on_session` use.
209
+ * A setup saves the payment method for `off_session` use, the only usage a setup accepts, and displays the save consent.
128
210
  */
129
211
  setupFutureUsage?: "off_session" | "on_session";
130
212
  /**
@@ -155,6 +237,120 @@ export type PaymentsOptions = (
155
237
  locale?: import("./_framework.js").WhopElementsLocale;
156
238
  };
157
239
 
240
+ /**
241
+ * Consumer props for the "payments" element. Set at create (or as `<PaymentsElement />` JSX props), and updatable live via `update()`.
242
+ * @see https://docs.whop.com/elements/latest/payments/payments
243
+ */
244
+ export interface PaymentsElementProps {
245
+ /**
246
+ * Show the header action menu, Export button, and table settings button.
247
+ * @default true
248
+ */
249
+ showActions?: boolean;
250
+ /**
251
+ * Show the three-dot action menu on each payment row.
252
+ * @default true
253
+ */
254
+ showRowActions?: boolean;
255
+ /**
256
+ * Show the six payment status boxes above the filters.
257
+ * @default true
258
+ */
259
+ showStatusTabs?: boolean;
260
+ /**
261
+ * Show the tracking column and filter for physical-product accounts. Tracking data requires `shipment:basic:read`.
262
+ * @default true
263
+ */
264
+ showTracking?: boolean;
265
+ }
266
+
267
+ /**
268
+ * The live handle for a mounted "payments" element. Returned by `create("payments")`; in React, the component's `ref`.
269
+ * @see https://docs.whop.com/elements/latest/payments/payments
270
+ */
271
+ export interface PaymentsElementHandle {
272
+ /**
273
+ * Reload payments after a refund or another change.
274
+ */
275
+ refresh: () => Promise<void>;
276
+ /**
277
+ * Mounts the element in `target` and starts loading. React components mount themselves.
278
+ */
279
+ mount: (target: string | HTMLElement) => void;
280
+ /**
281
+ * Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
282
+ */
283
+ destroy: () => void;
284
+ /**
285
+ * Merges new props into the mounted element. In React, change the component props instead.
286
+ */
287
+ update: (options: Partial<PaymentsElementProps>) => void;
288
+ }
289
+
290
+ /**
291
+ * Options for `create("payments")`: the consumer props plus event callbacks and lifecycle hooks.
292
+ * @example
293
+ * ```ts
294
+ * const payments = payments.create("payments", {}); // this interface: props + on<Event> callbacks
295
+ * payments.mount("#payments-payments");
296
+ * ```
297
+ * @see https://docs.whop.com/elements/latest/payments/payments
298
+ */
299
+ export interface PaymentsElementCreateOptions {
300
+ /**
301
+ * Show the header action menu, Export button, and table settings button.
302
+ * @default true
303
+ */
304
+ showActions?: boolean;
305
+ /**
306
+ * Show the three-dot action menu on each payment row.
307
+ * @default true
308
+ */
309
+ showRowActions?: boolean;
310
+ /**
311
+ * Show the six payment status boxes above the filters.
312
+ * @default true
313
+ */
314
+ showStatusTabs?: boolean;
315
+ /**
316
+ * Show the tracking column and filter for physical-product accounts. Tracking data requires `shipment:basic:read`.
317
+ * @default true
318
+ */
319
+ showTracking?: boolean;
320
+ /**
321
+ * Open payment details in your application.
322
+ */
323
+ onPaymentSelected?: ((payload: { paymentId: string; }) => void);
324
+ /**
325
+ * Open the invoice in your application.
326
+ */
327
+ onInvoiceRequested?: ((payload: { paymentId: string; }) => void);
328
+ /**
329
+ * Open the buyer in your application.
330
+ */
331
+ onUserSelected?: ((payload: { userId: string; }) => void);
332
+ /**
333
+ * The viewer requested a refund. Your application must confirm and authorize it server-side. Refund controls are enabled only when this callback is provided.
334
+ */
335
+ onRefundRequested?: ((payload: { paymentIds: string[]; }) => void);
336
+ /**
337
+ * Open the account’s payment settings in your application.
338
+ */
339
+ onSettingsRequested?: ((payload: Record<string, never>) => void);
340
+ /**
341
+ * Runs after the loading skeleton first paints and before `onReady`.
342
+ */
343
+ onLoaderStart?: (() => void);
344
+ /**
345
+ * Runs after the element's first complete paint.
346
+ */
347
+ onReady?: (() => void);
348
+ /**
349
+ * Runs when the element fails to load or crashes. The fallback remains visible. Use `code` for programmatic handling. `sourceKey` identifies a failed host-state source.
350
+ */
351
+ onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
352
+ }
353
+
158
354
  /**
159
355
  * Consumer props for the "payment" element. Set at create (or as `<PaymentElement />` JSX props), and updatable live via `update()`.
160
356
  * @see https://docs.whop.com/elements/latest/payments/payment
@@ -273,10 +469,10 @@ export interface PaymentElementCreateOptions {
273
469
  */
274
470
  export interface AddressElementProps {
275
471
  /**
276
- * `full` (default) stacks labeled fields. `compact` groups placeholder-labeled fields within one border.
277
- * @default "full"
472
+ * Browser autocomplete purpose: `billing` (default) or `shipping`.
473
+ * @default "billing"
278
474
  */
279
- layout?: "full" | "compact";
475
+ mode?: "billing" | "shipping";
280
476
  /**
281
477
  * Address line 2: always visible (default), revealed by a text button (`toggle`), or never collected.
282
478
  * @default "always"
@@ -288,10 +484,10 @@ export interface AddressElementProps {
288
484
  */
289
485
  name?: "split" | "combined" | "none";
290
486
  /**
291
- * Browser autocomplete purpose: `billing` (default) or `shipping`.
292
- * @default "billing"
487
+ * `full` (default) stacks labeled fields. `compact` groups placeholder-labeled fields within one border.
488
+ * @default "full"
293
489
  */
294
- mode?: "billing" | "shipping";
490
+ layout?: "full" | "compact";
295
491
  /**
296
492
  * `full` (default) follows the selected country's complete address format. `minimal` collects only country and postal code. `name` independently adds required name fields. Set `name` to `none` to omit them. This element does not add fields required by a payment method. Card confirmation requires a name, country, and postal code, so keep `name` enabled or pass `billingDetails.name`.
297
493
  * @default "full"
@@ -323,7 +519,7 @@ export interface AddressElementProps {
323
519
  /**
324
520
  * Additional fields rendered with the address form. Values are validated and emitted in the separate `custom` map.
325
521
  */
326
- customFields?: ({ key: string; label: string; type: "text" | "phone" | "select" | "date"; position: "after_name" | "after_organization" | "before_country" | "after_address"; required?: boolean | undefined; options?: string[] | undefined; format?: string | undefined; autocomplete?: string | undefined; })[];
522
+ customFields?: ({ key: string; label: string; type: "text" | "select" | "phone" | "date"; position: "after_name" | "after_organization" | "before_country" | "after_address"; required?: boolean | undefined; options?: string[] | undefined; format?: string | undefined; autocomplete?: string | undefined; })[];
327
523
  /**
328
524
  * Fallback country after `defaultValues` and IP detection. Use an ISO 3166-1 alpha-2 code. An empty value falls back to `US`.
329
525
  * @default ""
@@ -369,10 +565,10 @@ export interface AddressElementHandle {
369
565
  */
370
566
  export interface AddressElementCreateOptions {
371
567
  /**
372
- * `full` (default) stacks labeled fields. `compact` groups placeholder-labeled fields within one border.
373
- * @default "full"
568
+ * Browser autocomplete purpose: `billing` (default) or `shipping`.
569
+ * @default "billing"
374
570
  */
375
- layout?: "full" | "compact";
571
+ mode?: "billing" | "shipping";
376
572
  /**
377
573
  * Address line 2: always visible (default), revealed by a text button (`toggle`), or never collected.
378
574
  * @default "always"
@@ -384,10 +580,10 @@ export interface AddressElementCreateOptions {
384
580
  */
385
581
  name?: "split" | "combined" | "none";
386
582
  /**
387
- * Browser autocomplete purpose: `billing` (default) or `shipping`.
388
- * @default "billing"
583
+ * `full` (default) stacks labeled fields. `compact` groups placeholder-labeled fields within one border.
584
+ * @default "full"
389
585
  */
390
- mode?: "billing" | "shipping";
586
+ layout?: "full" | "compact";
391
587
  /**
392
588
  * `full` (default) follows the selected country's complete address format. `minimal` collects only country and postal code. `name` independently adds required name fields. Set `name` to `none` to omit them. This element does not add fields required by a payment method. Card confirmation requires a name, country, and postal code, so keep `name` enabled or pass `billingDetails.name`.
393
589
  * @default "full"
@@ -419,7 +615,7 @@ export interface AddressElementCreateOptions {
419
615
  /**
420
616
  * Additional fields rendered with the address form. Values are validated and emitted in the separate `custom` map.
421
617
  */
422
- customFields?: ({ key: string; label: string; type: "text" | "phone" | "select" | "date"; position: "after_name" | "after_organization" | "before_country" | "after_address"; required?: boolean | undefined; options?: string[] | undefined; format?: string | undefined; autocomplete?: string | undefined; })[];
618
+ customFields?: ({ key: string; label: string; type: "text" | "select" | "phone" | "date"; position: "after_name" | "after_organization" | "before_country" | "after_address"; required?: boolean | undefined; options?: string[] | undefined; format?: string | undefined; autocomplete?: string | undefined; })[];
423
619
  /**
424
620
  * Fallback country after `defaultValues` and IP detection. Use an ISO 3166-1 alpha-2 code. An empty value falls back to `US`.
425
621
  * @default ""
@@ -950,6 +1146,11 @@ export interface PaymentRequestResourceOptions {
950
1146
  * @default true
951
1147
  */
952
1148
  requestPayerEmail?: boolean;
1149
+ /**
1150
+ * Ask the sheet for the payer's phone number, delivered as `payer.phone` on the result — in E.164 where it parses against the country of the contact that supplied it, as the wallet gave it otherwise; `payer.country` is the billing country. Google Pay collects it through the billing address the sheet already asks for.
1151
+ * @default false
1152
+ */
1153
+ requestPayerPhone?: boolean;
953
1154
  /**
954
1155
  * Ask the sheet for a shipping address (and offer `shippingOptions` when given).
955
1156
  * @default false
@@ -1018,6 +1219,10 @@ export interface PaymentRequestResource {
1018
1219
  * @see https://docs.whop.com/elements/latest/payments/overview
1019
1220
  */
1020
1221
  export interface PaymentsHandle {
1222
+ /**
1223
+ * The dashboard payments table with status cards, search, filters, sorting, row selection, CSV export, column settings, and pagination. Reads all payment pages to compute complete counts and filter locally; intended for accounts with modest payment histories. Customer details and refunds are handed to your application through events.
1224
+ */
1225
+ create(name: "payments", options?: PaymentsElementCreateOptions): PaymentsElementHandle;
1021
1226
  /**
1022
1227
  * Shows available payment methods and collects the selected method's required fields and disclosures. Use `change` to enable your pay button. In its activation handler, call `payments.createConfirmationToken()`. Confirm the token server-side, then pass any pending step to `payments.handleNextAction(…)`. Use `addressChange` for address-dependent updates.
1023
1228
  * Exclusive slot `entry`. Mount exactly one of: payment | card | cardFields.
@@ -1070,7 +1275,7 @@ export interface PaymentsHandle {
1070
1275
  */
1071
1276
  export interface PaymentsStatics {
1072
1277
  /**
1073
- * Completes a confirmed payment's pending step without mounting an element. `clientSecret` identifies the payment. You don't need a payment ID. Inline steps open in a dialog and resolve with `redirected: false`. Dismissing the dialog returns the payment's current status, which can remain pending. Full-page steps redirect with `redirected: true` to `return_url`, or a hosted receipt when the payment has no return URL. Inside an iframe they navigate the top-level tab. If the embedding page refuses that navigation, they reject with code `TAB_NAVIGATION_BLOCKED`, and the payment stays pending. Set `returnUrl` to update the destination before presentation. An update failure rejects before any step runs. Inline steps never navigate to that URL. A payment with no pending step resolves immediately.
1278
+ * Completes a confirmed payment's pending step without mounting an element. `clientSecret` identifies the payment. You don't need a payment ID. Inline steps open in a dialog and resolve with `redirected: false`. Dismissing the dialog returns the payment's current status, which can remain pending. Full-page steps redirect with `redirected: true` to `return_url`, or a hosted receipt when the payment has no return URL. Inside an iframe they navigate the top-level tab. If the embedding page refuses that navigation, they reject with code `TAB_NAVIGATION_BLOCKED`, and the payment stays pending. Set `returnUrl` to update the destination before presentation. An update failure rejects before any step runs. Inline steps never navigate to that URL. A payment whose charge is still being decided is polled until a step appears or it settles; a decided payment with no step resolves immediately.
1074
1279
  */
1075
1280
  handleNextAction: (input: { clientSecret: string; returnUrl?: string | undefined; pollIntervalMs?: number | undefined; }) => Promise<{ status: string; redirected: boolean; lastPaymentError: { code?: string | null | undefined; decline_code?: string | null | undefined; message?: string | null | undefined; } | null; }>;
1076
1281
  /**
@@ -1149,7 +1354,7 @@ export interface PaymentRequestResult {
1149
1354
  */
1150
1355
  ctok: string;
1151
1356
  type: "apple_pay" | "google_pay";
1152
- payer: { email?: string | undefined; name?: string | undefined; phone?: string | undefined; };
1357
+ payer: { email?: string | undefined; name?: string | undefined; phone?: string | undefined; country?: string | undefined; };
1153
1358
  shipping: { address?: PaymentRequestAddress | undefined; option?: PaymentRequestShippingOption | undefined; } | null;
1154
1359
  }
1155
1360