@miden-npm/react 0.0.10 → 0.0.11

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
@@ -517,7 +517,7 @@ async function generateStableCoinAddress(environment, { merchantId, ...rest }) {
517
517
  // src/apis/encrypt.api.ts
518
518
  var import_crypto_js = __toESM(require("crypto-js"), 1);
519
519
  function encryptPayload(merchantId, formData = {}) {
520
- const merchId = merchantId.replace("-", "");
520
+ const merchId = merchantId.replace(/-/g, "");
521
521
  const first16Key = merchId.slice(0, 16);
522
522
  const last16Iv = merchId.slice(-16);
523
523
  const key = import_crypto_js.default.enc.Utf8.parse(first16Key);
@@ -538,7 +538,7 @@ function encryptPayload(merchantId, formData = {}) {
538
538
  };
539
539
  }
540
540
  function decryptPayload(merchantId, payload) {
541
- const merchId = merchantId.replace("-", "");
541
+ const merchId = merchantId.replace(/-/g, "");
542
542
  const first16Key = merchId.slice(0, 16);
543
543
  const last16Iv = merchId.slice(-16);
544
544
  const key = import_crypto_js.default.enc.Utf8.parse(first16Key);
@@ -2070,9 +2070,11 @@ function PayByCard({
2070
2070
  acsUrl: response.threeDsHtml?.acsUrl,
2071
2071
  md: response.threeDsHtml?.md
2072
2072
  };
2073
- localStorage.setItem("threeDsData", JSON.stringify(threeDsData));
2074
- const threeDsUrl = `${window.location.origin}/account/three-ds-confirm`;
2075
- window.open(threeDsUrl, "_blank", "noopener,noreferrer");
2073
+ const stringifiedThreeDsData = btoa(JSON.stringify(threeDsData));
2074
+ const threeDsUrl = `https://sandbox-merchant.buzapay.com/account/three-ds-confirm?threeDsData=${encodeURIComponent(
2075
+ stringifiedThreeDsData
2076
+ )}`;
2077
+ window.open(threeDsUrl, "_self", "noopener,noreferrer");
2076
2078
  setMessage(
2077
2079
  "3D Secure authentication opened in new tab. Please complete the verification"
2078
2080
  );
@@ -2091,9 +2093,11 @@ function PayByCard({
2091
2093
  acsUrl: response.threeDsHtml?.acsUrl,
2092
2094
  md: response.threeDsHtml?.md
2093
2095
  };
2094
- localStorage.setItem("threeDsData", JSON.stringify(threeDsData));
2095
- const threeDsUrl = `${window.location.origin}/account/three-ds-confirm`;
2096
- window.open(threeDsUrl, "_blank", "noopener,noreferrer");
2096
+ const stringifiedThreeDsData = btoa(JSON.stringify(threeDsData));
2097
+ const threeDsUrl = `https://sandbox-merchant.buzapay.com/account/three-ds-confirm?threeDsData=${encodeURIComponent(
2098
+ stringifiedThreeDsData
2099
+ )}`;
2100
+ window.open(threeDsUrl, "_self", "noopener,noreferrer");
2097
2101
  setMessage(
2098
2102
  "3D Secure authentication opened in new tab. Please complete the verification"
2099
2103
  );