@miden-npm/react 2.0.2 → 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.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, options, environment, paymentObject, onPaymentAuthorized, onError, }: IBzpCheckoutCardProps): react_jsx_runtime.JSX.Element;
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, options, environment, paymentObject, onPaymentAuthorized, onError, }: IBzpCheckoutCardProps): react_jsx_runtime.JSX.Element;
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
@@ -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,
@@ -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: ""
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 options2 = [];
3816
+ let options = [];
3820
3817
  if (paymentObject.currency === "USD") {
3821
3818
  if (paymentObject.amount < 50) {
3822
- options2 = paymentTypeOptions.filter(
3819
+ options = paymentTypeOptions.filter(
3823
3820
  (option) => option.value !== "BANK_TRANSFER" && option.value !== "STABLE_COIN"
3824
3821
  );
3825
3822
  } else {
3826
- options2 = paymentTypeOptions.filter(
3823
+ options = paymentTypeOptions.filter(
3827
3824
  (option) => option.value !== "BANK_TRANSFER"
3828
3825
  );
3829
3826
  }
3830
3827
  } else {
3831
- options2 = paymentTypeOptions.filter(
3828
+ options = paymentTypeOptions.filter(
3832
3829
  (option) => option.value !== "STABLE_COIN"
3833
3830
  );
3834
3831
  }
3835
- setFilteredPaymentTypeOptions(options2);
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
- options?.imageUrl ? /* @__PURE__ */ jsx38(
3856
+ paymentObject.logoUrl ? /* @__PURE__ */ jsx38(
3860
3857
  BaseImage,
3861
3858
  {
3862
- src: options?.imageUrl ?? "",
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,
@@ -4118,8 +4115,7 @@ function MidenCheckoutCard({
4118
4115
  currency: "",
4119
4116
  email: "",
4120
4117
  phoneNumber: "",
4121
- narration: "",
4122
- redirectUrl: ""
4118
+ narration: ""
4123
4119
  },
4124
4120
  onPaymentAuthorized,
4125
4121
  onError