1 · Register your embed origin
null clears it). Once set, the authorize
page serves frame-ancestors 'self' https://yourshop.example and drops
X-Frame-Options — your iframe renders; everyone else’s stays blocked.
2 · Frame the redeem URL, not the authorize URL
Mint the buyer session server-side (Bring your own auth), then use the redeemPath as the iframesrc:
SameSite=None; Secure; Partitioned for iframe navigations — but
only a redeem that happens in the frame puts the session where the framed
page can see it. Redeeming in a top-level tab and then framing the authorize
URL will not share the session.
3 · Listen for completion
The embedded page posts to your window — only to your registered origin:cancelled event — your modal’s close button owns dismissal.
Notes
- Card capture inside the modal: the page’s Stripe Elements iframe runs at one extra frame depth. Validate it once in a staging embed before enabling in production; if your stack misbehaves, fall back to the redirect flow for the add-card step only.
- The redirect flow keeps working unchanged — treat embedding as progressive enhancement.
- Browser support: the partitioned-cookie flow requires a current Chrome/Edge/Firefox/Safari; very old browsers fall back to redirect.

