@loczer/storefront-sdk 0.241.0 → 0.243.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/chunks/pkg/booking-engine/dist/models/{Product.shared-VisFafx-.js → Product.shared-JIXwUVrg.js} +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas/{base-asset-BuqI-BM_.js → base-asset-DtBfhenO.js} +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas/{base-booking-gCY-ZP5p.js → base-booking-D9S-zS-D.js} +2 -2
- package/dist/chunks/pkg/booking-engine/dist/schemas/{base-product-r04ZJglB.js → base-product-Dj-bv0QD.js} +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas/{cart-inputs-ps94yuAR.js → cart-inputs-CIeuiTzp.js} +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas/{insurance-XwIj1m3Z.js → insurance-v2GZHSVq.js} +1 -1
- package/dist/chunks/pkg/booking-engine/dist/{schemas-7yx45S2o.js → schemas-B82mPOxs.js} +6 -6
- package/dist/components/Footer/businessHoursStatus.js +1 -1
- package/dist/i18n/en.d.ts +1 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +2 -1
- package/dist/i18n/fr.d.ts +1 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +2 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -6
- package/dist/lib/booking-period.js +1 -1
- package/dist/lib/booking.js +2 -2
- package/dist/lib/checkoutSubmit.d.ts +4 -0
- package/dist/lib/checkoutSubmit.d.ts.map +1 -1
- package/dist/lib/checkoutSubmit.js +19 -11
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +199 -199
- package/dist/pages/CheckoutPaymentPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPaymentPage.js +168 -167
- package/dist/pages/CheckoutSuccessPage.d.ts.map +1 -1
- package/dist/pages/CheckoutSuccessPage.js +37 -25
- package/dist/storefront.css +1 -1
- package/dist/storefrontSchemas.js +1 -1
- package/dist/ui/drawer.d.ts +12 -13
- package/dist/ui/drawer.d.ts.map +1 -1
- package/dist/ui/drawer.js +119 -143
- package/package.json +1 -1
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { pickBookingSearchParams as e } from "../lib/booking.js";
|
|
2
2
|
import { useStorefrontCart as t } from "../lib/cart.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
3
|
+
import { CHECKOUT_BOOKING_NUMBER_SEARCH_PARAM as n, addCheckoutBookingNumberToPath as r, getCheckoutBookingNumberFromSearchParams as i } from "../lib/checkoutSubmit.js";
|
|
4
|
+
import { Button as a } from "../ui/button.js";
|
|
5
|
+
import { toast as o } from "../lib/toast.js";
|
|
6
|
+
import { Card as s } from "../ui/card.js";
|
|
7
|
+
import { apiPost as ee } from "../lib/apiCall.js";
|
|
8
|
+
import { Spinner as c } from "../chunks/pkg/ui/dist/Spinner/index-Cgi70z_E.js";
|
|
9
|
+
import { ROUTE as te, responseSchema as ne } from "../lib/checkoutPaymentSession.js";
|
|
10
|
+
import { MollieCardFieldsForm as re } from "../components/payment/MollieCardFieldsForm.js";
|
|
11
|
+
import { StripeCardFieldsForm as l } from "../components/payment/StripeCardFieldsForm.js";
|
|
11
12
|
import "../components/payment/index.js";
|
|
12
|
-
import { useEffect as
|
|
13
|
-
import { jsx as
|
|
14
|
-
import { Link as
|
|
15
|
-
import { useTranslation as
|
|
16
|
-
import { AlertTriangle as
|
|
17
|
-
import { loadStripe as
|
|
18
|
-
import { Elements as
|
|
19
|
-
var
|
|
13
|
+
import { useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
14
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
15
|
+
import { Link as g, useNavigate as ie, useParams as ae, useSearchParams as oe } from "@rpcbase/router";
|
|
16
|
+
import { useTranslation as _ } from "react-i18next";
|
|
17
|
+
import { AlertTriangle as v, ArrowRight as se, CheckCircle2 as ce, CircleDashed as le, ShieldCheck as ue, XCircle as de } from "lucide-react";
|
|
18
|
+
import { loadStripe as fe } from "@stripe/stripe-js";
|
|
19
|
+
import { Elements as pe, useStripe as y } from "@stripe/react-stripe-js";
|
|
20
|
+
var me = {
|
|
20
21
|
BASE_URL: "/",
|
|
21
22
|
DEV: !1,
|
|
22
23
|
MODE: "production",
|
|
23
24
|
PROD: !0,
|
|
24
25
|
SSR: !1
|
|
25
|
-
}.RB_PUBLIC_STRIPE_PUBLISHABLE_KEY?.trim() ?? "",
|
|
26
|
+
}.RB_PUBLIC_STRIPE_PUBLISHABLE_KEY?.trim() ?? "", he = 20, b = 2500, x = (e, t, n) => {
|
|
26
27
|
try {
|
|
27
28
|
return new Intl.NumberFormat(n, {
|
|
28
29
|
style: "currency",
|
|
@@ -32,9 +33,9 @@ var de = {
|
|
|
32
33
|
return `${(e / 100).toFixed(2)} ${t.toUpperCase()}`;
|
|
33
34
|
}
|
|
34
35
|
};
|
|
35
|
-
function
|
|
36
|
-
let { t: n } =
|
|
37
|
-
return /* @__PURE__ */
|
|
36
|
+
function ge({ clientSecret: e, onSuccess: t }) {
|
|
37
|
+
let { t: n } = _(), r = y();
|
|
38
|
+
return /* @__PURE__ */ m(l, {
|
|
38
39
|
requireEmail: !1,
|
|
39
40
|
submitLabel: n("checkout_payment_authorize_button"),
|
|
40
41
|
submittingLabel: n("checkout_payment_authorizing_button"),
|
|
@@ -48,313 +49,313 @@ function x({ clientSecret: e, onSuccess: t }) {
|
|
|
48
49
|
}
|
|
49
50
|
});
|
|
50
51
|
}
|
|
51
|
-
function
|
|
52
|
-
let { t: e } =
|
|
53
|
-
return /* @__PURE__ */
|
|
52
|
+
function _e() {
|
|
53
|
+
let { t: e } = _();
|
|
54
|
+
return /* @__PURE__ */ h("div", {
|
|
54
55
|
className: "flex min-h-48 items-center justify-center gap-2 text-sm text-slate-600",
|
|
55
|
-
children: [/* @__PURE__ */
|
|
56
|
+
children: [/* @__PURE__ */ m(c, {
|
|
56
57
|
className: "size-4",
|
|
57
58
|
"aria-hidden": "true"
|
|
58
|
-
}), /* @__PURE__ */
|
|
59
|
+
}), /* @__PURE__ */ m("span", { children: e("secure_payment_link.form.loading_session") })]
|
|
59
60
|
});
|
|
60
61
|
}
|
|
61
|
-
function
|
|
62
|
-
let { t:
|
|
63
|
-
V.
|
|
64
|
-
let H =
|
|
65
|
-
if (!
|
|
66
|
-
let t = await
|
|
67
|
-
storeSlug:
|
|
68
|
-
checkoutSessionId:
|
|
62
|
+
function S() {
|
|
63
|
+
let { t: l, i18n: y } = _(), { storeSlug: S } = ae(), C = ie(), { clear: w, clearCheckoutSession: T } = t(), [E] = oe(), [D, O] = p(null), [ve, k] = p(!0), [A, j] = p(null), [ye, M] = p(0), [N, P] = p(0), F = f(!1), I = f(null), L = E.get("checkout_session_id")?.trim() ?? "", R = e(E), z = R.toString(), B = i(E), V = new URLSearchParams(R);
|
|
64
|
+
B && V.set(n, B);
|
|
65
|
+
let H = V.toString(), U = `/${S ?? ""}/checkout${z ? `?${z}` : ""}`, W = `/${S ?? ""}/checkout/success${H ? `?${H}` : ""}`, G = async (e) => {
|
|
66
|
+
if (!S || !L) throw Error(l("checkout_payment_return_missing_session"));
|
|
67
|
+
let t = await ee(te, {
|
|
68
|
+
storeSlug: S,
|
|
69
|
+
checkoutSessionId: L,
|
|
69
70
|
returnSearch: H || void 0,
|
|
70
71
|
cardToken: e
|
|
71
72
|
});
|
|
72
|
-
return
|
|
73
|
-
}, K = async () => {
|
|
74
|
-
|
|
73
|
+
return ne.parse(t);
|
|
74
|
+
}, K = async (e) => {
|
|
75
|
+
F.current || (F.current = !0, o.success(l("checkout_success_toast")), await C(r(W, e?.payment?.reference), { replace: !0 }), w());
|
|
75
76
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}, [
|
|
79
|
-
if (!
|
|
80
|
-
|
|
77
|
+
u(() => {
|
|
78
|
+
F.current = !1, I.current = null, O(null), k(!0), P(0);
|
|
79
|
+
}, [L]), u(() => {
|
|
80
|
+
if (!S || !L) {
|
|
81
|
+
I.current = null, O(null), j(l("checkout_payment_return_missing_session")), k(!1);
|
|
81
82
|
return;
|
|
82
83
|
}
|
|
83
|
-
let e = !1, t =
|
|
84
|
-
return
|
|
84
|
+
let e = !1, t = I.current === null;
|
|
85
|
+
return k(t), j(null), (async () => {
|
|
85
86
|
try {
|
|
86
87
|
let t = await G();
|
|
87
88
|
if (e) return;
|
|
88
89
|
if (!t.success) {
|
|
89
|
-
t.canRetryCheckout &&
|
|
90
|
+
t.canRetryCheckout && T(), I.current = null, O(null), j(t.message || l("checkout_payment_return_status_error"));
|
|
90
91
|
return;
|
|
91
92
|
}
|
|
92
|
-
|
|
93
|
+
I.current = t, O(t);
|
|
93
94
|
let n = t.paymentStatus;
|
|
94
|
-
(n === "cancelled" || n === "failed" && t.providerType === "mollie_connect_oauth") &&
|
|
95
|
+
(n === "cancelled" || n === "failed" && t.providerType === "mollie_connect_oauth") && T(), (n === "authorized" || n === "succeeded") && !F.current && await K(t);
|
|
95
96
|
} catch (t) {
|
|
96
97
|
if (e) return;
|
|
97
|
-
console.error("Failed to fetch checkout payment session", t),
|
|
98
|
+
console.error("Failed to fetch checkout payment session", t), I.current = null, O(null), j(l("checkout_payment_return_status_error"));
|
|
98
99
|
} finally {
|
|
99
|
-
!e && t &&
|
|
100
|
+
!e && t && k(!1);
|
|
100
101
|
}
|
|
101
102
|
})(), () => {
|
|
102
103
|
e = !0;
|
|
103
104
|
};
|
|
104
105
|
}, [
|
|
105
|
-
|
|
106
|
-
T,
|
|
107
|
-
E,
|
|
106
|
+
L,
|
|
108
107
|
w,
|
|
109
|
-
|
|
110
|
-
P,
|
|
108
|
+
T,
|
|
111
109
|
C,
|
|
110
|
+
ye,
|
|
111
|
+
H,
|
|
112
|
+
S,
|
|
112
113
|
W,
|
|
113
|
-
|
|
114
|
+
l
|
|
114
115
|
]);
|
|
115
|
-
let q =
|
|
116
|
-
|
|
117
|
-
if (q !== "pending" ||
|
|
116
|
+
let q = D?.paymentStatus ?? "pending", J = q === "pending" && D?.providerType === "stripe_connect_oauth" && D.payment?.status.trim().toLowerCase() === "processing";
|
|
117
|
+
u(() => {
|
|
118
|
+
if (q !== "pending" || D?.providerType === "stripe_connect_oauth" && !J || N >= he || !D?.payment?.providerPaymentId) return;
|
|
118
119
|
let e = window.setTimeout(() => {
|
|
119
|
-
|
|
120
|
-
},
|
|
120
|
+
P((e) => e + 1), M((e) => e + 1);
|
|
121
|
+
}, b);
|
|
121
122
|
return () => {
|
|
122
123
|
window.clearTimeout(e);
|
|
123
124
|
};
|
|
124
125
|
}, [
|
|
125
126
|
q,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
N,
|
|
128
|
+
D?.payment?.providerPaymentId,
|
|
129
|
+
D?.providerType,
|
|
129
130
|
J
|
|
130
131
|
]);
|
|
131
|
-
let Y =
|
|
132
|
-
let e =
|
|
133
|
-
return !e || !
|
|
134
|
-
}, [
|
|
135
|
-
if (
|
|
136
|
-
}, [
|
|
137
|
-
if (!
|
|
132
|
+
let Y = d(() => {
|
|
133
|
+
let e = D?.stripePublishableKey?.trim() || me;
|
|
134
|
+
return !e || !D?.providerAccountId ? null : fe(e, { stripeAccount: D.providerAccountId });
|
|
135
|
+
}, [D?.providerAccountId, D?.stripePublishableKey]), X = d(() => {
|
|
136
|
+
if (D?.clientSecret) return { clientSecret: D.clientSecret };
|
|
137
|
+
}, [D?.clientSecret]);
|
|
138
|
+
if (!L) return /* @__PURE__ */ m("div", {
|
|
138
139
|
className: "mx-auto max-w-3xl px-4 py-14 sm:px-6",
|
|
139
|
-
children: /* @__PURE__ */
|
|
140
|
+
children: /* @__PURE__ */ m(s, {
|
|
140
141
|
className: "border-destructive/25 bg-white p-5 sm:p-6 shadow-sm",
|
|
141
|
-
children: /* @__PURE__ */
|
|
142
|
+
children: /* @__PURE__ */ h("div", {
|
|
142
143
|
className: "space-y-4",
|
|
143
|
-
children: [/* @__PURE__ */
|
|
144
|
+
children: [/* @__PURE__ */ h("div", {
|
|
144
145
|
className: "flex items-start gap-3",
|
|
145
|
-
children: [/* @__PURE__ */
|
|
146
|
+
children: [/* @__PURE__ */ m(v, {
|
|
146
147
|
className: "mt-0.5 h-5 w-5 text-destructive",
|
|
147
148
|
"aria-hidden": "true"
|
|
148
|
-
}), /* @__PURE__ */
|
|
149
|
+
}), /* @__PURE__ */ m("p", {
|
|
149
150
|
className: "text-sm text-slate-700",
|
|
150
|
-
children: /* @__PURE__ */
|
|
151
|
+
children: /* @__PURE__ */ m("span", { children: l("checkout_payment_return_missing_session") })
|
|
151
152
|
})]
|
|
152
|
-
}), /* @__PURE__ */
|
|
153
|
+
}), /* @__PURE__ */ m(g, {
|
|
153
154
|
to: U,
|
|
154
|
-
children: /* @__PURE__ */
|
|
155
|
+
children: /* @__PURE__ */ m(a, {
|
|
155
156
|
variant: "outline",
|
|
156
|
-
children: /* @__PURE__ */
|
|
157
|
+
children: /* @__PURE__ */ m("span", { children: l("checkout_payment_return_back_to_checkout") })
|
|
157
158
|
})
|
|
158
159
|
})]
|
|
159
160
|
})
|
|
160
161
|
})
|
|
161
162
|
});
|
|
162
|
-
if (
|
|
163
|
+
if (ve && !D) return /* @__PURE__ */ m("div", {
|
|
163
164
|
className: "mx-auto max-w-3xl px-4 py-14 sm:px-6",
|
|
164
|
-
children: /* @__PURE__ */
|
|
165
|
+
children: /* @__PURE__ */ m(s, {
|
|
165
166
|
className: "border-slate-200 bg-white p-5 sm:p-6 shadow-sm",
|
|
166
|
-
children: /* @__PURE__ */
|
|
167
|
+
children: /* @__PURE__ */ m(_e, {})
|
|
167
168
|
})
|
|
168
169
|
});
|
|
169
|
-
if (
|
|
170
|
+
if (A || !D) return /* @__PURE__ */ m("div", {
|
|
170
171
|
className: "mx-auto max-w-3xl px-4 py-14 sm:px-6",
|
|
171
|
-
children: /* @__PURE__ */
|
|
172
|
+
children: /* @__PURE__ */ m(s, {
|
|
172
173
|
className: "border-destructive/25 bg-white p-5 sm:p-6 shadow-sm",
|
|
173
|
-
children: /* @__PURE__ */
|
|
174
|
+
children: /* @__PURE__ */ h("div", {
|
|
174
175
|
className: "space-y-4",
|
|
175
|
-
children: [/* @__PURE__ */
|
|
176
|
+
children: [/* @__PURE__ */ h("div", {
|
|
176
177
|
className: "flex items-start gap-3",
|
|
177
|
-
children: [/* @__PURE__ */
|
|
178
|
+
children: [/* @__PURE__ */ m(v, {
|
|
178
179
|
className: "mt-0.5 h-5 w-5 text-destructive",
|
|
179
180
|
"aria-hidden": "true"
|
|
180
|
-
}), /* @__PURE__ */
|
|
181
|
+
}), /* @__PURE__ */ m("p", {
|
|
181
182
|
className: "text-sm text-slate-700",
|
|
182
|
-
children: /* @__PURE__ */
|
|
183
|
+
children: /* @__PURE__ */ m("span", { children: A ?? l("checkout_payment_return_status_error") })
|
|
183
184
|
})]
|
|
184
|
-
}), /* @__PURE__ */
|
|
185
|
+
}), /* @__PURE__ */ m(g, {
|
|
185
186
|
to: U,
|
|
186
|
-
children: /* @__PURE__ */
|
|
187
|
+
children: /* @__PURE__ */ m(a, {
|
|
187
188
|
variant: "outline",
|
|
188
|
-
children: /* @__PURE__ */
|
|
189
|
+
children: /* @__PURE__ */ m("span", { children: l("checkout_payment_return_back_to_checkout") })
|
|
189
190
|
})
|
|
190
191
|
})]
|
|
191
192
|
})
|
|
192
193
|
})
|
|
193
194
|
});
|
|
194
|
-
let Z = typeof
|
|
195
|
-
return /* @__PURE__ */
|
|
195
|
+
let Z = typeof D.amountMinor == "number" && D.currency ? x(D.amountMinor, D.currency, y.language) : null, Q = q === "authorized" || q === "succeeded", $ = q === "failed" || q === "cancelled", be = Q ? ce : $ ? de : le, xe = Q ? "text-success" : $ ? "text-destructive" : "text-warning";
|
|
196
|
+
return /* @__PURE__ */ m("div", {
|
|
196
197
|
className: "mx-auto max-w-5xl px-4 py-10 sm:px-6",
|
|
197
|
-
children: /* @__PURE__ */
|
|
198
|
+
children: /* @__PURE__ */ h("div", {
|
|
198
199
|
className: "grid gap-6 lg:grid-cols-[1fr_1fr]",
|
|
199
|
-
children: [/* @__PURE__ */
|
|
200
|
+
children: [/* @__PURE__ */ m(s, {
|
|
200
201
|
className: "border-slate-200 bg-white p-5 shadow-sm",
|
|
201
|
-
children: /* @__PURE__ */
|
|
202
|
+
children: /* @__PURE__ */ h("div", {
|
|
202
203
|
className: "space-y-5",
|
|
203
204
|
children: [
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ h("div", {
|
|
205
206
|
className: "inline-flex items-center gap-2 rounded-full border border-success-border bg-success-subtle px-3 py-1 text-xs font-medium text-success",
|
|
206
|
-
children: [/* @__PURE__ */
|
|
207
|
+
children: [/* @__PURE__ */ m(ue, {
|
|
207
208
|
className: "h-3.5 w-3.5",
|
|
208
209
|
"aria-hidden": "true"
|
|
209
|
-
}), /* @__PURE__ */
|
|
210
|
+
}), /* @__PURE__ */ m("span", { children: l("secure_payment_link.secured_badge") })]
|
|
210
211
|
}),
|
|
211
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h1", {
|
|
212
213
|
className: "text-2xl font-semibold tracking-tight text-slate-950",
|
|
213
|
-
children: /* @__PURE__ */
|
|
214
|
-
}), /* @__PURE__ */
|
|
214
|
+
children: /* @__PURE__ */ m("span", { children: l("checkout_payment_title") })
|
|
215
|
+
}), /* @__PURE__ */ m("p", {
|
|
215
216
|
className: "mt-2 text-sm text-slate-600",
|
|
216
|
-
children: /* @__PURE__ */
|
|
217
|
+
children: /* @__PURE__ */ m("span", { children: l("checkout_payment_hold_description") })
|
|
217
218
|
})] }),
|
|
218
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ h("dl", {
|
|
219
220
|
className: "grid gap-3 rounded-xl border border-slate-200 bg-slate-50 p-4 text-sm",
|
|
220
|
-
children: [Z ? /* @__PURE__ */
|
|
221
|
+
children: [Z ? /* @__PURE__ */ h("div", {
|
|
221
222
|
className: "flex items-center justify-between gap-3",
|
|
222
|
-
children: [/* @__PURE__ */
|
|
223
|
+
children: [/* @__PURE__ */ m("dt", {
|
|
223
224
|
className: "text-slate-600",
|
|
224
|
-
children: /* @__PURE__ */
|
|
225
|
-
}), /* @__PURE__ */
|
|
225
|
+
children: /* @__PURE__ */ m("span", { children: l("checkout_payment_hold_amount") })
|
|
226
|
+
}), /* @__PURE__ */ m("dd", {
|
|
226
227
|
className: "font-semibold text-slate-950",
|
|
227
|
-
children: /* @__PURE__ */
|
|
228
|
+
children: /* @__PURE__ */ m("span", { children: Z })
|
|
228
229
|
})]
|
|
229
|
-
}) : null,
|
|
230
|
+
}) : null, D.providerType ? /* @__PURE__ */ h("div", {
|
|
230
231
|
className: "flex items-center justify-between gap-3",
|
|
231
|
-
children: [/* @__PURE__ */
|
|
232
|
+
children: [/* @__PURE__ */ m("dt", {
|
|
232
233
|
className: "text-slate-600",
|
|
233
|
-
children: /* @__PURE__ */
|
|
234
|
-
}), /* @__PURE__ */
|
|
234
|
+
children: /* @__PURE__ */ m("span", { children: l("checkout_payment_provider") })
|
|
235
|
+
}), /* @__PURE__ */ m("dd", {
|
|
235
236
|
className: "font-medium text-slate-950",
|
|
236
|
-
children: /* @__PURE__ */
|
|
237
|
+
children: /* @__PURE__ */ m("span", { children: l(`secure_payment_link.providers.${D.providerType}`) })
|
|
237
238
|
})]
|
|
238
239
|
}) : null]
|
|
239
240
|
})
|
|
240
241
|
]
|
|
241
242
|
})
|
|
242
|
-
}), /* @__PURE__ */
|
|
243
|
+
}), /* @__PURE__ */ m(s, {
|
|
243
244
|
className: "border-slate-200 bg-white p-5 shadow-sm",
|
|
244
|
-
children: Q || $ ? /* @__PURE__ */
|
|
245
|
+
children: Q || $ ? /* @__PURE__ */ h("div", {
|
|
245
246
|
className: "space-y-6 text-center",
|
|
246
247
|
children: [
|
|
247
|
-
/* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ m("div", {
|
|
248
249
|
className: "mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-slate-100",
|
|
249
|
-
children: /* @__PURE__ */
|
|
250
|
-
className: `h-6 w-6 ${
|
|
250
|
+
children: /* @__PURE__ */ m(be, {
|
|
251
|
+
className: `h-6 w-6 ${xe}`,
|
|
251
252
|
"aria-hidden": "true"
|
|
252
253
|
})
|
|
253
254
|
}),
|
|
254
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ h("div", {
|
|
255
256
|
className: "space-y-2",
|
|
256
|
-
children: [/* @__PURE__ */
|
|
257
|
+
children: [/* @__PURE__ */ m("h2", {
|
|
257
258
|
className: "text-xl font-semibold text-slate-950",
|
|
258
|
-
children: /* @__PURE__ */
|
|
259
|
-
}), /* @__PURE__ */
|
|
259
|
+
children: /* @__PURE__ */ m("span", { children: l(`secure_payment_link.success_titles.${q}`) })
|
|
260
|
+
}), /* @__PURE__ */ m("p", {
|
|
260
261
|
className: "text-sm text-slate-600",
|
|
261
|
-
children: /* @__PURE__ */
|
|
262
|
+
children: /* @__PURE__ */ m("span", { children: l(`secure_payment_link.statuses.${q}`) })
|
|
262
263
|
})]
|
|
263
264
|
}),
|
|
264
|
-
Q ? /* @__PURE__ */
|
|
265
|
-
to: W,
|
|
266
|
-
children: /* @__PURE__ */
|
|
265
|
+
Q ? /* @__PURE__ */ m(g, {
|
|
266
|
+
to: r(W, D.payment?.reference),
|
|
267
|
+
children: /* @__PURE__ */ h(a, {
|
|
267
268
|
className: "gap-2",
|
|
268
|
-
children: [/* @__PURE__ */
|
|
269
|
+
children: [/* @__PURE__ */ m("span", { children: l("checkout_payment_return_go_to_success") }), /* @__PURE__ */ m(se, {
|
|
269
270
|
className: "h-4 w-4",
|
|
270
271
|
"aria-hidden": "true"
|
|
271
272
|
})]
|
|
272
273
|
})
|
|
273
|
-
}) : /* @__PURE__ */
|
|
274
|
+
}) : /* @__PURE__ */ m(g, {
|
|
274
275
|
to: U,
|
|
275
|
-
children: /* @__PURE__ */
|
|
276
|
+
children: /* @__PURE__ */ m(a, { children: /* @__PURE__ */ m("span", { children: l("checkout_payment_return_retry_checkout") }) })
|
|
276
277
|
})
|
|
277
278
|
]
|
|
278
|
-
}) : J ? /* @__PURE__ */
|
|
279
|
+
}) : J ? /* @__PURE__ */ h("div", {
|
|
279
280
|
className: "flex min-h-48 flex-col items-center justify-center gap-3 text-center",
|
|
280
|
-
children: [/* @__PURE__ */
|
|
281
|
+
children: [/* @__PURE__ */ m(c, {
|
|
281
282
|
className: "size-5 text-warning",
|
|
282
283
|
"aria-hidden": "true"
|
|
283
|
-
}), /* @__PURE__ */
|
|
284
|
+
}), /* @__PURE__ */ h("div", {
|
|
284
285
|
className: "space-y-1",
|
|
285
|
-
children: [/* @__PURE__ */
|
|
286
|
+
children: [/* @__PURE__ */ m("h2", {
|
|
286
287
|
className: "text-lg font-semibold text-slate-950",
|
|
287
|
-
children: /* @__PURE__ */
|
|
288
|
-
}), /* @__PURE__ */
|
|
288
|
+
children: /* @__PURE__ */ m("span", { children: l("secure_payment_link.confirmation_loading_title") })
|
|
289
|
+
}), /* @__PURE__ */ m("p", {
|
|
289
290
|
className: "text-sm text-slate-600",
|
|
290
|
-
children: /* @__PURE__ */
|
|
291
|
+
children: /* @__PURE__ */ m("span", { children: l("secure_payment_link.confirmation_loading_description") })
|
|
291
292
|
})]
|
|
292
293
|
})]
|
|
293
|
-
}) :
|
|
294
|
+
}) : D.providerType === "mollie_connect_oauth" ? /* @__PURE__ */ h("div", {
|
|
294
295
|
className: "space-y-4",
|
|
295
296
|
children: [
|
|
296
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ m("h2", {
|
|
297
298
|
className: "text-lg font-semibold text-slate-950",
|
|
298
|
-
children: /* @__PURE__ */
|
|
299
|
+
children: /* @__PURE__ */ m("span", { children: l("secure_payment_link.mollie.form_title") })
|
|
299
300
|
}),
|
|
300
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ m("p", {
|
|
301
302
|
className: "text-sm text-slate-600",
|
|
302
|
-
children: /* @__PURE__ */
|
|
303
|
+
children: /* @__PURE__ */ m("span", { children: l("checkout_payment_hold_form_description") })
|
|
303
304
|
}),
|
|
304
|
-
|
|
305
|
-
profileId:
|
|
306
|
-
testmode:
|
|
307
|
-
submitLabel:
|
|
308
|
-
submittingLabel:
|
|
305
|
+
D.profileId ? /* @__PURE__ */ m(re, {
|
|
306
|
+
profileId: D.profileId,
|
|
307
|
+
testmode: D.testmode === !0,
|
|
308
|
+
submitLabel: l("checkout_payment_authorize_button"),
|
|
309
|
+
submittingLabel: l("checkout_payment_authorizing_button"),
|
|
309
310
|
onSubmit: async (e) => {
|
|
310
311
|
let t = await G(e);
|
|
311
|
-
if (!t.success) throw t.canRetryCheckout &&
|
|
312
|
-
if (
|
|
313
|
-
await K();
|
|
312
|
+
if (!t.success) throw t.canRetryCheckout && T(), Error(t.message || l("secure_payment_link.errors.payment_failed"));
|
|
313
|
+
if (I.current = t, O(t), t.paymentStatus === "authorized" || t.paymentStatus === "succeeded") {
|
|
314
|
+
await K(t);
|
|
314
315
|
return;
|
|
315
316
|
}
|
|
316
317
|
if (t.paymentStatus === "failed" || t.paymentStatus === "cancelled") {
|
|
317
|
-
|
|
318
|
+
T();
|
|
318
319
|
return;
|
|
319
320
|
}
|
|
320
|
-
if (!t.checkoutUrl) throw Error(t.message ||
|
|
321
|
+
if (!t.checkoutUrl) throw Error(t.message || l("secure_payment_link.errors.mollie_missing_url"));
|
|
321
322
|
let n = new URL(t.checkoutUrl, window.location.origin).toString();
|
|
322
323
|
window.location.assign(n);
|
|
323
324
|
}
|
|
324
|
-
}) : /* @__PURE__ */
|
|
325
|
+
}) : /* @__PURE__ */ m("p", {
|
|
325
326
|
className: "text-sm text-destructive",
|
|
326
|
-
children: /* @__PURE__ */
|
|
327
|
+
children: /* @__PURE__ */ m("span", { children: l("secure_payment_link.errors.session_failed") })
|
|
327
328
|
})
|
|
328
329
|
]
|
|
329
|
-
}) :
|
|
330
|
+
}) : D.providerType === "stripe_connect_oauth" ? !D.clientSecret || !Y || !X ? /* @__PURE__ */ m("p", {
|
|
330
331
|
className: "text-sm text-destructive",
|
|
331
|
-
children: /* @__PURE__ */
|
|
332
|
-
}) : /* @__PURE__ */
|
|
332
|
+
children: /* @__PURE__ */ m("span", { children: l("secure_payment_link.errors.missing_publishable_key") })
|
|
333
|
+
}) : /* @__PURE__ */ m(pe, {
|
|
333
334
|
stripe: Y,
|
|
334
335
|
options: X,
|
|
335
|
-
children: /* @__PURE__ */
|
|
336
|
-
clientSecret:
|
|
336
|
+
children: /* @__PURE__ */ m(ge, {
|
|
337
|
+
clientSecret: D.clientSecret,
|
|
337
338
|
onSuccess: async () => {
|
|
338
339
|
let e = await G();
|
|
339
|
-
if (!e.success) throw e.canRetryCheckout &&
|
|
340
|
-
if (
|
|
341
|
-
await K();
|
|
340
|
+
if (!e.success) throw e.canRetryCheckout && T(), Error(e.message || l("secure_payment_link.errors.payment_failed"));
|
|
341
|
+
if (I.current = e, O(e), e.paymentStatus === "authorized" || e.paymentStatus === "succeeded") {
|
|
342
|
+
await K(e);
|
|
342
343
|
return;
|
|
343
344
|
}
|
|
344
345
|
if (e.paymentStatus === "pending" && e.payment?.status.trim().toLowerCase() === "processing") {
|
|
345
|
-
|
|
346
|
+
P(0);
|
|
346
347
|
return;
|
|
347
348
|
}
|
|
348
|
-
throw Error(e.message ||
|
|
349
|
+
throw Error(e.message || l("secure_payment_link.errors.payment_failed"));
|
|
349
350
|
}
|
|
350
351
|
})
|
|
351
|
-
},
|
|
352
|
+
}, D.clientSecret) : /* @__PURE__ */ m("p", {
|
|
352
353
|
className: "text-sm text-destructive",
|
|
353
|
-
children: /* @__PURE__ */
|
|
354
|
+
children: /* @__PURE__ */ m("span", { children: l("secure_payment_link.errors.session_failed") })
|
|
354
355
|
})
|
|
355
356
|
})]
|
|
356
357
|
})
|
|
357
358
|
});
|
|
358
359
|
}
|
|
359
360
|
//#endregion
|
|
360
|
-
export {
|
|
361
|
+
export { S as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckoutSuccessPage.d.ts","sourceRoot":"","sources":["../../src/pages/CheckoutSuccessPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CheckoutSuccessPage.d.ts","sourceRoot":"","sources":["../../src/pages/CheckoutSuccessPage.tsx"],"names":[],"mappings":"AASA,MAAM,CAAC,OAAO,UAAU,mBAAmB,4CAkD1C"}
|
|
@@ -1,44 +1,56 @@
|
|
|
1
1
|
import { resolveBookingSearchParamsFromSessionStorage as e } from "../lib/booking.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { getCheckoutBookingNumberFromSearchParams as t } from "../lib/checkoutSubmit.js";
|
|
3
|
+
import { Button as n } from "../ui/button.js";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import { Link as a, useParams as o, useSearchParams as s } from "@rpcbase/router";
|
|
6
|
+
import { useTranslation as c } from "react-i18next";
|
|
7
|
+
import { ArrowRight as l, CheckCircle2 as u } from "lucide-react";
|
|
7
8
|
//#region src/pages/CheckoutSuccessPage.tsx
|
|
8
|
-
function
|
|
9
|
-
let { t:
|
|
10
|
-
return /* @__PURE__ */
|
|
9
|
+
function d() {
|
|
10
|
+
let { t: d } = c(), { storeSlug: f } = o(), [p] = s(), m = t(p), h = e(p, f).toString(), g = `/${f ?? ""}/booking${h ? `?${h}` : ""}`, _ = `/${f ?? ""}${h ? `?${h}` : ""}`;
|
|
11
|
+
return /* @__PURE__ */ i("div", {
|
|
11
12
|
className: "mx-auto max-w-3xl px-4 py-14 sm:px-6",
|
|
12
13
|
children: [
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
+
/* @__PURE__ */ r("div", {
|
|
14
15
|
className: "mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-success-subtle text-success",
|
|
15
|
-
children: /* @__PURE__ */
|
|
16
|
+
children: /* @__PURE__ */ r(u, {
|
|
16
17
|
className: "h-6 w-6",
|
|
17
18
|
"aria-hidden": "true"
|
|
18
19
|
})
|
|
19
20
|
}),
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
+
/* @__PURE__ */ r("h1", {
|
|
21
22
|
className: "mt-6 text-center text-2xl font-semibold tracking-tight text-slate-950",
|
|
22
|
-
children: /* @__PURE__ */
|
|
23
|
+
children: /* @__PURE__ */ r("span", { children: d("checkout_success_title") })
|
|
23
24
|
}),
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
className: "
|
|
26
|
-
|
|
25
|
+
m ? /* @__PURE__ */ i("div", {
|
|
26
|
+
className: "mx-auto mt-6 max-w-sm rounded-xl border border-success-border bg-success-subtle px-5 py-4 text-center",
|
|
27
|
+
"data-testid": "checkout-success-booking-number",
|
|
28
|
+
children: [/* @__PURE__ */ r("p", {
|
|
29
|
+
className: "text-sm text-slate-600",
|
|
30
|
+
children: /* @__PURE__ */ r("span", { children: d("checkout_success_booking_number") })
|
|
31
|
+
}), /* @__PURE__ */ r("p", {
|
|
32
|
+
className: "mt-1 font-mono text-xl font-semibold tracking-wide text-slate-950",
|
|
33
|
+
children: /* @__PURE__ */ r("span", { children: m })
|
|
34
|
+
})]
|
|
35
|
+
}) : null,
|
|
36
|
+
/* @__PURE__ */ r("p", {
|
|
37
|
+
className: "mt-3 text-center text-sm text-slate-600",
|
|
38
|
+
children: /* @__PURE__ */ r("span", { children: d("checkout_success_description") })
|
|
27
39
|
}),
|
|
28
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ i("div", {
|
|
29
41
|
className: "mt-8 flex flex-col gap-3 sm:flex-row sm:justify-center",
|
|
30
|
-
children: [/* @__PURE__ */
|
|
31
|
-
to:
|
|
32
|
-
children: /* @__PURE__ */ n
|
|
42
|
+
children: [/* @__PURE__ */ r(a, {
|
|
43
|
+
to: g,
|
|
44
|
+
children: /* @__PURE__ */ r(n, {
|
|
33
45
|
variant: "outline",
|
|
34
46
|
className: "w-full sm:w-auto",
|
|
35
|
-
children: /* @__PURE__ */
|
|
47
|
+
children: /* @__PURE__ */ r("span", { children: d("checkout_success_back_to_products") })
|
|
36
48
|
})
|
|
37
|
-
}), /* @__PURE__ */
|
|
38
|
-
to:
|
|
39
|
-
children: /* @__PURE__ */
|
|
49
|
+
}), /* @__PURE__ */ r(a, {
|
|
50
|
+
to: _,
|
|
51
|
+
children: /* @__PURE__ */ i(n, {
|
|
40
52
|
className: "w-full gap-2 sm:w-auto",
|
|
41
|
-
children: [/* @__PURE__ */
|
|
53
|
+
children: [/* @__PURE__ */ r("span", { children: d("checkout_success_back_home") }), /* @__PURE__ */ r(l, {
|
|
42
54
|
className: "h-4 w-4",
|
|
43
55
|
"aria-hidden": "true"
|
|
44
56
|
})]
|
|
@@ -49,4 +61,4 @@ function u() {
|
|
|
49
61
|
});
|
|
50
62
|
}
|
|
51
63
|
//#endregion
|
|
52
|
-
export {
|
|
64
|
+
export { d as default };
|