@lmnto/h-mall-shared 1.0.12 → 1.0.14
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/package.json
CHANGED
|
@@ -26,6 +26,8 @@ export type RequestProcessingWithCancelConfirmProps = {
|
|
|
26
26
|
confirmBeforeClose?: boolean;
|
|
27
27
|
/** Called when the user confirms leaving the payment flow (e.g. navigate home). */
|
|
28
28
|
onConfirmLeavePayment?: () => void;
|
|
29
|
+
/** Optional copy variant for cancel confirmation dialog. Defaults to nowpayments wording. */
|
|
30
|
+
cancelConfirmVariant?: "nowpayments" | "stripe";
|
|
29
31
|
};
|
|
30
32
|
|
|
31
33
|
/**
|
|
@@ -41,9 +43,11 @@ export function RequestProcessingWithCancelConfirm({
|
|
|
41
43
|
paymentDetails,
|
|
42
44
|
confirmBeforeClose,
|
|
43
45
|
onConfirmLeavePayment,
|
|
46
|
+
cancelConfirmVariant = "nowpayments",
|
|
44
47
|
}: RequestProcessingWithCancelConfirmProps) {
|
|
45
48
|
const scopeT = _useScopedI18n("payment.requestProcessingDialog");
|
|
46
49
|
const cancelT = _useScopedI18n("payment.cancelPaymentConfirm");
|
|
50
|
+
const stripeCancelT = _useScopedI18n("payment.cancelPaymentConfirmStripe");
|
|
47
51
|
const hasPaymentDetails = Boolean(paymentDetails);
|
|
48
52
|
const [cancelConfirmOpen, setCancelConfirmOpen] = useState(false);
|
|
49
53
|
|
|
@@ -69,6 +73,8 @@ export function RequestProcessingWithCancelConfirm({
|
|
|
69
73
|
setCancelConfirmOpen(false);
|
|
70
74
|
}, []);
|
|
71
75
|
|
|
76
|
+
const isStripeVariant = cancelConfirmVariant === "stripe";
|
|
77
|
+
|
|
72
78
|
return (
|
|
73
79
|
<>
|
|
74
80
|
<Dialog
|
|
@@ -200,21 +206,31 @@ export function RequestProcessingWithCancelConfirm({
|
|
|
200
206
|
variant="h4"
|
|
201
207
|
className="text-base md:text-xl font-semibold text-black-500"
|
|
202
208
|
>
|
|
203
|
-
{cancelT("title")}
|
|
209
|
+
{isStripeVariant ? stripeCancelT("title") : cancelT("title")}
|
|
204
210
|
</Typography>
|
|
205
211
|
<ul className="list-disc space-y-3 pl-5 text-sm leading-relaxed text-slate-600 marker:text-slate-500">
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
<li>{
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
212
|
+
{isStripeVariant ? (
|
|
213
|
+
<>
|
|
214
|
+
<li>{stripeCancelT("item1")}</li>
|
|
215
|
+
<li>{stripeCancelT("item2")}</li>
|
|
216
|
+
<li>{stripeCancelT("item3")}</li>
|
|
217
|
+
</>
|
|
218
|
+
) : (
|
|
219
|
+
<>
|
|
220
|
+
<li>{cancelT("completedItem")}</li>
|
|
221
|
+
<li>
|
|
222
|
+
<span className="block">{cancelT("notSentIntro")}</span>
|
|
223
|
+
<ul className="mt-2 list-[circle] space-y-2 pl-5 marker:text-slate-400">
|
|
224
|
+
<li>{cancelT("notSentSub1")}</li>
|
|
225
|
+
<li>{cancelT("notSentSub2")}</li>
|
|
226
|
+
<li>{cancelT("notSentSub3")}</li>
|
|
227
|
+
</ul>
|
|
228
|
+
</li>
|
|
229
|
+
</>
|
|
230
|
+
)}
|
|
215
231
|
</ul>
|
|
216
232
|
<Typography className="text-sm leading-relaxed text-slate-600">
|
|
217
|
-
{cancelT("closing")}
|
|
233
|
+
{isStripeVariant ? stripeCancelT("closing") : cancelT("closing")}
|
|
218
234
|
</Typography>
|
|
219
235
|
</DialogBody>
|
|
220
236
|
<DialogFooter className="flex flex-col-reverse gap-2 p-0 pt-2 sm:flex-row sm:justify-end">
|
|
@@ -224,10 +240,10 @@ export function RequestProcessingWithCancelConfirm({
|
|
|
224
240
|
className="normal-case rounded-xl border-slate-300 px-4 py-2.5 text-sm font-semibold text-slate-700 shadow-sm hover:border-slate-400 hover:bg-slate-50"
|
|
225
241
|
onClick={handleStayOnPayment}
|
|
226
242
|
>
|
|
227
|
-
{cancelT("stayBtn")}
|
|
243
|
+
{isStripeVariant ? stripeCancelT("stayBtn") : cancelT("stayBtn")}
|
|
228
244
|
</Button>
|
|
229
245
|
<ButtonCustom icon={undefined} onClick={handleConfirmLeave}>
|
|
230
|
-
{cancelT("leaveBtn")}
|
|
246
|
+
{isStripeVariant ? stripeCancelT("leaveBtn") : cancelT("leaveBtn")}
|
|
231
247
|
</ButtonCustom>
|
|
232
248
|
</DialogFooter>
|
|
233
249
|
</Dialog>
|
|
@@ -364,6 +364,19 @@ export default {
|
|
|
364
364
|
stayBtn: "Stay and pay",
|
|
365
365
|
leaveBtn: "Leave without paying",
|
|
366
366
|
},
|
|
367
|
+
cancelPaymentConfirmStripe: {
|
|
368
|
+
title: "Leave card payment?",
|
|
369
|
+
item1:
|
|
370
|
+
"If your card was declined, no funds were captured and you can retry with another card.",
|
|
371
|
+
item2:
|
|
372
|
+
"If authentication is still pending (e.g. 3D Secure), leaving now may interrupt payment completion.",
|
|
373
|
+
item3:
|
|
374
|
+
"You can return to checkout anytime to complete payment for this order.",
|
|
375
|
+
closing:
|
|
376
|
+
"If you are unsure whether payment went through, check your order status before trying again.",
|
|
377
|
+
stayBtn: "Stay and complete payment",
|
|
378
|
+
leaveBtn: "Leave checkout",
|
|
379
|
+
},
|
|
367
380
|
paybyWalletItemComponent: {
|
|
368
381
|
insufficientBalanceMsg: "Insufficient wallet balance. Please recharge.",
|
|
369
382
|
avlBalance: "Avl Balance",
|
|
@@ -353,6 +353,19 @@ export default {
|
|
|
353
353
|
stayBtn: "Resta e paga",
|
|
354
354
|
leaveBtn: "Esci senza pagare",
|
|
355
355
|
},
|
|
356
|
+
cancelPaymentConfirmStripe: {
|
|
357
|
+
title: "Vuoi uscire dal pagamento con carta?",
|
|
358
|
+
item1:
|
|
359
|
+
"Se la carta è stata rifiutata, non è stato addebitato alcun importo e puoi riprovare con un'altra carta.",
|
|
360
|
+
item2:
|
|
361
|
+
"Se l'autenticazione è ancora in corso (es. 3D Secure), uscire ora può interrompere il completamento del pagamento.",
|
|
362
|
+
item3:
|
|
363
|
+
"Puoi tornare al checkout in qualsiasi momento per completare il pagamento di questo ordine.",
|
|
364
|
+
closing:
|
|
365
|
+
"Se non sei sicuro che il pagamento sia andato a buon fine, controlla lo stato dell'ordine prima di riprovare.",
|
|
366
|
+
stayBtn: "Resta e completa il pagamento",
|
|
367
|
+
leaveBtn: "Esci dal checkout",
|
|
368
|
+
},
|
|
356
369
|
paybyWalletItemComponent: {
|
|
357
370
|
insufficientBalanceMsg:
|
|
358
371
|
"Saldo del portafoglio insufficiente. Si prega di ricaricare.",
|