@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.js CHANGED
@@ -475,7 +475,7 @@ async function generateStableCoinAddress(environment, { merchantId, ...rest }) {
475
475
  // src/apis/encrypt.api.ts
476
476
  import CryptoJS from "crypto-js";
477
477
  function encryptPayload(merchantId, formData = {}) {
478
- const merchId = merchantId.replace("-", "");
478
+ const merchId = merchantId.replace(/-/g, "");
479
479
  const first16Key = merchId.slice(0, 16);
480
480
  const last16Iv = merchId.slice(-16);
481
481
  const key = CryptoJS.enc.Utf8.parse(first16Key);
@@ -496,7 +496,7 @@ function encryptPayload(merchantId, formData = {}) {
496
496
  };
497
497
  }
498
498
  function decryptPayload(merchantId, payload) {
499
- const merchId = merchantId.replace("-", "");
499
+ const merchId = merchantId.replace(/-/g, "");
500
500
  const first16Key = merchId.slice(0, 16);
501
501
  const last16Iv = merchId.slice(-16);
502
502
  const key = CryptoJS.enc.Utf8.parse(first16Key);
@@ -2028,9 +2028,11 @@ function PayByCard({
2028
2028
  acsUrl: response.threeDsHtml?.acsUrl,
2029
2029
  md: response.threeDsHtml?.md
2030
2030
  };
2031
- localStorage.setItem("threeDsData", JSON.stringify(threeDsData));
2032
- const threeDsUrl = `${window.location.origin}/account/three-ds-confirm`;
2033
- window.open(threeDsUrl, "_blank", "noopener,noreferrer");
2031
+ const stringifiedThreeDsData = btoa(JSON.stringify(threeDsData));
2032
+ const threeDsUrl = `https://sandbox-merchant.buzapay.com/account/three-ds-confirm?threeDsData=${encodeURIComponent(
2033
+ stringifiedThreeDsData
2034
+ )}`;
2035
+ window.open(threeDsUrl, "_self", "noopener,noreferrer");
2034
2036
  setMessage(
2035
2037
  "3D Secure authentication opened in new tab. Please complete the verification"
2036
2038
  );
@@ -2049,9 +2051,11 @@ function PayByCard({
2049
2051
  acsUrl: response.threeDsHtml?.acsUrl,
2050
2052
  md: response.threeDsHtml?.md
2051
2053
  };
2052
- localStorage.setItem("threeDsData", JSON.stringify(threeDsData));
2053
- const threeDsUrl = `${window.location.origin}/account/three-ds-confirm`;
2054
- window.open(threeDsUrl, "_blank", "noopener,noreferrer");
2054
+ const stringifiedThreeDsData = btoa(JSON.stringify(threeDsData));
2055
+ const threeDsUrl = `https://sandbox-merchant.buzapay.com/account/three-ds-confirm?threeDsData=${encodeURIComponent(
2056
+ stringifiedThreeDsData
2057
+ )}`;
2058
+ window.open(threeDsUrl, "_self", "noopener,noreferrer");
2055
2059
  setMessage(
2056
2060
  "3D Secure authentication opened in new tab. Please complete the verification"
2057
2061
  );