@funnelsgrove/payments 0.11.23 → 0.11.24

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.
@@ -1,5 +1,8 @@
1
1
  import type { AvailablePaymentMethods, StripeCheckoutExpressCheckoutElementOptions } from '@stripe/stripe-js';
2
2
  import { type StripeSubscriptionCheckoutAnalyticsContext } from '../services/checkoutCompletionAnalytics.service.js';
3
+ export type StripeWalletCheckoutSuccess = {
4
+ checkoutSessionId: string | null;
5
+ };
3
6
  export type StripeCheckoutExpressCheckoutButtonProps = {
4
7
  amountCents: number;
5
8
  beforeConfirm?: () => Promise<string | null>;
@@ -27,7 +30,7 @@ export type StripeCheckoutExpressCheckoutButtonProps = {
27
30
  message: string;
28
31
  paymentMethod?: string;
29
32
  }) => void;
30
- onSuccess?: () => void | Promise<void>;
33
+ onSuccess?: (result: StripeWalletCheckoutSuccess) => void | Promise<void>;
31
34
  unsupportedCountryMessage?: string;
32
35
  };
33
36
  export declare function StripeCheckoutExpressCheckoutButton({ beforeConfirm, checkoutAnalytics, checkoutSessionId, returnUrl, confirmEmail, customerEmail, className, options, availabilityPaymentMethods, initialAvailable, keepInitialAvailableOnReady, serverUpdateKey, supportedCountries, onServerUpdate, onAvailabilityChange, onCancel, onError, onPaymentInfoSubmitted, onPaymentRejected, onSuccess, unsupportedCountryMessage, }: StripeCheckoutExpressCheckoutButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -154,7 +154,7 @@ export function StripeCheckoutExpressCheckoutButton({ beforeConfirm, checkoutAna
154
154
  if (checkoutAnalytics) {
155
155
  await trackPaidStripeSubscriptionCheckoutCompleted(Object.assign({ checkoutSessionId }, checkoutAnalytics));
156
156
  }
157
- await (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess());
157
+ await (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess({ checkoutSessionId: checkoutSessionId !== null && checkoutSessionId !== void 0 ? checkoutSessionId : null }));
158
158
  };
159
159
  const queueCheckoutStarted = (paymentMethod, checkoutStartSource = 'wallet_click') => {
160
160
  if (!checkoutAnalytics) {
@@ -1,3 +1,4 @@
1
+ import type { StripeWalletCheckoutSuccess } from './StripeCheckoutExpressCheckoutButton.js';
1
2
  import { type ReactNode } from 'react';
2
3
  import type { Appearance, StripeCheckoutExpressCheckoutElementOptions } from '@stripe/stripe-js';
3
4
  import { type PlatformWalletPaymentMethod } from './walletPlatform.js';
@@ -64,7 +65,7 @@ export type StripeWalletSurfaceProps = {
64
65
  onCancel?: () => void;
65
66
  onError?: (message: string | null, context: StripeWalletSurfaceErrorContext) => void;
66
67
  onPaymentInfoSubmitted?: () => void | Promise<void>;
67
- onSuccess?: () => void | Promise<void>;
68
+ onSuccess?: (result: StripeWalletCheckoutSuccess) => void | Promise<void>;
68
69
  onUnavailableClick?: () => Promise<void> | void;
69
70
  paymentMethods?: readonly PlatformWalletPaymentMethod[];
70
71
  renderHeader?: (props: {
@@ -1,3 +1,4 @@
1
+ import type { StripeWalletCheckoutSuccess } from './StripeCheckoutExpressCheckoutButton.js';
1
2
  import { type ReactNode } from 'react';
2
3
  import type { Appearance, AvailablePaymentMethods, Stripe, StripeCheckoutExpressCheckoutElementOptions } from '@stripe/stripe-js';
3
4
  import { type StripeSubscriptionCheckoutAnalyticsContext } from '../services/checkoutCompletionAnalytics.service.js';
@@ -57,7 +58,7 @@ export type WalletSubscriptionCheckoutSlotProps = {
57
58
  onCancel?: () => void;
58
59
  onError?: (message: string | null) => void;
59
60
  onPaymentInfoSubmitted?: () => void | Promise<void>;
60
- onSuccess?: () => void | Promise<void>;
61
+ onSuccess?: (result: StripeWalletCheckoutSuccess) => void | Promise<void>;
61
62
  onUnavailableClick?: () => Promise<void> | void;
62
63
  options?: Partial<StripeCheckoutExpressCheckoutElementOptions>;
63
64
  placeholderLabel: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funnelsgrove/payments",
3
- "version": "0.11.23",
3
+ "version": "0.11.24",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/The-Solid-Grove/funnelsgrove.git",