@funnelsgrove/payments 0.7.19 → 0.7.20
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.
|
@@ -75,37 +75,40 @@ export function WalletSubscriptionCheckoutSlot({ amountCents, appearance, availa
|
|
|
75
75
|
intentKey,
|
|
76
76
|
});
|
|
77
77
|
}, []);
|
|
78
|
+
const autoWalletClientSecret = session.activeClientSecret;
|
|
79
|
+
const autoWalletIntentKey = session.intentKey;
|
|
80
|
+
const autoWalletLoading = session.loading.wallet;
|
|
81
|
+
const prepareWalletCheckout = session.prepareWalletCheckout;
|
|
78
82
|
useEffect(() => {
|
|
79
83
|
if (slotDisabled ||
|
|
80
84
|
suspended ||
|
|
81
85
|
!expressCheckoutAllowed ||
|
|
82
86
|
walletAvailable === false ||
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
autoWalletLoading ||
|
|
88
|
+
autoWalletClientSecret) {
|
|
85
89
|
return;
|
|
86
90
|
}
|
|
87
|
-
if (autoWalletPreparationIntentKeyRef.current ===
|
|
91
|
+
if (autoWalletPreparationIntentKeyRef.current === autoWalletIntentKey) {
|
|
88
92
|
return;
|
|
89
93
|
}
|
|
90
|
-
autoWalletPreparationIntentKeyRef.current =
|
|
91
|
-
void
|
|
92
|
-
.prepareWalletCheckout({
|
|
94
|
+
autoWalletPreparationIntentKeyRef.current = autoWalletIntentKey;
|
|
95
|
+
void prepareWalletCheckout({
|
|
93
96
|
checkoutStartSource: 'wallet_render',
|
|
94
97
|
paymentMethod: analyticsPaymentMethod,
|
|
95
98
|
})
|
|
96
99
|
.then((readyClientSecret) => {
|
|
97
100
|
if (!readyClientSecret) {
|
|
98
|
-
reportWalletPreparationFailure(
|
|
101
|
+
reportWalletPreparationFailure(autoWalletIntentKey);
|
|
99
102
|
}
|
|
100
103
|
});
|
|
101
104
|
}, [
|
|
102
105
|
analyticsPaymentMethod,
|
|
106
|
+
autoWalletClientSecret,
|
|
107
|
+
autoWalletIntentKey,
|
|
108
|
+
autoWalletLoading,
|
|
103
109
|
expressCheckoutAllowed,
|
|
110
|
+
prepareWalletCheckout,
|
|
104
111
|
reportWalletPreparationFailure,
|
|
105
|
-
session.activeClientSecret,
|
|
106
|
-
session.intentKey,
|
|
107
|
-
session.loading.wallet,
|
|
108
|
-
session.prepareWalletCheckout,
|
|
109
112
|
slotDisabled,
|
|
110
113
|
suspended,
|
|
111
114
|
walletAvailable,
|
|
@@ -136,7 +139,7 @@ export function WalletSubscriptionCheckoutSlot({ amountCents, appearance, availa
|
|
|
136
139
|
intentKey: session.intentKey,
|
|
137
140
|
});
|
|
138
141
|
void session.restartWalletCheckout({
|
|
139
|
-
checkoutStartSource: '
|
|
142
|
+
checkoutStartSource: 'wallet_click',
|
|
140
143
|
paymentMethod: analyticsPaymentMethod,
|
|
141
144
|
});
|
|
142
145
|
return;
|
|
@@ -157,7 +160,7 @@ export function WalletSubscriptionCheckoutSlot({ amountCents, appearance, availa
|
|
|
157
160
|
}
|
|
158
161
|
setWalletCheckoutStartedAfterClickIntentKey(session.intentKey);
|
|
159
162
|
const readyClientSecret = await session.prepareWalletCheckout({
|
|
160
|
-
checkoutStartSource: '
|
|
163
|
+
checkoutStartSource: 'wallet_click',
|
|
161
164
|
paymentMethod: analyticsPaymentMethod,
|
|
162
165
|
});
|
|
163
166
|
if (!readyClientSecret) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funnelsgrove/payments",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.20",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/The-Solid-Grove/funnelsgrove.git",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"test:run": "vitest run --passWithNoTests"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@funnelsgrove/analytics": "^0.1.
|
|
36
|
-
"@funnelsgrove/runtime": "^0.7.
|
|
35
|
+
"@funnelsgrove/analytics": "^0.1.78",
|
|
36
|
+
"@funnelsgrove/runtime": "^0.7.29",
|
|
37
37
|
"@solidgate/react-sdk": "1.34.0",
|
|
38
38
|
"@stripe/react-stripe-js": "^5.6.0",
|
|
39
39
|
"@stripe/stripe-js": "^8.7.0",
|