@funnelsgrove/payments 0.11.24 → 0.12.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.
Files changed (29) hide show
  1. package/README.md +14 -8
  2. package/dist/providers/solidgate/components/SolidgateCheckoutDialog.d.ts +2 -66
  3. package/dist/providers/solidgate/components/SolidgateCheckoutDialog.js +5 -524
  4. package/dist/providers/solidgate/components/SolidgateCheckoutDialog.styles.d.ts +1 -0
  5. package/dist/providers/solidgate/components/SolidgateCheckoutDialog.styles.js +400 -0
  6. package/dist/providers/solidgate/components/SolidgateCheckoutDialog.types.d.ts +66 -0
  7. package/dist/providers/solidgate/components/SolidgateCheckoutSummary.d.ts +4 -0
  8. package/dist/providers/solidgate/components/SolidgateCheckoutSummary.js +15 -0
  9. package/dist/providers/solidgate/components/SolidgatePaymentForm.d.ts +12 -0
  10. package/dist/providers/solidgate/components/SolidgatePaymentForm.js +114 -0
  11. package/dist/providers/solidgate/services/solidgate.service.js +15 -18
  12. package/dist/providers/stripe/hooks/checkoutAttempt.js +0 -3
  13. package/dist/providers/stripe/hooks/checkoutIdentity.js +1 -5
  14. package/dist/providers/stripe/hooks/useStripeOneTimeCheckoutSession.js +1 -1
  15. package/dist/providers/stripe/hooks/useStripeSubscriptionCheckoutSession.js +1 -1
  16. package/dist/providers/stripe/services/hostedCheckout/requests.d.ts +7 -0
  17. package/dist/providers/stripe/services/hostedCheckout/requests.js +15 -8
  18. package/dist/providers/stripe/services/hostedCheckout/types.d.ts +6 -0
  19. package/dist/providers/stripe/services/stripe.service.d.ts +0 -1
  20. package/dist/providers/stripe/services/stripe.service.js +0 -1
  21. package/dist/services/checkoutObservability.service.js +1 -1
  22. package/dist/services/publishedBillingRuntime.service.js +4 -4
  23. package/package.json +3 -3
  24. package/dist/providers/stripe/services/paymentIntent/createPaymentIntent.d.ts +0 -5
  25. package/dist/providers/stripe/services/paymentIntent/createPaymentIntent.js +0 -8
  26. package/dist/providers/stripe/services/paymentIntent/requests.d.ts +0 -12
  27. package/dist/providers/stripe/services/paymentIntent/requests.js +0 -15
  28. package/dist/providers/stripe/services/paymentIntent/types.d.ts +0 -18
  29. /package/dist/providers/{stripe/services/paymentIntent/types.js → solidgate/components/SolidgateCheckoutDialog.types.js} +0 -0
package/README.md CHANGED
@@ -17,7 +17,8 @@ Render every visible wallet placement with `StripeSubscriptionWalletSurface` or
17
17
 
18
18
  - Each surface owns one private Checkout Session per simultaneously visible wallet placement, isolated by its own `surfaceId`.
19
19
  - Simultaneously visible placements may use the same plan and coupon; nothing is shared because each surface keeps its own session.
20
- - When the selected plan changes, the surface updates the existing Checkout Session in place without changing `surfaceId`, React `key`, `clientSecret`, `CheckoutProvider`, or the Express Checkout iframe.
20
+ - Changing the selected plan replaces the surface’s Checkout Session and `clientSecret`. A stable `surfaceId` identifies the placement; it does not guarantee that the Stripe iframe survives a plan change.
21
+ - If payment confirmation is already in flight when the selection changes, the success callback remains bound to the original confirmed Checkout Session.
21
22
 
22
23
  Use these for new subscription paywalls:
23
24
 
@@ -54,7 +55,6 @@ provider-neutral status endpoint finds canonical shared-ledger payment evidence.
54
55
 
55
56
  Keep these exports available for saved drafts, old published artifacts, and controlled migrations. Do not use them for new subscription checkout work:
56
57
 
57
- - `createStripePaymentIntent`
58
58
  - `SharedStripeCheckoutDialog`
59
59
  - `ApplePaySubscribeButton`
60
60
  - `GooglePaySubscribeButton`
@@ -92,7 +92,7 @@ When a live funnel still uses one of these, migrate the funnel deliberately with
92
92
  - `services/runtimeBillingPlanCatalog.service`: test/live runtime catalog selection.
93
93
  - `services/paywallOffer.service`: timed discount and display-plan helpers.
94
94
  - `providers/paymentProvider.types`: provider-neutral checkout state shared by every adapter.
95
- - `providers/stripe/services/*`: Stripe loader, Checkout Session, hosted checkout, one-click, analytics, and deprecated PaymentIntent compatibility clients.
95
+ - `providers/stripe/services/*`: Stripe loader, Checkout Session, hosted checkout, one-click, analytics, and one-click completion.
96
96
  - `providers/stripe/hooks/*`: Stripe-backed plan resolution and isolated card/wallet checkout-session state.
97
97
  - `providers/stripe/components/*`: plan selector, checkout dialogs, Express Checkout wrappers, wallet slots, placeholders, and trust assets.
98
98
  - `providers/stripe/testing/*`: Stripe wallet checkout smoke assertions.
@@ -111,16 +111,22 @@ service just to resolve or display plans. Shared config/services are checked for
111
111
  provider dependencies in `paymentBoundaries.test.ts`.
112
112
 
113
113
  Stripe browser operations live in `providers/stripe/services/checkout/`,
