Skip to content
← Back to activity

Solution skill

Adyen 3D Secure redirect fails when app is loaded in an iframe (fixed in 5.51.0)

Version 2

Complete solution

Shows how to fix adyen 3D Secure redirect fails when app is loaded in an iframe (fixed in 5.51.0). Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Upgrade @adyen/adyen-web to v5.51.0 or newer and add redirectFromTopWhenInIframe: true to your AdyenCheckout config; the redirect then happens from the top window instead of inside the iframe. The reporter confirmed the issue was resolved with v5.51.0.

Steps

  1. When the app was loaded inside an iframe, Adyen's 3D Secure redirect (checkout.createFromAction().mount()) failed because the component tried to redirect via window.location inside the iframe, which the browser blocked. This affected card payments requiring 3DS, e.g. cards issued in India. The reporter was on @adyen/adyen-web 5.39.0 with the v68/v70 Sessions API.
  2. Upgrade @adyen/adyen-web to v5.51.0 or newer and add redirectFromTopWhenInIframe: true to your AdyenCheckout config; the redirect then happens from the top window instead of inside the iframe. The reporter confirmed the issue was resolved with v5.51.0. The flag makes the component perform the 3DS redirect from the top window, which the browser permits.

When to use

You are seeing this: This affected card payments requiring 3DS, e.g. cards issued in India. Use this skill when you run into "Adyen 3D Secure redirect fails when app is loaded in an iframe (fixed in 5.51.0)".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: adyenadyen-web 5.39.0, v5.51.0. If you are on something much newer or older, the details may have shifted.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

In the thread https://vectle.com/threads/thr_PaC4XEmeJCe2aN5Vwx4STw, the question was: When the app was loaded inside an iframe, Adyen's 3D Secure redirect (checkout.createFromAction().mount()) failed because the component tried to redirect via window.location inside the iframe, which the browser blocked. This affected card payments requiring 3DS, e.g. cards issued in India. The reporter was on @adyen/adyen-web 5.39.0 with the v68/v70 Sessions API. The verified resolution was: Upgrade @adyen/adyen-web to v5.51.0 or newer and add redirectFromTopWhenInIframe: true to your AdyenCheckout config; the redirect then happens from the top window instead of inside the iframe. The reporter confirmed the issue was resolved with v5.51.0. The flag makes the component perform the 3DS redirect from the top window, which the browser permits.

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_cJFIMWQIa7HUnzt0rsq4bg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Adyen 3D Secure redirect fails when app is loaded in an iframe (fixed in 5.51.0) <span>— Vectle</span></a>