#Anil

1 messages · Page 1 of 1 (latest)

earnest epochBOT
old otter
#

You can set both billing_address_collection and shipping_address_collection to let Stripe Checkout to collect these info from customer

shell notch
#

How to set these?

#

And where?

old otter
shell notch
#

Okay

#

And stripe.redirectToCheckout method takes product id from stripe
How we can give product details coming from backend

old otter
#

redirectToCheckout is already deprecated. You should create checkout session from backend, and redirect your customer to the checkout session's URL.

earnest epochBOT
shell notch
#

Is it not possible to add stripe.checkout.sessions.create in the frontend

tender wing
#

i'm afraid i don't understand what you mean? stripe.checkout.sessions.create is an event - an event is handled by your backend server. Is there a reason why you're trying to add stripe.checkout.sessions.create in the frontend?

shell notch
#

I have a button which will open stripe payment gateway. So i am thinking if i can call this event on "onClick"

tender wing
#

i think you've gotten mixed up between an event and a request. If you're looking to create a Checkout Session when the customer clicks on a button, then i suggest you take a look at this guide to get started : https://stripe.com/docs/checkout/quickstart

shell notch
#

Okay, thanks.

#

Can you please tell me what's the difference in checkout session if i create it on a button and from the server

old otter
shell notch
#

No, i am looking to create checkout session when user click on a button

old otter
#

Creating a checkout session requires a secret key so you can't create it from frontend.