juspay / hyperswitch-web

Hyperswitch Web SDK: A Rescript powered React library for seamless payment integration and customization.
https://hyperswitch.io/
Apache License 2.0
53 stars 60 forks source link

[REFACTOR] handle iframe redirections #773

Closed kashif-m closed 2 weeks ago

kashif-m commented 2 weeks ago

Problem Statement SDK should be able to redirect in root context in case it's iframed. Currently, SDK only redirects in the current context it was embedded in. Handling redirections in root context is important for functionalities like 3DS txns.

Possible solution SDK's default behaviour of redirecting in current context can be preserved to maintain backwards compatibility for anyone depending on it. For handling redirections in root context, it can be instructed by the integrator to redirect in top context.

This can be done by introducing a new boolean field which can be passed to the SDK during it's initialization. This field will control whether or not to redirect in root context.