#ednonstop - calculate tax

1 messages ยท Page 1 of 1 (latest)

timid lark
#

Hi ๐Ÿ‘‹
How are you calculating tax on your purchases?

flat aurora
#

I just enabled this feature on stripe dashboard and want stripe to calculate tax for customers automatically

#

I haven't done it yet

timid lark
#

Okay so you are using automatic tax calculation.

flat aurora
#

I want to know how to get tax. I'm using SetupIntent and PaymentIntent. My task is to estimate and show my users tax before they make payment

#

Can you tell me how it can be done

timid lark
#

Looking into this. At what point in your flow are you wanting to display the tax amount (or %) to your customers?

flat aurora
#

User goes into basket, click "Place Order" and see "Confirm Payment" screen with total payment and taxes info. Then he click "Confirm" and stripe payment popup appear.

#

So basically it must be seen just before payment popup will appear

timid lark
#

What is the payment popup in this case?

flat aurora
#

User must see estimated tax before this popup appear

timid lark
#

At that point in your app, do you already know who the Customer is?

flat aurora
#

Yes , i just checked the customer object i received

#

but there is no tax field inside it

#

maybe need to complete some requirements

timid lark
#

the tax property is not expanded by default. You need to request it expand=['tax']

flat aurora
#

oh

timid lark
#

But this will only get populated after the user adds a payment method (so we get the IP address and location info)

#

Or makes a payment

flat aurora
#

expand=['tax']

is this a query parameter for Retrieve a customer request?

#

i'm using on my js backend

const customerList = await stripe.customers.list({
email: req.body.email,
limit: 1
});

or

     const customer = await stripe.customers.create({
            email: req.body.email
        });
#

expand=['tax']

is this a query parameter for Retrieve a customer request?

timid lark
flat aurora
#

Ok thanks

#

so in my case

#

it will be

#

const customerList = await stripe.customers.list({
email: req.body.email,
limit: 1,
expand: ['tax'],
});

#

am i right?

cursive yarrow
#

๐Ÿ‘‹ stepping in as Snufkin has to step away

#

Yes your code above would be correct for expanding tax when listing Customers

flat aurora
#

ok, will try now, thanks

#

This property cannot be expanded (tax). You may want to try expanding 'data.tax' instead."

cursive yarrow
#

Ah yes

#

Sorry

#

A list

#

With lists you do data.object

flat aurora
#

How can i enable this?

cursive yarrow
#

Are you creating Subscriptions?

flat aurora
#

no, i'm using payments

#

SetupIntent and PaymentIntent

cursive yarrow
#

Okay well you can't collect tax via Stripe with that integration unfortunately.

#

We don't support automatic tax on PaymentIntents without using the Orders API

#

Which isn't supported on the Mobile SDKs yet.

flat aurora
#

So there is no manual way to calculate the tax with current integration, right?

cursive yarrow
#

With just PaymentIntents and SetupIntents you would have to handle tax yourself on Mobile.

#

Unless you use Invoices

#

That would be the other way to do this on Mobile for one-off payments

flat aurora
cursive yarrow
#

You would include it in your own calculation of the PaymentIntent amount.

#

Stripe can't calculate tax for you if you only use a PaymentIntents/SetupIntents integration.

flat aurora
cursive yarrow
#

Like I said, Stripe can't provide that. You would have to gather that yourself, perhaps using a third party or something. Stripe can't know the tax rate just based on the Customer object. That isn't how automatic tax works. Feel free to give a read through our Stripe Tax docs: https://stripe.com/docs/tax

flat aurora
#

ok, got it, will speak with my team , thanks