@appfunnel-dev/sdk 0.12.0 → 0.13.0
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/dist/{chunk-GZKA33W2.js → chunk-CMVB7RQE.js} +3 -3
- package/dist/{chunk-GZKA33W2.js.map → chunk-CMVB7RQE.js.map} +1 -1
- package/dist/{chunk-DAHMOQ63.js → chunk-EB5VWGR4.js} +163 -4
- package/dist/chunk-EB5VWGR4.js.map +1 -0
- package/dist/{chunk-5E6WNNU4.cjs → chunk-KEFKKBBP.cjs} +162 -3
- package/dist/chunk-KEFKKBBP.cjs.map +1 -0
- package/dist/{chunk-ECWTUTEJ.cjs → chunk-QG6CE7L7.cjs} +6 -6
- package/dist/{chunk-ECWTUTEJ.cjs.map → chunk-QG6CE7L7.cjs.map} +1 -1
- package/dist/elements/index.cjs +6 -6
- package/dist/elements/index.js +2 -2
- package/dist/index.cjs +30 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -18
- package/dist/index.d.ts +34 -18
- package/dist/index.js +6 -7
- package/dist/index.js.map +1 -1
- package/dist/{internal-BuotLNwa.d.cts → internal-twwb8xjX.d.cts} +8 -0
- package/dist/{internal-BuotLNwa.d.ts → internal-twwb8xjX.d.ts} +8 -0
- package/dist/internal.cjs +2 -2
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5E6WNNU4.cjs.map +0 -1
- package/dist/chunk-DAHMOQ63.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AppFunnelConfig, P as PageDefinition, V as VariableValue, U as UserState, L as LocaleState, T as TranslationState, N as NavigationState, a as ProductsState, b as TrackingState, c as PaymentState, D as DeviceInfo, d as PageData, F as FunnelState } from './internal-
|
|
2
|
-
export { C as ConditionConfig, e as ConditionGroupConfig, f as FunnelProvider, g as FunnelProviderProps, h as FunnelSettings, i as PageConfig, j as PageState, k as PageType, l as ProductConfig, m as ProductsConfig, n as Progress, R as RouteConfig, o as RuntimeProduct, p as VariableConfig, q as VariableType } from './internal-
|
|
1
|
+
import { A as AppFunnelConfig, P as PageDefinition, V as VariableValue, U as UserState, L as LocaleState, T as TranslationState, N as NavigationState, a as ProductsState, b as TrackingState, c as PaymentState, D as DeviceInfo, d as PageData, F as FunnelState } from './internal-twwb8xjX.cjs';
|
|
2
|
+
export { C as ConditionConfig, e as ConditionGroupConfig, f as FunnelProvider, g as FunnelProviderProps, h as FunnelSettings, i as PageConfig, j as PageState, k as PageType, l as ProductConfig, m as ProductsConfig, n as Progress, R as RouteConfig, o as RuntimeProduct, p as VariableConfig, q as VariableType } from './internal-twwb8xjX.cjs';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { Appearance } from '@stripe/stripe-js';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
@@ -277,34 +277,50 @@ interface StripePaymentHandle {
|
|
|
277
277
|
/** Programmatically submit the payment form */
|
|
278
278
|
submit: () => Promise<void>;
|
|
279
279
|
}
|
|
280
|
-
interface
|
|
280
|
+
interface StripePaymentFormBaseProps {
|
|
281
281
|
/** Product ID override (default: currently selected product) */
|
|
282
282
|
productId?: string;
|
|
283
283
|
/** "checkout" for full payment, "validate-only" to just collect card */
|
|
284
284
|
mode?: 'checkout' | 'validate-only';
|
|
285
|
+
/** Additional CSS class */
|
|
286
|
+
className?: string;
|
|
287
|
+
/** Stripe Appearance override */
|
|
288
|
+
appearance?: Appearance;
|
|
289
|
+
}
|
|
290
|
+
interface StripePaymentFormElementsProps extends StripePaymentFormBaseProps {
|
|
285
291
|
/** "elements" for PaymentElement, "embedded" for Stripe Embedded Checkout */
|
|
286
|
-
variant?: 'elements'
|
|
287
|
-
/** Page key to redirect to after successful embedded checkout
|
|
292
|
+
variant?: 'elements';
|
|
293
|
+
/** Page key to redirect to after successful embedded checkout */
|
|
288
294
|
successPageKey?: string;
|
|
289
|
-
/**
|
|
290
|
-
automaticTax?: boolean;
|
|
291
|
-
/** Enable Stripe managed payments — Stripe controls tax, payment methods, etc. (embedded variant only, forces embedded mode) */
|
|
292
|
-
managedPayments?: boolean;
|
|
293
|
-
/** Allow promotion codes in checkout (embedded variant only) */
|
|
294
|
-
allowPromotionCodes?: boolean;
|
|
295
|
-
/** Called on successful payment (elements variant only — embedded uses returnUrl redirect) */
|
|
295
|
+
/** Called on successful payment */
|
|
296
296
|
onSuccess?: () => void;
|
|
297
|
-
/** Called on payment error
|
|
297
|
+
/** Called on payment error */
|
|
298
298
|
onError?: (error: string) => void;
|
|
299
|
-
/** Called when the Stripe form is ready to accept submissions
|
|
299
|
+
/** Called when the Stripe form is ready to accept submissions */
|
|
300
300
|
onReady?: () => void;
|
|
301
|
-
/** Additional CSS class */
|
|
302
|
-
className?: string;
|
|
303
|
-
/** Stripe Appearance override (elements variant only) */
|
|
304
|
-
appearance?: Appearance;
|
|
305
301
|
/** PaymentElement layout option (default: 'tabs') */
|
|
306
302
|
layout?: 'tabs' | 'accordion' | 'auto';
|
|
303
|
+
automaticTax?: never;
|
|
304
|
+
managedPayments?: never;
|
|
305
|
+
allowPromotionCodes?: never;
|
|
306
|
+
}
|
|
307
|
+
interface StripePaymentFormEmbeddedProps extends StripePaymentFormBaseProps {
|
|
308
|
+
/** "embedded" for Stripe Embedded Checkout */
|
|
309
|
+
variant: 'embedded';
|
|
310
|
+
/** Page key to redirect to after successful embedded checkout */
|
|
311
|
+
successPageKey: string;
|
|
312
|
+
/** Enable Stripe automatic tax calculation */
|
|
313
|
+
automaticTax?: boolean;
|
|
314
|
+
/** Enable Stripe managed payments — Stripe controls tax, payment methods, etc. (forces embedded mode) */
|
|
315
|
+
managedPayments?: boolean;
|
|
316
|
+
/** Allow promotion codes in checkout */
|
|
317
|
+
allowPromotionCodes?: boolean;
|
|
318
|
+
onSuccess?: never;
|
|
319
|
+
onError?: never;
|
|
320
|
+
onReady?: never;
|
|
321
|
+
layout?: never;
|
|
307
322
|
}
|
|
323
|
+
type StripePaymentFormProps = StripePaymentFormElementsProps | StripePaymentFormEmbeddedProps;
|
|
308
324
|
/**
|
|
309
325
|
* Stripe payment component supporting PaymentElement and Embedded Checkout.
|
|
310
326
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AppFunnelConfig, P as PageDefinition, V as VariableValue, U as UserState, L as LocaleState, T as TranslationState, N as NavigationState, a as ProductsState, b as TrackingState, c as PaymentState, D as DeviceInfo, d as PageData, F as FunnelState } from './internal-
|
|
2
|
-
export { C as ConditionConfig, e as ConditionGroupConfig, f as FunnelProvider, g as FunnelProviderProps, h as FunnelSettings, i as PageConfig, j as PageState, k as PageType, l as ProductConfig, m as ProductsConfig, n as Progress, R as RouteConfig, o as RuntimeProduct, p as VariableConfig, q as VariableType } from './internal-
|
|
1
|
+
import { A as AppFunnelConfig, P as PageDefinition, V as VariableValue, U as UserState, L as LocaleState, T as TranslationState, N as NavigationState, a as ProductsState, b as TrackingState, c as PaymentState, D as DeviceInfo, d as PageData, F as FunnelState } from './internal-twwb8xjX.js';
|
|
2
|
+
export { C as ConditionConfig, e as ConditionGroupConfig, f as FunnelProvider, g as FunnelProviderProps, h as FunnelSettings, i as PageConfig, j as PageState, k as PageType, l as ProductConfig, m as ProductsConfig, n as Progress, R as RouteConfig, o as RuntimeProduct, p as VariableConfig, q as VariableType } from './internal-twwb8xjX.js';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { Appearance } from '@stripe/stripe-js';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
@@ -277,34 +277,50 @@ interface StripePaymentHandle {
|
|
|
277
277
|
/** Programmatically submit the payment form */
|
|
278
278
|
submit: () => Promise<void>;
|
|
279
279
|
}
|
|
280
|
-
interface
|
|
280
|
+
interface StripePaymentFormBaseProps {
|
|
281
281
|
/** Product ID override (default: currently selected product) */
|
|
282
282
|
productId?: string;
|
|
283
283
|
/** "checkout" for full payment, "validate-only" to just collect card */
|
|
284
284
|
mode?: 'checkout' | 'validate-only';
|
|
285
|
+
/** Additional CSS class */
|
|
286
|
+
className?: string;
|
|
287
|
+
/** Stripe Appearance override */
|
|
288
|
+
appearance?: Appearance;
|
|
289
|
+
}
|
|
290
|
+
interface StripePaymentFormElementsProps extends StripePaymentFormBaseProps {
|
|
285
291
|
/** "elements" for PaymentElement, "embedded" for Stripe Embedded Checkout */
|
|
286
|
-
variant?: 'elements'
|
|
287
|
-
/** Page key to redirect to after successful embedded checkout
|
|
292
|
+
variant?: 'elements';
|
|
293
|
+
/** Page key to redirect to after successful embedded checkout */
|
|
288
294
|
successPageKey?: string;
|
|
289
|
-
/**
|
|
290
|
-
automaticTax?: boolean;
|
|
291
|
-
/** Enable Stripe managed payments — Stripe controls tax, payment methods, etc. (embedded variant only, forces embedded mode) */
|
|
292
|
-
managedPayments?: boolean;
|
|
293
|
-
/** Allow promotion codes in checkout (embedded variant only) */
|
|
294
|
-
allowPromotionCodes?: boolean;
|
|
295
|
-
/** Called on successful payment (elements variant only — embedded uses returnUrl redirect) */
|
|
295
|
+
/** Called on successful payment */
|
|
296
296
|
onSuccess?: () => void;
|
|
297
|
-
/** Called on payment error
|
|
297
|
+
/** Called on payment error */
|
|
298
298
|
onError?: (error: string) => void;
|
|
299
|
-
/** Called when the Stripe form is ready to accept submissions
|
|
299
|
+
/** Called when the Stripe form is ready to accept submissions */
|
|
300
300
|
onReady?: () => void;
|
|
301
|
-
/** Additional CSS class */
|
|
302
|
-
className?: string;
|
|
303
|
-
/** Stripe Appearance override (elements variant only) */
|
|
304
|
-
appearance?: Appearance;
|
|
305
301
|
/** PaymentElement layout option (default: 'tabs') */
|
|
306
302
|
layout?: 'tabs' | 'accordion' | 'auto';
|
|
303
|
+
automaticTax?: never;
|
|
304
|
+
managedPayments?: never;
|
|
305
|
+
allowPromotionCodes?: never;
|
|
306
|
+
}
|
|
307
|
+
interface StripePaymentFormEmbeddedProps extends StripePaymentFormBaseProps {
|
|
308
|
+
/** "embedded" for Stripe Embedded Checkout */
|
|
309
|
+
variant: 'embedded';
|
|
310
|
+
/** Page key to redirect to after successful embedded checkout */
|
|
311
|
+
successPageKey: string;
|
|
312
|
+
/** Enable Stripe automatic tax calculation */
|
|
313
|
+
automaticTax?: boolean;
|
|
314
|
+
/** Enable Stripe managed payments — Stripe controls tax, payment methods, etc. (forces embedded mode) */
|
|
315
|
+
managedPayments?: boolean;
|
|
316
|
+
/** Allow promotion codes in checkout */
|
|
317
|
+
allowPromotionCodes?: boolean;
|
|
318
|
+
onSuccess?: never;
|
|
319
|
+
onError?: never;
|
|
320
|
+
onReady?: never;
|
|
321
|
+
layout?: never;
|
|
307
322
|
}
|
|
323
|
+
type StripePaymentFormProps = StripePaymentFormElementsProps | StripePaymentFormEmbeddedProps;
|
|
308
324
|
/**
|
|
309
325
|
* Stripe payment component supporting PaymentElement and Embedded Checkout.
|
|
310
326
|
*
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { useNavigation, useResponses } from './chunk-
|
|
2
|
-
export { useNavigation, useResponse, useResponses } from './chunk-
|
|
3
|
-
import { useFunnelContext } from './chunk-
|
|
4
|
-
export { FunnelProvider, registerIntegration } from './chunk-
|
|
1
|
+
import { useNavigation, useResponses } from './chunk-CMVB7RQE.js';
|
|
2
|
+
export { useNavigation, useResponse, useResponses } from './chunk-CMVB7RQE.js';
|
|
3
|
+
import { useFunnelContext } from './chunk-EB5VWGR4.js';
|
|
4
|
+
export { FunnelProvider, registerIntegration } from './chunk-EB5VWGR4.js';
|
|
5
5
|
import { forwardRef, useMemo, useRef, useEffect, useCallback, useImperativeHandle, useState, useSyncExternalStore } from 'react';
|
|
6
|
+
import { loadStripe } from '@stripe/stripe-js';
|
|
6
7
|
import { toast } from 'sonner';
|
|
7
8
|
export { toast } from 'sonner';
|
|
8
|
-
import { loadStripe } from '@stripe/stripe-js';
|
|
9
9
|
import { useStripe, useElements, PaymentElement, EmbeddedCheckoutProvider, EmbeddedCheckout, Elements } from '@stripe/react-stripe-js';
|
|
10
10
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
11
11
|
|
|
@@ -447,8 +447,7 @@ function usePayment() {
|
|
|
447
447
|
console.log(
|
|
448
448
|
"[Purchase] 3DS authentication required, loading Stripe..."
|
|
449
449
|
);
|
|
450
|
-
const
|
|
451
|
-
const stripeInstance = await loadStripe2(
|
|
450
|
+
const stripeInstance = await loadStripe(
|
|
452
451
|
result.publishableKey
|
|
453
452
|
);
|
|
454
453
|
if (!stripeInstance) {
|