@miden-npm/react 0.0.13 → 0.0.15

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 CHANGED
@@ -1782,7 +1782,7 @@ function BzpCheckoutIframe({
1782
1782
  email: "",
1783
1783
  phoneNumber: "",
1784
1784
  narration: "",
1785
- redirectUrl: ""
1785
+ redirectUrl: "https://sandbox-merchant.buzapay.com/account/three-ds-status"
1786
1786
  }
1787
1787
  }) {
1788
1788
  const containerRef = (0, import_react6.useRef)(null);
@@ -1858,12 +1858,13 @@ function BzpCheckoutButton({
1858
1858
  email: "",
1859
1859
  phoneNumber: "",
1860
1860
  narration: "",
1861
- redirectUrl: ""
1861
+ redirectUrl: "https://sandbox-merchant.buzapay.com/account/three-ds-status"
1862
1862
  },
1863
1863
  mode = "redirect"
1864
1864
  }) {
1865
1865
  const [message, setMessage] = (0, import_react7.useState)("");
1866
1866
  const [launchUrl, setLaunchUrl] = (0, import_react7.useState)("");
1867
+ const [urlLaunchUrl, setUrlLaunchUrl] = (0, import_react7.useState)("");
1867
1868
  const [loading, setLoading] = (0, import_react7.useState)(false);
1868
1869
  const generatePaymentLinkHandler = async () => {
1869
1870
  if (!secretKey) {
@@ -1884,6 +1885,7 @@ function BzpCheckoutButton({
1884
1885
  );
1885
1886
  if (response?.isSuccessful && response.launchUrl) {
1886
1887
  setLaunchUrl(response.launchUrl);
1888
+ setUrlLaunchUrl(`${response.launchUrl}&merchantId=${btoa(secretKey)}`);
1887
1889
  setMessage("Payment link created successfully");
1888
1890
  if (mode === "redirect") {
1889
1891
  window.open(response.launchUrl, "_blank", "noopener,noreferrer");
@@ -1897,10 +1899,10 @@ function BzpCheckoutButton({
1897
1899
  setLoading(false);
1898
1900
  }
1899
1901
  };
1900
- return launchUrl && mode === "iframe" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1902
+ return urlLaunchUrl && mode === "iframe" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1901
1903
  BzpCheckoutIframe,
1902
1904
  {
1903
- url: launchUrl,
1905
+ url: urlLaunchUrl,
1904
1906
  secretKey,
1905
1907
  environment
1906
1908
  }
@@ -3083,7 +3085,7 @@ function BzpCheckoutCard({
3083
3085
  email: "",
3084
3086
  phoneNumber: "",
3085
3087
  narration: "",
3086
- redirectUrl: ""
3088
+ redirectUrl: "https://sandbox-merchant.buzapay.com/account/three-ds-status"
3087
3089
  }
3088
3090
  }) {
3089
3091
  const [checkoutState, setCheckoutState] = (0, import_react11.useState)("PENDING");
@@ -3205,7 +3207,7 @@ function BzpCheckoutCard({
3205
3207
  {
3206
3208
  amount: paymentObject.amount,
3207
3209
  currency: paymentObject.currency,
3208
- redirectUrl: paymentObject.redirectUrl,
3210
+ redirectUrl: paymentObject.redirectUrl ?? "",
3209
3211
  successObject
3210
3212
  }
3211
3213
  )