#romain-elements
1 messages · Page 1 of 1 (latest)
No
or failed requests in the network tab?
No
or failed API requests on https://dashboard.stripe.com/test/logs/ ?
No error in the console, and no fail request.
can you link me to your website so I can have a look?
can you share the exact code you're using then?
Oh, I found the problem !
It's because I initialize stripe two time : First time when I initialize form, and second time when I submit form.
Now it's work ^^
Ok, thanks for your time. 🙂
Ok, I have another question : How to make the redirect_url optional ?
I don't want to redirect the customer.
(the parameter return_url)
as far as I know, it is optional, but it depends on what payment methods you're using
some of them require a redirect though, it's just how they work, like iDEAL needs the customer to be redirected to their bank, so you need to pass return_url for where the customer comes back to after they do that.
The problem is if the customer is redirected, I lost all order data in my SPA website. And I need this to show to confirmation page (this confirmation is not a page, is a div that show/hidden depends on a success variable)
The only payment method is card
yep that's a common problem
unfortunately it's just how it works, some payments require redirects. You'd probably want to leverage cookies so you can authenticate the user and recognise them when they return back to your site and pick back up their order state
then AFAIK you don't have to pass a return_url
If I leave this field empty, I have an error that tell me is required
If you don’t want to redirect for card payments, you can set redirect to if_required. This only redirects customers that check out with redirect-based payment methods.
https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-submit-payment
Ok, can you confirm me if I set only "card" in the "payment_method_types", I never need redirect?
yes, but cards might present 3D Secure(would be in a popup though, not a redirect)