@miden-npm/react 0.0.9 → 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 +14 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -124,7 +124,7 @@ var getQueryParams = (url) => {
|
|
|
124
124
|
|
|
125
125
|
// src/utils/api.util.ts
|
|
126
126
|
var getBaseUrl = (mode) => {
|
|
127
|
-
return mode === "sandbox" ? "https://sandbox-api.midencards.io/payment-gateway-
|
|
127
|
+
return mode === "sandbox" ? "https://sandbox-api.midencards.io/payment-gateway-api" : "";
|
|
128
128
|
};
|
|
129
129
|
|
|
130
130
|
// src/utils/string.util.ts
|
|
@@ -443,7 +443,7 @@ async function authorizeCardPayment(environment, { merchantId, ...rest }) {
|
|
|
443
443
|
try {
|
|
444
444
|
const baseUrl = getBaseUrl(environment);
|
|
445
445
|
const res = await fetch(
|
|
446
|
-
`${baseUrl}/api/v1/checkout/authorize-card-3ds-payment`,
|
|
446
|
+
`${baseUrl}/api/v1/checkout/authorize-card-3ds-payment-sdk`,
|
|
447
447
|
{
|
|
448
448
|
method: "POST",
|
|
449
449
|
headers: {
|
|
@@ -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
|
-
|
|
2074
|
-
const threeDsUrl =
|
|
2075
|
-
|
|
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
|
-
|
|
2095
|
-
const threeDsUrl =
|
|
2096
|
-
|
|
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
|
);
|