#Sadness ;'(
1 messages · Page 1 of 1 (latest)
this is not possible for iDeal
a full redirection is the only way possible
iDeal blocks the use of their webpage with the X-Frame-Options headers
This thread has been archived. If you need help with anything else please ask in #dev-help or contact Stripe Support: https://support.stripe.com/contact
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Hi again 😁 But is it possible to open it in another tab? I just don’t want to loose the original web page and handle the whole payment process on it.
Yes you can open in another tab if you like
Thanks for quick response. How to do it?
as far as I'm aware it's not actually possible, if you're using the PaymentElement. In any case, when the customer completes the auth they are going to get redirected to your return_url, so you're not going to have your original web page context anyway
these payment methods are inherently redirect based, it's just how it works and you need to build the site such that you can re-establish context when the user comes back(e.g. by having a cookie set on the browser that you recognise and can look up their cart when they come back, maybe in conjunction with dynamic URL params on the return_url).
So then, is it possible with any other element?
I don't think it would solve your issue really? Like you can open a new tab to iDEAL. When the customer is finished, that tab has to redirect somewhere.
It would be great if it will close and the user will get the notification in the original web page.
it doesn't make much sense that I would have your cart page open in one tab, then iDEAL opens in another tab, and then at the end I have two tabs, one with your cart and one with the 'payment success' page.
yep but that's not really possible unless you're willing to write a bunch of custom code; like handling the redirect yourself, and implementing a return page that updates some state on your backend, calls window.close, and your other tab is polling for some state
if you're dead set on that you could do it but I'd really suggest not, and just using a simple cart -> payment auth -> success page flow which is what the PaymentElement is designed for
Apologies for the confusion here -- I misinterpreted the previous discussion of return_url and iframe usage
Yes, it is possible to restore context. But in my opinion user experience is much richer in the way with second tab.
No problem
if you'd like to build it the other way, https://stripe.com/docs/payments/ideal/accept-a-payment?platform=web&ui=element#web-handle-redirect would help
instead of doing window.location = action.redirect_to_url.url; like in that example you could open a new tab in JS for that URL(don't remember off the top of my head how that's done).
Then like I mentioned you'd need your return_url to be some script/endpoint on your server which updates local state etc that your original tab is polling for
I see it now
it's window.open https://developer.mozilla.org/en-US/docs/Web/API/Window/open with target _blank
Thanks, it works also for other payments with redirects too?
AFAIK yes
Thanks a lot.
If I will decide to use the custom flow, the only thing that bothers me is informing the another tab from backend about the payment. I think that websockets are suitable for that, but if stripe provides a function like that it would be nice to know about it.
we don't
but yep, you could use websockets on the original page and have your backend push something through them when the state changes
Ok, thanks, good to know. Meanwhile I got another question. What happens with stripe redirection if I set the return_url to an empty string? Will it just “close” the payment tab?
you can't do that no
(index):1 Uncaught (in promise) IntegrationError: stripe.confirmPayment(): the `confirmParams.return_url` argument is required unless passing `redirect: 'if_required'`
at y ((index):1:108794)
at (index):1:402798
at async HTMLFormElement.handleSubmit (checkout.js:57:19)