#tounka

1 messages · Page 1 of 1 (latest)

serene eagleBOT
gray schooner
#

Hi there

#

Yep you can test end-to-end locally for Checkout

lone cliff
#

how can i do this?

gray schooner
#

You just use your test API key with a Checkout integration and server it over localhost

lone cliff
#

will i get webhook events as well

gray schooner
lone cliff
#

will the events correspond to the checkout session i'll create

gray schooner
#

Yes

lone cliff
#

how can i do that exactly?

#

when i do stripe trigger {event} seems like its just random data

gray schooner
#

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

lone cliff
#

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

gray schooner
#

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

lone cliff
#

so if i'm completing a checkout session locally via a UI, what process triggers the webhook events to hit my api

gray schooner
#

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

lone cliff
#

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

gray schooner
#

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

lone cliff
#

what does this do AutomaticTax.enabled: true

#

when you say "have tax calculated automatically" idk what that means

gray schooner
#

That will explain it better than I can

lone cliff
#

i read through this a couple times. still lost

#

well it makes sense, i just don't know what i should be doing

gray schooner
#

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!

lone cliff
#

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

gray schooner
#

That depends on how your Price's tax_behavior is set up

lone cliff
#

is that something i set up in the dashboard or in code?

gray schooner
#

You can do it either way

lone cliff
#

where in the dashboard is it?

gray schooner
lone cliff
#

Tax Rates?

gray schooner
#

When you create the Price there is a little tickbox for "include tax in price"

lone cliff
#

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

gray schooner
#

Yep inclusive means tax would be baked into the 19.99

lone cliff
#

and what if i set AutomaticTax: false ?

gray schooner
#

Then no tax would be applied regardless

#

Unless you apply a tax rate yourself

lone cliff
#

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

gray schooner
#

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.

lone cliff
#

makes sense thank you for your help!