@stigg/react-sdk 4.5.4 → 4.6.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/components/checkout/CheckoutContainer.d.ts +1 -0
- package/dist/react-sdk.cjs.development.js +3 -1
- package/dist/react-sdk.cjs.development.js.map +1 -1
- package/dist/react-sdk.cjs.production.min.js +1 -1
- package/dist/react-sdk.cjs.production.min.js.map +1 -1
- package/dist/react-sdk.esm.js +3 -1
- package/dist/react-sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/checkout/CheckoutContainer.tsx +1 -0
- package/src/components/checkout/steps/payment/stripe/useSubmit.ts +6 -2
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.
|
|
2
|
+
"version": "4.6.0",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"@emotion/react": "^11.10.5",
|
|
110
110
|
"@emotion/styled": "^11.10.5",
|
|
111
111
|
"@mui/material": "^5.12.0",
|
|
112
|
-
"@stigg/js-client-sdk": "2.24.
|
|
112
|
+
"@stigg/js-client-sdk": "2.24.3",
|
|
113
113
|
"@stripe/react-stripe-js": "^2.1.1",
|
|
114
114
|
"@stripe/stripe-js": "^1.54.1",
|
|
115
115
|
"@types/styled-components": "^5.1.26",
|
|
@@ -54,6 +54,7 @@ const getStepProps = (
|
|
|
54
54
|
export type CheckoutResult = { success: boolean; errorMessage?: string; results?: ApplySubscriptionResults };
|
|
55
55
|
|
|
56
56
|
export type OnCheckoutParams = {
|
|
57
|
+
customerId: string;
|
|
57
58
|
checkoutParams: ApplySubscription;
|
|
58
59
|
checkoutAction: (params: ApplySubscription) => Promise<CheckoutResult>;
|
|
59
60
|
};
|
|
@@ -28,7 +28,7 @@ export function useSubmit({
|
|
|
28
28
|
const { useNewPaymentMethod } = usePaymentStepModel();
|
|
29
29
|
const subscriptionState = useSubscriptionState();
|
|
30
30
|
const { checkoutState, widgetState, setWidgetReadOnly } = useCheckoutModel();
|
|
31
|
-
const { setupSecret: setupIntentClientSecret } = checkoutState || {};
|
|
31
|
+
const { setupSecret: setupIntentClientSecret, customer } = checkoutState || {};
|
|
32
32
|
const stripe = useStripe();
|
|
33
33
|
const elements = useElements();
|
|
34
34
|
|
|
@@ -82,7 +82,11 @@ export function useSubmit({
|
|
|
82
82
|
|
|
83
83
|
if (success) {
|
|
84
84
|
if (onCheckout) {
|
|
85
|
-
const externalCheckoutResults = await onCheckout({
|
|
85
|
+
const externalCheckoutResults = await onCheckout({
|
|
86
|
+
customerId: customer!.id,
|
|
87
|
+
checkoutParams,
|
|
88
|
+
checkoutAction,
|
|
89
|
+
});
|
|
86
90
|
if (externalCheckoutResults.errorMessage) {
|
|
87
91
|
errorMessage = externalCheckoutResults.errorMessage;
|
|
88
92
|
}
|