@miden-npm/react 2.0.1 → 2.0.3
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 +17 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +17 -21
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -49,6 +49,7 @@ interface IPaymentObject {
|
|
|
49
49
|
phoneNumber: string;
|
|
50
50
|
narration: string;
|
|
51
51
|
redirectUrl?: string;
|
|
52
|
+
logoUrl?: string;
|
|
52
53
|
}
|
|
53
54
|
interface ISuccessObject {
|
|
54
55
|
paymentDate: string | null;
|
|
@@ -98,7 +99,6 @@ interface CheckoutIframeStyle$1 {
|
|
|
98
99
|
[cssProp: string]: string | number;
|
|
99
100
|
}
|
|
100
101
|
interface CheckoutCardOptions$1 {
|
|
101
|
-
imageUrl?: string;
|
|
102
102
|
numberPlaceholder?: string;
|
|
103
103
|
expiryPlaceholder?: string;
|
|
104
104
|
cvcPlaceholder?: string;
|
|
@@ -116,7 +116,7 @@ interface IBzpCheckoutCardProps {
|
|
|
116
116
|
onPaymentAuthorized?: (data: ISuccessObject) => void;
|
|
117
117
|
onError?: (error: IErrorObject) => void;
|
|
118
118
|
}
|
|
119
|
-
declare function BzpCheckoutCard({ secretKey,
|
|
119
|
+
declare function BzpCheckoutCard({ secretKey, environment, paymentObject, onPaymentAuthorized, onError, }: IBzpCheckoutCardProps): react_jsx_runtime.JSX.Element;
|
|
120
120
|
|
|
121
121
|
interface IMidenCheckoutButtonProps {
|
|
122
122
|
secretKey: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ interface IPaymentObject {
|
|
|
49
49
|
phoneNumber: string;
|
|
50
50
|
narration: string;
|
|
51
51
|
redirectUrl?: string;
|
|
52
|
+
logoUrl?: string;
|
|
52
53
|
}
|
|
53
54
|
interface ISuccessObject {
|
|
54
55
|
paymentDate: string | null;
|
|
@@ -98,7 +99,6 @@ interface CheckoutIframeStyle$1 {
|
|
|
98
99
|
[cssProp: string]: string | number;
|
|
99
100
|
}
|
|
100
101
|
interface CheckoutCardOptions$1 {
|
|
101
|
-
imageUrl?: string;
|
|
102
102
|
numberPlaceholder?: string;
|
|
103
103
|
expiryPlaceholder?: string;
|
|
104
104
|
cvcPlaceholder?: string;
|
|
@@ -116,7 +116,7 @@ interface IBzpCheckoutCardProps {
|
|
|
116
116
|
onPaymentAuthorized?: (data: ISuccessObject) => void;
|
|
117
117
|
onError?: (error: IErrorObject) => void;
|
|
118
118
|
}
|
|
119
|
-
declare function BzpCheckoutCard({ secretKey,
|
|
119
|
+
declare function BzpCheckoutCard({ secretKey, environment, paymentObject, onPaymentAuthorized, onError, }: IBzpCheckoutCardProps): react_jsx_runtime.JSX.Element;
|
|
120
120
|
|
|
121
121
|
interface IMidenCheckoutButtonProps {
|
|
122
122
|
secretKey: string;
|
package/dist/index.js
CHANGED
|
@@ -2257,7 +2257,7 @@ function BzpCheckoutIframe({
|
|
|
2257
2257
|
email: "",
|
|
2258
2258
|
phoneNumber: "",
|
|
2259
2259
|
narration: "",
|
|
2260
|
-
redirectUrl: "
|
|
2260
|
+
redirectUrl: ""
|
|
2261
2261
|
},
|
|
2262
2262
|
onError
|
|
2263
2263
|
}) {
|
|
@@ -2344,7 +2344,7 @@ function BzpCheckoutButton({
|
|
|
2344
2344
|
email: "",
|
|
2345
2345
|
phoneNumber: "",
|
|
2346
2346
|
narration: "",
|
|
2347
|
-
redirectUrl: "
|
|
2347
|
+
redirectUrl: ""
|
|
2348
2348
|
},
|
|
2349
2349
|
mode = "redirect",
|
|
2350
2350
|
onError
|
|
@@ -2518,7 +2518,7 @@ function PayByCard({
|
|
|
2518
2518
|
setIsMakingPayment(true);
|
|
2519
2519
|
setMessage("");
|
|
2520
2520
|
const cardDetails = {
|
|
2521
|
-
pan: payForm.cardNo
|
|
2521
|
+
pan: payForm.cardNo ? payForm.cardNo.replace(/ /g, "") : "",
|
|
2522
2522
|
expiryDate: payForm.expireDate ?? "",
|
|
2523
2523
|
cvv: payForm.cvv ?? "",
|
|
2524
2524
|
cardScheme: cardType,
|
|
@@ -2546,7 +2546,7 @@ function PayByCard({
|
|
|
2546
2546
|
narration: paymentObject?.narration || "Test transaction",
|
|
2547
2547
|
encryptedCardDetails: encryptedCardDetails.requestParam,
|
|
2548
2548
|
billingDetails,
|
|
2549
|
-
redirectUrl: paymentObject?.redirectUrl || "",
|
|
2549
|
+
redirectUrl: paymentObject?.redirectUrl || "https://sandbox-merchant.buzapay.com/account/three-ds-status",
|
|
2550
2550
|
paymentReference: transactionReference,
|
|
2551
2551
|
isCheckout: true
|
|
2552
2552
|
};
|
|
@@ -2569,7 +2569,6 @@ function PayByCard({
|
|
|
2569
2569
|
}
|
|
2570
2570
|
const request = caller === "buzapay" ? { ...payload, merchantId: secretKey } : { ...payloadMiden, merchantId: secretKey };
|
|
2571
2571
|
let response = await authorizeCardPayment(environment, request, caller);
|
|
2572
|
-
debugger;
|
|
2573
2572
|
if (response?.responseParam) {
|
|
2574
2573
|
response = decryptPayload(environment, response.responseParam);
|
|
2575
2574
|
}
|
|
@@ -3772,7 +3771,6 @@ var PayByStableCoin = ({
|
|
|
3772
3771
|
import { jsx as jsx38, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3773
3772
|
function BzpCheckoutCard({
|
|
3774
3773
|
secretKey,
|
|
3775
|
-
options,
|
|
3776
3774
|
environment = "sandbox",
|
|
3777
3775
|
paymentObject = {
|
|
3778
3776
|
merchantName: "",
|
|
@@ -3780,8 +3778,7 @@ function BzpCheckoutCard({
|
|
|
3780
3778
|
currency: "",
|
|
3781
3779
|
email: "",
|
|
3782
3780
|
phoneNumber: "",
|
|
3783
|
-
narration: ""
|
|
3784
|
-
redirectUrl: "https://sandbox-merchant.buzapay.com/account/three-ds-status"
|
|
3781
|
+
narration: ""
|
|
3785
3782
|
},
|
|
3786
3783
|
onPaymentAuthorized,
|
|
3787
3784
|
onError
|
|
@@ -3816,23 +3813,23 @@ function BzpCheckoutCard({
|
|
|
3816
3813
|
onPaymentAuthorized?.(event);
|
|
3817
3814
|
};
|
|
3818
3815
|
useEffect6(() => {
|
|
3819
|
-
let
|
|
3816
|
+
let options = [];
|
|
3820
3817
|
if (paymentObject.currency === "USD") {
|
|
3821
3818
|
if (paymentObject.amount < 50) {
|
|
3822
|
-
|
|
3819
|
+
options = paymentTypeOptions.filter(
|
|
3823
3820
|
(option) => option.value !== "BANK_TRANSFER" && option.value !== "STABLE_COIN"
|
|
3824
3821
|
);
|
|
3825
3822
|
} else {
|
|
3826
|
-
|
|
3823
|
+
options = paymentTypeOptions.filter(
|
|
3827
3824
|
(option) => option.value !== "BANK_TRANSFER"
|
|
3828
3825
|
);
|
|
3829
3826
|
}
|
|
3830
3827
|
} else {
|
|
3831
|
-
|
|
3828
|
+
options = paymentTypeOptions.filter(
|
|
3832
3829
|
(option) => option.value !== "STABLE_COIN"
|
|
3833
3830
|
);
|
|
3834
3831
|
}
|
|
3835
|
-
setFilteredPaymentTypeOptions(
|
|
3832
|
+
setFilteredPaymentTypeOptions(options);
|
|
3836
3833
|
}, [paymentObject.currency, paymentObject.amount]);
|
|
3837
3834
|
useEffect6(() => {
|
|
3838
3835
|
if (filteredPaymentTypeOptions.length) {
|
|
@@ -3856,14 +3853,14 @@ function BzpCheckoutCard({
|
|
|
3856
3853
|
className: checkoutState === "SUCCESS" ? "col-span-3" : "col-span-2",
|
|
3857
3854
|
children: [
|
|
3858
3855
|
checkoutState === "PENDING" && /* @__PURE__ */ jsxs26("div", { className: "flex items-center justify-between px-12 py-8", children: [
|
|
3859
|
-
|
|
3856
|
+
paymentObject.logoUrl ? /* @__PURE__ */ jsx38(
|
|
3860
3857
|
BaseImage,
|
|
3861
3858
|
{
|
|
3862
|
-
src:
|
|
3859
|
+
src: paymentObject.logoUrl ?? "",
|
|
3863
3860
|
alt: "Merchant Logo",
|
|
3864
3861
|
width: 52,
|
|
3865
3862
|
height: 52,
|
|
3866
|
-
customClass: "rounded-lg"
|
|
3863
|
+
customClass: "rounded-lg object-fit"
|
|
3867
3864
|
}
|
|
3868
3865
|
) : /* @__PURE__ */ jsx38(
|
|
3869
3866
|
"div",
|
|
@@ -3882,7 +3879,7 @@ function BzpCheckoutCard({
|
|
|
3882
3879
|
] })
|
|
3883
3880
|
] })
|
|
3884
3881
|
] }),
|
|
3885
|
-
checkoutState === "PENDING" && /* @__PURE__ */ jsx38("div", { className: "overflow-y-scroll px-10 pb-10 pt-2", children: paymentType === "CARD" ? /* @__PURE__ */ jsx38(
|
|
3882
|
+
checkoutState === "PENDING" && /* @__PURE__ */ jsx38("div", { className: "max-h-[32rem] overflow-y-scroll px-10 pb-10 pt-2", children: paymentType === "CARD" ? /* @__PURE__ */ jsx38(
|
|
3886
3883
|
PayByCard,
|
|
3887
3884
|
{
|
|
3888
3885
|
secretKey,
|
|
@@ -3949,7 +3946,7 @@ function MidenCheckoutIframe({
|
|
|
3949
3946
|
email: "",
|
|
3950
3947
|
phoneNumber: "",
|
|
3951
3948
|
narration: "",
|
|
3952
|
-
redirectUrl: "
|
|
3949
|
+
redirectUrl: ""
|
|
3953
3950
|
},
|
|
3954
3951
|
onError
|
|
3955
3952
|
}) {
|
|
@@ -4036,7 +4033,7 @@ function MidenCheckoutButton({
|
|
|
4036
4033
|
email: "",
|
|
4037
4034
|
phoneNumber: "",
|
|
4038
4035
|
narration: "",
|
|
4039
|
-
redirectUrl: "
|
|
4036
|
+
redirectUrl: ""
|
|
4040
4037
|
},
|
|
4041
4038
|
mode = "redirect",
|
|
4042
4039
|
onError
|
|
@@ -4118,8 +4115,7 @@ function MidenCheckoutCard({
|
|
|
4118
4115
|
currency: "",
|
|
4119
4116
|
email: "",
|
|
4120
4117
|
phoneNumber: "",
|
|
4121
|
-
narration: ""
|
|
4122
|
-
redirectUrl: "https://sandbox-merchant.buzapay.com/account/three-ds-status"
|
|
4118
|
+
narration: ""
|
|
4123
4119
|
},
|
|
4124
4120
|
onPaymentAuthorized,
|
|
4125
4121
|
onError
|