@miden-npm/react 2.0.4 → 2.0.6
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/index.cjs +41 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +41 -24
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3022,13 +3022,12 @@ function PayByCard({
|
|
|
3022
3022
|
setIsMakingPayment(false);
|
|
3023
3023
|
return;
|
|
3024
3024
|
}
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
});
|
|
3025
|
+
if (response && response.message) {
|
|
3026
|
+
setMessage(response.message);
|
|
3027
|
+
onError?.({
|
|
3028
|
+
errorMessage: response.message
|
|
3029
|
+
});
|
|
3030
|
+
}
|
|
3032
3031
|
setIsMakingPayment(false);
|
|
3033
3032
|
} catch (err) {
|
|
3034
3033
|
let friendly = "Payment failed";
|
|
@@ -3112,6 +3111,9 @@ function PayByCard({
|
|
|
3112
3111
|
setLoadingCountries(false);
|
|
3113
3112
|
}
|
|
3114
3113
|
};
|
|
3114
|
+
const goBack = () => {
|
|
3115
|
+
setFormIndex(formIndex > 0 ? formIndex - 1 : 0);
|
|
3116
|
+
};
|
|
3115
3117
|
const getStates = async (countryIso2) => {
|
|
3116
3118
|
const country = rawCountries.find((c) => c.iso2 === countryIso2);
|
|
3117
3119
|
if (!country) return;
|
|
@@ -3201,7 +3203,9 @@ function PayByCard({
|
|
|
3201
3203
|
(c) => c.code.toLowerCase() === e.toLowerCase()
|
|
3202
3204
|
)[0];
|
|
3203
3205
|
if (selectedCountry) {
|
|
3204
|
-
setDefaultCountryCode(
|
|
3206
|
+
setDefaultCountryCode(
|
|
3207
|
+
`${selectedCountry.phoneCode}-${selectedCountry.code}`
|
|
3208
|
+
);
|
|
3205
3209
|
}
|
|
3206
3210
|
if (billingErrors.country) {
|
|
3207
3211
|
setBillingErrors((er) => ({ ...er, country: "" }));
|
|
@@ -3257,7 +3261,7 @@ function PayByCard({
|
|
|
3257
3261
|
validationError: billingErrors.postalCode ?? ""
|
|
3258
3262
|
}
|
|
3259
3263
|
),
|
|
3260
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3264
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "col-span-2", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3261
3265
|
BaseInput,
|
|
3262
3266
|
{
|
|
3263
3267
|
label: "Email",
|
|
@@ -3271,12 +3275,13 @@ function PayByCard({
|
|
|
3271
3275
|
},
|
|
3272
3276
|
validationError: billingErrors.emailAddress ?? ""
|
|
3273
3277
|
}
|
|
3274
|
-
),
|
|
3278
|
+
) }),
|
|
3275
3279
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "col-span-2", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3276
3280
|
BasePhoneNumberInput,
|
|
3277
3281
|
{
|
|
3278
3282
|
label: "Phone Number",
|
|
3279
3283
|
required: true,
|
|
3284
|
+
preventPaste: true,
|
|
3280
3285
|
value: billingForm.phoneNumber,
|
|
3281
3286
|
phoneCodeOptions,
|
|
3282
3287
|
defaultCountryCode,
|
|
@@ -3388,18 +3393,30 @@ function PayByCard({
|
|
|
3388
3393
|
]
|
|
3389
3394
|
}
|
|
3390
3395
|
),
|
|
3391
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3396
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center justify-between gap-4 mt-6", children: [
|
|
3397
|
+
formIndex > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3398
|
+
BaseButton,
|
|
3399
|
+
{
|
|
3400
|
+
label: "Previous",
|
|
3401
|
+
type: "secondary",
|
|
3402
|
+
customClass: "w-1/2",
|
|
3403
|
+
caller,
|
|
3404
|
+
onClick: goBack
|
|
3405
|
+
}
|
|
3406
|
+
),
|
|
3407
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3408
|
+
BaseButton,
|
|
3409
|
+
{
|
|
3410
|
+
label: formIndex === 0 ? "Proceed" : `Pay ${formatAmountHandler}`,
|
|
3411
|
+
type: "primary",
|
|
3412
|
+
customClass: `${formIndex > 0 ? "w-1/2" : "w-full"}`,
|
|
3413
|
+
caller,
|
|
3414
|
+
loading: isMakingPayment,
|
|
3415
|
+
onClick: proceedHandler,
|
|
3416
|
+
disabled: isMakingPayment
|
|
3417
|
+
}
|
|
3418
|
+
)
|
|
3419
|
+
] })
|
|
3403
3420
|
] });
|
|
3404
3421
|
}
|
|
3405
3422
|
|
|
@@ -4630,7 +4647,7 @@ function MidenCheckoutCard({
|
|
|
4630
4647
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
4631
4648
|
"div",
|
|
4632
4649
|
{
|
|
4633
|
-
className: checkoutState === "SUCCESS" ? "col-span-3" : "col-span-2",
|
|
4650
|
+
className: checkoutState === "SUCCESS" || checkoutState === "USED" && paymentType === "BANK_TRANSFER" ? "col-span-3" : "col-span-2",
|
|
4634
4651
|
children: [
|
|
4635
4652
|
checkoutState === "PENDING" && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center justify-between p-6", children: [
|
|
4636
4653
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(IconMidenLogo, {}),
|
|
@@ -4679,7 +4696,7 @@ function MidenCheckoutCard({
|
|
|
4679
4696
|
}
|
|
4680
4697
|
) })
|
|
4681
4698
|
] }),
|
|
4682
|
-
checkoutState === "SUCCESS" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4699
|
+
checkoutState === "SUCCESS" || checkoutState === "USED" && paymentType === "BANK_TRANSFER" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4683
4700
|
BaseSuccess,
|
|
4684
4701
|
{
|
|
4685
4702
|
amount: paymentObject.amount,
|