#romain-elements

1 messages · Page 1 of 1 (latest)

peak mountain
#

@earnest goblet are there any errors in the browser devtools console?

earnest goblet
#

No

peak mountain
#

or failed requests in the network tab?

earnest goblet
#

No

peak mountain
earnest goblet
#

No error in the console, and no fail request.

peak mountain
#

can you link me to your website so I can have a look?

earnest goblet
#

The website is in localhost

#

I use the custom payment flow

peak mountain
#

can you share the exact code you're using then?

earnest goblet
#

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)

peak mountain
#

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.

earnest goblet
#

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

peak mountain
#

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

peak mountain
earnest goblet
#

If I leave this field empty, I have an error that tell me is required

peak mountain
earnest goblet
#

Ok, can you confirm me if I set only "card" in the "payment_method_types", I never need redirect?

peak mountain
#

yes, but cards might present 3D Secure(would be in a popup though, not a redirect)