114
- `hostedCheckout/`, `oneClick/` and the compatibility-only `paymentIntent/`.
114
+ `hostedCheckout/` and `oneClick/`.
115
115
  Keep request mappers (`requests.ts`) beside the short async operation functions;
116
116
  common validation and metadata normalization belong in the local `shared/` folder.
117
117
  `stripeClient.ts` owns the Stripe.js cache. One-click orchestration calls the
118
118
  charge and confirmation functions in its own folder, without a workflow layer.
119
119
 
120
- `stripe.service.ts` remains a compatibility export facade. All existing root
121
- exports, signatures, SDK payloads, errors and confirmation behavior remain intact.
122
- HTTP transport and V1/V2 endpoint choice belong to the runtime SDK, not payments.
123
- No automatic charge retry, V1 fallback, or extra conversion event is introduced.
120
+ `stripe.service.ts` is the public export facade. From 0.12.0, all payment
121
+ transport uses V2. `createStripePaymentIntent` is removed: migrate to
122
+ `createStripeOneTimeCheckout` and its Checkout Session UI. Keep legacy published
123
+ bundles on their pinned releases until their own migration passes checkout QA.
124
+ Hosted checkout uses `createStripeCheckoutSession` with published profile,
125
+ provider and plan selection plus `successUrl` and `cancelUrl`. Deploy hosted V2
126
+ support before releasing this SDK. Subscription mutation callers forward the
127
+ listed `subscriptionRef`; no provider ownership is reconstructed in the browser.
128
+ HTTP transport belongs to the runtime SDK. No charge retry, V1 fallback or extra
129
+ conversion event is introduced.
124
130
 
125
131
  ## Engineering Rules
126
132
 
@@ -1,67 +1,3 @@
1
- import type { FunnelSdkRuntimeConfigOverrides, FunnelStepType, RuntimeMode } from '@funnelsgrove/runtime';
2
- import { type PrepareSolidgateCheckoutInput, type SolidgateCheckoutPreparation } from '../services/solidgate.service.js';
3
- export type SolidgateCheckoutDialogState = 'collecting_email' | 'loading' | 'ready' | 'submitting' | 'verifying' | 'success' | 'recoverable_error' | 'expired';
4
- export type SolidgateCheckoutDialogContent = {
5
- title: string;
6
- closeAriaLabel: string;
7
- loading: string;
8
- submitting: string;
9
- verifying: string;
10
- success: string;
11
- error: string;
12
- expired: string;
13
- retry: string;
14
- resumeVerification: string;
15
- customerEmailLabel: string;
16
- customerEmailPlaceholder: string;
17
- customerEmailInvalid: string;
18
- customerEmailUnavailable: string;
19
- customerEmailContinue: string;
20
- };
21
- export type SolidgateCheckoutDialogPresentation = {
22
- buttonColor: string;
23
- cardSubmitLabel: string;
24
- countdownLabel: string;
25
- discountAmountLabel: string;
26
- discountLabel: string;
27
- discountPercent: number;
28
- originalPriceLabel: string;
29
- originalPriceValue: string;
30
- promoActive: boolean;
31
- promoCode: string;
32
- promoCodeLabel: string;
33
- remainingSeconds: number;
34
- satisfactionLabel: string;
35
- satisfactionPercent: string;
36
- savedLabel: string;
37
- secureLabel: string;
38
- themeColor: string;
39
- title: string;
40
- totalLabel: string;
41
- totalValue: string;
42
- };
43
- export type SolidgateCheckoutDialogProps = {
44
- open: boolean;
45
- request: Omit<PrepareSolidgateCheckoutInput, 'signal'>;
46
- customerEmail?: string | null;
47
- checkoutAnalytics?: SolidgateCheckoutAnalyticsContext | null;
48
- content?: Partial<SolidgateCheckoutDialogContent>;
49
- presentation?: SolidgateCheckoutDialogPresentation;
50
- onClose: () => void;
51
- onCustomerEmailCommit?: (email: string) => Promise<string>;
52
- onSuccess?: (checkout: SolidgateCheckoutPreparation) => void | Promise<void>;
53
- onRetry?: () => void;
54
- onError?: (message: string) => void;
55
- onStateChange?: (state: SolidgateCheckoutDialogState) => void;
56
- };
57
- export type SolidgateCheckoutAnalyticsContext = {
58
- environment?: RuntimeMode;
59
- featureFlags?: Record<string, string | null | undefined>;
60
- metadata?: Record<string, unknown> | null;
61
- runtimeConfig?: FunnelSdkRuntimeConfigOverrides;
62
- stepId: string;
63
- stepName: string;
64
- stepType: Extract<FunnelStepType, 'checkout' | 'paywall_offer' | 'upsell_offer'>;
65
- stepContractVersion: number;
66
- };
1
+ import type { SolidgateCheckoutDialogProps } from './SolidgateCheckoutDialog.types.js';
2
+ export type { SolidgateCheckoutDialogState, SolidgateCheckoutDialogContent, SolidgateCheckoutDialogPresentation, SolidgateCheckoutDialogProps, SolidgateCheckoutAnalyticsContext, } from './SolidgateCheckoutDialog.types.js';
67
3
  export declare function SolidgateCheckoutDialog({ open, request, customerEmail, checkoutAnalytics, content, presentation, onClose, onCustomerEmailCommit, onSuccess, onRetry, onError, onStateChange, }: SolidgateCheckoutDialogProps): import("react/jsx-runtime").JSX.Element | null;