@funnelsgrove/payments 0.7.8 → 0.7.9
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.
|
@@ -105,17 +105,26 @@ export function SolidgateCheckoutDialog({ open, request, checkoutAnalytics, cont
|
|
|
105
105
|
onStateChangeRef.current = onStateChange;
|
|
106
106
|
onSuccessRef.current = onSuccess;
|
|
107
107
|
}, [checkoutAnalytics, copy, onError, onStateChange, onSuccess]);
|
|
108
|
-
const { discountKeyOrProviderId, failUrl, funnelPlanKey, funnelEndUserId, funnelId, idempotencyKey, offerSetId,
|
|
108
|
+
const { discountKeyOrProviderId, failUrl, funnelPlanKey, funnelEndUserId, funnelId, idempotencyKey, offerSetId, returnUrl, runtimeConfig, successUrl, } = request;
|
|
109
109
|
const { apiBaseUrl, funnelId: runtimeFunnelId, funnelSdkPublishableKey, funnelVersionId, } = runtimeConfig || {};
|
|
110
110
|
const hasRuntimeConfig = runtimeConfig !== undefined;
|
|
111
|
-
const normalizedRequest = useMemo(() => (
|
|
112
|
-
?
|
|
113
|
-
:
|
|
111
|
+
const normalizedRequest = useMemo(() => ({
|
|
112
|
+
funnelId: (funnelId === null || funnelId === void 0 ? void 0 : funnelId.trim()) || null,
|
|
113
|
+
funnelEndUserId: funnelEndUserId.trim(),
|
|
114
|
+
offerSetId: offerSetId.trim(),
|
|
115
|
+
funnelPlanKey: funnelPlanKey.trim(),
|
|
116
|
+
idempotencyKey: idempotencyKey.trim(),
|
|
117
|
+
discountKeyOrProviderId: (discountKeyOrProviderId === null || discountKeyOrProviderId === void 0 ? void 0 : discountKeyOrProviderId.trim()) || null,
|
|
118
|
+
returnUrl: returnUrl.trim(),
|
|
119
|
+
successUrl: successUrl.trim(),
|
|
120
|
+
failUrl: failUrl.trim(),
|
|
121
|
+
runtimeConfig: hasRuntimeConfig ? {
|
|
114
122
|
apiBaseUrl: (apiBaseUrl === null || apiBaseUrl === void 0 ? void 0 : apiBaseUrl.trim()) || null,
|
|
115
123
|
funnelId: (runtimeFunnelId === null || runtimeFunnelId === void 0 ? void 0 : runtimeFunnelId.trim()) || null,
|
|
116
124
|
funnelVersionId: (funnelVersionId === null || funnelVersionId === void 0 ? void 0 : funnelVersionId.trim()) || null,
|
|
117
125
|
funnelSdkPublishableKey: (funnelSdkPublishableKey === null || funnelSdkPublishableKey === void 0 ? void 0 : funnelSdkPublishableKey.trim()) || null,
|
|
118
|
-
} : undefined
|
|
126
|
+
} : undefined,
|
|
127
|
+
}), [
|
|
119
128
|
apiBaseUrl,
|
|
120
129
|
discountKeyOrProviderId,
|
|
121
130
|
failUrl,
|
|
@@ -126,7 +135,6 @@ export function SolidgateCheckoutDialog({ open, request, checkoutAnalytics, cont
|
|
|
126
135
|
funnelVersionId,
|
|
127
136
|
idempotencyKey,
|
|
128
137
|
offerSetId,
|
|
129
|
-
projectBillingPlanId,
|
|
130
138
|
returnUrl,
|
|
131
139
|
hasRuntimeConfig,
|
|
132
140
|
runtimeFunnelId,
|
|
@@ -25,9 +25,7 @@ export type PrepareSolidgateCheckoutInput = {
|
|
|
25
25
|
funnelId?: string | null;
|
|
26
26
|
funnelEndUserId: string;
|
|
27
27
|
offerSetId: string;
|
|
28
|
-
funnelPlanKey
|
|
29
|
-
/** @deprecated Published funnels may send this during the offer-set migration window. */
|
|
30
|
-
projectBillingPlanId?: string | null;
|
|
28
|
+
funnelPlanKey: string;
|
|
31
29
|
idempotencyKey: string;
|
|
32
30
|
discountKeyOrProviderId?: string | null;
|
|
33
31
|
returnUrl: string;
|
|
@@ -99,9 +99,17 @@ const parseStatus = (value) => {
|
|
|
99
99
|
};
|
|
100
100
|
export const prepareSolidgateCheckout = async (input) => {
|
|
101
101
|
var _a;
|
|
102
|
-
return parsePreparation(await postJson('/sdk/public/payments/solidgate/checkout',
|
|
103
|
-
|
|
104
|
-
:
|
|
102
|
+
return parsePreparation(await postJson('/sdk/public/payments/solidgate/checkout', {
|
|
103
|
+
funnelId: resolveFunnelId(input.funnelId, input.runtimeConfig),
|
|
104
|
+
funnelEndUserId: requiredString(input.funnelEndUserId, 'funnelEndUserId'),
|
|
105
|
+
offerSetId: requiredString(input.offerSetId, 'offerSetId'),
|
|
106
|
+
funnelPlanKey: requiredString(input.funnelPlanKey, 'funnelPlanKey'),
|
|
107
|
+
idempotencyKey: requiredString(input.idempotencyKey, 'idempotencyKey'),
|
|
108
|
+
discountKeyOrProviderId: ((_a = input.discountKeyOrProviderId) === null || _a === void 0 ? void 0 : _a.trim()) || null,
|
|
109
|
+
returnUrl: requiredString(input.returnUrl, 'returnUrl'),
|
|
110
|
+
successUrl: requiredString(input.successUrl, 'successUrl'),
|
|
111
|
+
failUrl: requiredString(input.failUrl, 'failUrl'),
|
|
112
|
+
}, input.runtimeConfig, input.signal));
|
|
105
113
|
};
|
|
106
114
|
export const retrieveSolidgateCheckoutStatus = async (input) => {
|
|
107
115
|
const attemptId = requiredString(input.attemptId, 'attemptId');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funnelsgrove/payments",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.9",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/The-Solid-Grove/funnelsgrove.git",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@funnelsgrove/analytics": "^0.1.67",
|
|
36
|
-
"@funnelsgrove/runtime": "^0.7.
|
|
36
|
+
"@funnelsgrove/runtime": "^0.7.19",
|
|
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",
|