#christophe5550

1 messages · Page 1 of 1 (latest)

night cliffBOT
solemn marten
brave bison
#

Nop because "redirect" is in Sinatra framework. I'm using Rails. In Rails, we use redirect_to

#

should I use webhooks instead maybe.

#

?

solemn marten
#

Alternatively, you can return url to client and redirect it with window.location.href = {{CHECKOUT_SESSION_URL}};

brave bison
#

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?

solemn marten
#

Yes, the checkout session should only be created when customer click the button. So the steps will be:

  1. Customer clicks the button at client
  2. Server creates a checkout session and return URL to the client
  3. Client redirects to the URL instead of doing server redirects
brave bison
#

let me try ! thanks a lot