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