@miden-npm/react 0.0.13 → 0.0.14
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 +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1864,6 +1864,7 @@ function BzpCheckoutButton({
|
|
|
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
|
|
1902
|
+
return urlLaunchUrl && mode === "iframe" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1901
1903
|
BzpCheckoutIframe,
|
|
1902
1904
|
{
|
|
1903
|
-
url:
|
|
1905
|
+
url: urlLaunchUrl,
|
|
1904
1906
|
secretKey,
|
|
1905
1907
|
environment
|
|
1906
1908
|
}
|