Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

refactor(payment-link): use shouldRemoveBeforeUnloadEvents flag for handling removal of beforeunload events through SDK (#7072)

Kashif776ed9a2eb0e
diff --git a/crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js b/crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js
index d45a72b5e5..bc851bbeb1 100644
--- a/crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js
+++ b/crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js
@@ -27,7 +27,12 @@ function initializeSDK() {
// @ts-ignore
hyper = window.Hyper(pub_key, {
isPreloadEnabled: false,
+ // TODO: Remove in next deployment
shouldUseTopRedirection: true,
+ redirectionFlags: {
+ shouldRemoveBeforeUnloadEvents: true,
+ shouldUseTopRedirection: true,
+ }
});
// @ts-ignore
widgets = hyper.widgets({
diff --git a/crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js b/crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js
index 4bddc6904b..290df7d120 100644
--- a/crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js
+++ b/crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js
@@ -48,7 +48,12 @@ if (!isFramed) {
// @ts-ignore
hyper = window.Hyper(pub_key, {
isPreloadEnabled: false,
+ // TODO: Remove in next deployment
shouldUseTopRedirection: true,
+ redirectionFlags: {
+ shouldRemoveBeforeUnloadEvents: true,
+ shouldUseTopRedirection: true,
+ }
});
// @ts-ignore
widgets = hyper.widgets({