#tounka
1 messages · Page 1 of 1 (latest)
how can i do this?
You just use your test API key with a Checkout integration and server it over localhost
You can see a basic Checkout integration code snippet here: https://stripe.com/docs/checkout/quickstart
will i get webhook events as well
You can use the CLI for webhooks: https://stripe.com/docs/webhooks/test
will the events correspond to the checkout session i'll create
Yes
how can i do that exactly?
when i do stripe trigger {event} seems like its just random data
Did you read the doc?
You need to forward events to a local endpoint
So you need to set up Webhook handler code at that endpoint
yea i did all of that. but i'm confused on when trigger stripe trigger checkout.session.completed how to make sure the checkoutID is from the checkout session i created earlier
Ah I see
So you don't need to use stripe trigger if you are creating and completing a Checkout Session yourself
stripe trigger would just be a faster way to generate these Events with some default info
But if you are using the CLI to forward to a local endpoint then all events triggered on your account will go to that endpoint
so if i'm completing a checkout session locally via a UI, what process triggers the webhook events to hit my api
Anytime you generate Events on your account if you have an endpoint that is listening for those events then the event(s) will get sent to that endpoint.
So in this case the CLI is standing in for that
You use stripe listen --forward-to localhost:4242/webhook for example and when you trigger an event it will get sent to your local endpoint running at port 4242 with route /webhook
In this case you "trigger the event" by just completing a Checkout Session
okay i'll try that out thanks
I've also already set up my Plans in the dashboard. If i want my prices to be inclusive of tax is there anything specific i need to do? I'm also not sure if i need to set the AutomaticTax field to true on the CheckoutSessionParams object when creating a session
Yep if you want to use Stripe Tax and have tax calculated automatically then you would set AutomaticTax.enabled: true
And that is all you have to do other than set up your tax registration settings in your Dashboard
what does this do AutomaticTax.enabled: true
when you say "have tax calculated automatically" idk what that means
Take a read through our Checkout + Tax docs: https://stripe.com/docs/tax/checkout
That will explain it better than I can
i read through this a couple times. still lost
well it makes sense, i just don't know what i should be doing
The best thing to do is to test this stuff out in test mode
So create a Checkout Session with AutomaticTax: true
Then go through the Session and see if tax is applied as you so desire
If not, troubleshoot.
And we can help with troubleshooting specific issues!
if i set AutomaticTax: true and my plan total is 19.99, will the customer only pay 19.99 or will tax be added on top of that
That depends on how your Price's tax_behavior is set up
is that something i set up in the dashboard or in code?
You can do it either way
where in the dashboard is it?
Tax Rates?
When you create the Price there is a little tickbox for "include tax in price"
got it. so assuming tax behavior is inclusive, if i set AutomaticTax: true and my plan total is 19.99, will the customer only pay 19.99 or will tax be added on top of that
Yep inclusive means tax would be baked into the 19.99
and what if i set AutomaticTax: false ?
the user must be charged tax right. so sounds like tax behavior being set to "inclusive" AND AutomaticTax: true will have tax baked into the total. and all tax obligations would be met
Up to you to handle charging tax or not, we don't control that. We offer Stripe tax (via AuatomaticTax) as a way ot do this, yes.
So overall yes if you have auto tax enabled, and the proper tax registration set up at https://dashboard.stripe.com/test/settings/tax then tax will be collected according to obligations for each place you are registered
makes sense thank you for your help!