@usethrottle/checkout-react 2.0.0 → 2.1.1
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/README.md +8 -5
- package/dist/index.cjs +988 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -3
- package/dist/index.d.ts +12 -3
- package/dist/index.js +1012 -13
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -38,6 +38,8 @@ type ThrottleEvent = {
|
|
|
38
38
|
paymentId: string;
|
|
39
39
|
paymentStatus?: string;
|
|
40
40
|
subscriptionId?: string;
|
|
41
|
+
/** v1.5 additive — every subscription the checkout created, in line order. `subscriptionId` is set only when there is exactly one. */
|
|
42
|
+
subscriptionIds?: string[];
|
|
41
43
|
/** v1.4 additive — order total in minor units, for analytics purchase events. */
|
|
42
44
|
total?: number;
|
|
43
45
|
currency?: string;
|
|
@@ -77,7 +79,7 @@ type ThrottleParentMessage = ThrottleParentCommand & ThrottleParentEnvelope;
|
|
|
77
79
|
* requiring a runtime read of the session.
|
|
78
80
|
*
|
|
79
81
|
* - `create: 'auto'` (default) — server creates the subscription on
|
|
80
|
-
* vault success. `onSucceeded` payload includes `subscriptionId
|
|
82
|
+
* vault success. `onSucceeded` payload includes `subscriptionIds` (and `subscriptionId` when exactly one was created).
|
|
81
83
|
* - `create: 'manual'` — server only vaults; merchant calls
|
|
82
84
|
* `subscriptions.create` from their backend after `payment.vaulted`
|
|
83
85
|
* webhook or `onSucceeded` callback.
|
|
@@ -147,6 +149,8 @@ interface ThrottleEmbedProps {
|
|
|
147
149
|
orderId: string;
|
|
148
150
|
paymentId: string;
|
|
149
151
|
subscriptionId?: string;
|
|
152
|
+
/** Every subscription the checkout created, in line order. `subscriptionId` is set only when there is exactly one. */
|
|
153
|
+
subscriptionIds?: string[];
|
|
150
154
|
/** Order total in minor units — fire `gtag`/`fbq` purchase events with value = total / 100. */
|
|
151
155
|
total?: number;
|
|
152
156
|
currency?: string;
|
|
@@ -217,9 +221,14 @@ declare function useThrottleEvents({ iframeRef, expectedOrigin, onMessage }: Use
|
|
|
217
221
|
interface UseCartSessionOptions {
|
|
218
222
|
/** Application UUID. */
|
|
219
223
|
applicationId: string;
|
|
220
|
-
/** Workspace environment UUID the
|
|
224
|
+
/** Workspace environment UUID the quote token was minted for. */
|
|
221
225
|
environmentId: string;
|
|
222
|
-
/**
|
|
226
|
+
/**
|
|
227
|
+
* Storefront quote token (`qt_…`), from the dashboard Shipping & Tax page or
|
|
228
|
+
* `POST /api/v1/shipping-tax/quote-tokens`. Tokens minted before `qt_` start
|
|
229
|
+
* with `pk_` and keep working. A `pk_` publishable API key is a different
|
|
230
|
+
* credential and is refused (`401 invalid_quote_token`).
|
|
231
|
+
*/
|
|
223
232
|
quoteToken: string;
|
|
224
233
|
baseUrl?: string;
|
|
225
234
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -38,6 +38,8 @@ type ThrottleEvent = {
|
|
|
38
38
|
paymentId: string;
|
|
39
39
|
paymentStatus?: string;
|
|
40
40
|
subscriptionId?: string;
|
|
41
|
+
/** v1.5 additive — every subscription the checkout created, in line order. `subscriptionId` is set only when there is exactly one. */
|
|
42
|
+
subscriptionIds?: string[];
|
|
41
43
|
/** v1.4 additive — order total in minor units, for analytics purchase events. */
|
|
42
44
|
total?: number;
|
|
43
45
|
currency?: string;
|
|
@@ -77,7 +79,7 @@ type ThrottleParentMessage = ThrottleParentCommand & ThrottleParentEnvelope;
|
|
|
77
79
|
* requiring a runtime read of the session.
|
|
78
80
|
*
|
|
79
81
|
* - `create: 'auto'` (default) — server creates the subscription on
|
|
80
|
-
* vault success. `onSucceeded` payload includes `subscriptionId
|
|
82
|
+
* vault success. `onSucceeded` payload includes `subscriptionIds` (and `subscriptionId` when exactly one was created).
|
|
81
83
|
* - `create: 'manual'` — server only vaults; merchant calls
|
|
82
84
|
* `subscriptions.create` from their backend after `payment.vaulted`
|
|
83
85
|
* webhook or `onSucceeded` callback.
|
|
@@ -147,6 +149,8 @@ interface ThrottleEmbedProps {
|
|
|
147
149
|
orderId: string;
|
|
148
150
|
paymentId: string;
|
|
149
151
|
subscriptionId?: string;
|
|
152
|
+
/** Every subscription the checkout created, in line order. `subscriptionId` is set only when there is exactly one. */
|
|
153
|
+
subscriptionIds?: string[];
|
|
150
154
|
/** Order total in minor units — fire `gtag`/`fbq` purchase events with value = total / 100. */
|
|
151
155
|
total?: number;
|
|
152
156
|
currency?: string;
|
|
@@ -217,9 +221,14 @@ declare function useThrottleEvents({ iframeRef, expectedOrigin, onMessage }: Use
|
|
|
217
221
|
interface UseCartSessionOptions {
|
|
218
222
|
/** Application UUID. */
|
|
219
223
|
applicationId: string;
|
|
220
|
-
/** Workspace environment UUID the
|
|
224
|
+
/** Workspace environment UUID the quote token was minted for. */
|
|
221
225
|
environmentId: string;
|
|
222
|
-
/**
|
|
226
|
+
/**
|
|
227
|
+
* Storefront quote token (`qt_…`), from the dashboard Shipping & Tax page or
|
|
228
|
+
* `POST /api/v1/shipping-tax/quote-tokens`. Tokens minted before `qt_` start
|
|
229
|
+
* with `pk_` and keep working. A `pk_` publishable API key is a different
|
|
230
|
+
* credential and is refused (`401 invalid_quote_token`).
|
|
231
|
+
*/
|
|
223
232
|
quoteToken: string;
|
|
224
233
|
baseUrl?: string;
|
|
225
234
|
/**
|