@funnelsgrove/payments 0.1.32 → 0.1.34

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.
@@ -218,7 +218,6 @@ function SharedStripeCheckoutV2Form({ amountCents, buttonColor, cardSubmitLabel,
218
218
  return;
219
219
  }
220
220
  const result = await checkoutState.checkout.confirm({
221
- email: syncedEmail || undefined,
222
221
  redirect: 'if_required',
223
222
  });
224
223
  if (result.type === 'error') {
@@ -260,7 +259,7 @@ function SharedStripeCheckoutV2Form({ amountCents, buttonColor, cardSubmitLabel,
260
259
  effectiveSelectedMethod === 'wallet' ? 'is-visible' : '',
261
260
  ]
262
261
  .filter(Boolean)
263
- .join(' '), children: [_jsxs("p", { className: 'shared-checkout-v2-secure-pill', children: [_jsx(SecurityLockIcon, { className: 'shared-checkout-v2-secure-pill-icon' }), secureLabel] }), _jsxs("div", { className: 'shared-checkout-v2-wallet-shell', "aria-label": walletAriaLabel, children: [_jsx(StripeCheckoutExpressCheckoutButton, { amountCents: amountCents, availabilityPaymentMethods: walletPaymentMethods, beforeConfirm: ensureCustomerEmail, className: 'shared-checkout-v2-express-buttons', confirmEmail: Boolean(resolvedCustomerEmail), customerEmail: resolvedCustomerEmail, customerName: customerName, initialAvailable: initialWalletAvailable, keepInitialAvailableOnReady: initialWalletAvailable === true, onAvailabilityChange: handleWalletAvailabilityChange, onError: setSharedError, onSuccess: onSuccess, options: expressCheckoutOptions, returnUrl: returnUrl, summaryLabel: expressCheckoutSummaryLabel }), _jsx("span", { className: 'shared-checkout-v2-sr-only', children: walletAriaLabel })] })] }), _jsxs("div", { hidden: effectiveSelectedMethod !== 'card', className: [
262
+ .join(' '), children: [_jsxs("p", { className: 'shared-checkout-v2-secure-pill', children: [_jsx(SecurityLockIcon, { className: 'shared-checkout-v2-secure-pill-icon' }), secureLabel] }), _jsxs("div", { className: 'shared-checkout-v2-wallet-shell', "aria-label": walletAriaLabel, children: [_jsx(StripeCheckoutExpressCheckoutButton, { amountCents: amountCents, availabilityPaymentMethods: walletPaymentMethods, beforeConfirm: ensureCustomerEmail, className: 'shared-checkout-v2-express-buttons', confirmEmail: false, customerEmail: resolvedCustomerEmail, customerName: customerName, initialAvailable: initialWalletAvailable, keepInitialAvailableOnReady: initialWalletAvailable === true, onAvailabilityChange: handleWalletAvailabilityChange, onError: setSharedError, onSuccess: onSuccess, options: expressCheckoutOptions, returnUrl: returnUrl, summaryLabel: expressCheckoutSummaryLabel }), _jsx("span", { className: 'shared-checkout-v2-sr-only', children: walletAriaLabel })] })] }), _jsxs("div", { hidden: effectiveSelectedMethod !== 'card', className: [
264
263
  'shared-checkout-v2-card-panel',
265
264
  effectiveSelectedMethod === 'card' ? 'is-visible' : '',
266
265
  ]
@@ -1 +1,7 @@
1
+ import { type RuntimeMode } from '@funnelsgrove/runtime';
1
2
  export * from '@funnelsgrove/runtime';
3
+ export type PaymentRuntimeConfig = {
4
+ funnelSdkPublishableKey?: string | null;
5
+ };
6
+ export declare const resolvePaymentRuntimeMode: (runtimeMode: RuntimeMode, runtimeConfig?: PaymentRuntimeConfig | null) => RuntimeMode;
7
+ export declare const usePaymentRuntimeMode: (runtimeConfig?: PaymentRuntimeConfig | null) => RuntimeMode;
@@ -1 +1,13 @@
1
+ import { useMemo } from 'react';
2
+ import { useRuntimeMode } from '@funnelsgrove/runtime';
1
3
  export * from '@funnelsgrove/runtime';
4
+ export const resolvePaymentRuntimeMode = (runtimeMode, runtimeConfig) => {
5
+ void runtimeConfig;
6
+ return runtimeMode;
7
+ };
8
+ export const usePaymentRuntimeMode = (runtimeConfig) => {
9
+ var _a;
10
+ const [runtimeMode] = useRuntimeMode();
11
+ const funnelSdkPublishableKey = (_a = runtimeConfig === null || runtimeConfig === void 0 ? void 0 : runtimeConfig.funnelSdkPublishableKey) !== null && _a !== void 0 ? _a : null;
12
+ return useMemo(() => resolvePaymentRuntimeMode(runtimeMode, { funnelSdkPublishableKey }), [funnelSdkPublishableKey, runtimeMode]);
13
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funnelsgrove/payments",
3
- "version": "0.1.32",
3
+ "version": "0.1.34",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./dist/index.js",
@@ -26,7 +26,7 @@
26
26
  "test:run": "vitest run --passWithNoTests"
27
27
  },
28
28
  "dependencies": {
29
- "@funnelsgrove/runtime": "0.1.14",
29
+ "@funnelsgrove/runtime": "^0.1.18",
30
30
  "@stripe/react-stripe-js": "^5.6.0",
31
31
  "@stripe/stripe-js": "^8.7.0",
32
32
  "react": "19.2.3",