#christophe5550
1 messages · Page 1 of 1 (latest)
If you use redirect session.url, 303 as an example shared, does it work? https://stripe.com/docs/checkout/quickstart?lang=ruby
Nop because "redirect" is in Sinatra framework. I'm using Rails. In Rails, we use redirect_to
should I use webhooks instead maybe.
?
Alternatively, you can return url to client and redirect it with window.location.href = {{CHECKOUT_SESSION_URL}};
hum, yes but that means that i need to create as sessions as add_to_cart button on my page containing a lot of products.
I think the best is to create session only when a user click on the button no?
Yes, the checkout session should only be created when customer click the button. So the steps will be:
- Customer clicks the button at client
- Server creates a checkout session and return URL to the client
- Client redirects to the URL instead of doing server redirects
let me try ! thanks a lot