#nerder_best-practices

1 messages Β· Page 1 of 1 (latest)

ionic remnantBOT
#

πŸ‘‹ Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

πŸ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1410407258118160454

πŸ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

pallid sable
#

To add additional context, we are using Stripe Connect standard and our customers are Gyms selling Membership and bundle of classes

robust inlet
#

There are mutliple layers and it depends on the types of products/services being sold

pallid sable
#

ok, the tax_code makes any difference?

robust inlet
#

I don't think so. It's more focused on the way the product/service is delivered. Since the gym membership isn't something that is delivered to a customer but happens at a location, we will use the Customer's billing address details from their Payment Method

pallid sable
#

Ok, I'm a bit worried about this in our specific scenario

robust inlet
#

But if you were selling sofas (for instance), we would want to use the address the sofa is being shipped to

pallid sable
#

In our case we are actually billing a marketplace, so a user can have a billing address in a country (case they live there), but then travelling to another gym to train there for a while

#

normally they should not be tax exempt right?

#

but in this case they would probably be if I'm understanding correctly

robust inlet
#

Unfortunately I cannot speak to actual tax liability here. We can only offer advice on building Stripe integrations

pallid sable
#

Yes, what I'm trying to understand if the integration is correct or not

robust inlet
#

How are you integrating?

pallid sable
#

because we are collecting customer address but they might end up calculating the tax incorrectly for some users

robust inlet
#

If you could please explain your integration in terms of API calls and data passed to Stripe APIs that would help me understand

pallid sable
#

So in a nutshell 3 steps:

  1. When the admin creates a product, I'm adding the correct tax_code (https://docs.stripe.com/tax/products-prices-tax-codes-tax-behavior#product-tax-code)
  2. When the user attempt to buy at checkout I'm pre-calculating the tax they will pay based on the GYM location (not customer) creating a TaxCalculation
  3. When the user completes the purchase, for both a sub or a one-off invoice, I'm enabling automatic_tax
#

basically this is the integration

#
      const taxCalculation = await this.stripe.tax.calculations.create(
        {
          currency: price?.currency,
          customer_details: {
            address: {
              country: gym.countryCode,
              state: gym.countryState,
            },
            address_source: 'billing',
          },
          line_items: [
            {
              amount: price?.price,
              reference: price?.code,
            },
          ],
        },
        {
          stripeAccount: gym.accountId.value,
        },
      );
#

this is the code for the tax preview, using gym location not customers

robust inlet
#

Okay. So in that case you would need to provide your tax calculation when you process the payment instead of relying on Stripe's automatic tax

pallid sable
#

ah, that's interesting!

robust inlet
#

It's basically our "Custom" flow. For those scenarios where our defaults don't match you business case

pallid sable
#

Ok, but can this be used in combo with subscriptions or invoices?

robust inlet
#

In that case you would need to apply them to each successful Payment Intent as the Customer pays the Invoice

pallid sable
#

umm ok, this seems pretty complex

#

probably not the correct path

robust inlet
#

In this case we don't have a middle ground. Since you are already creating the tax calculation, you have the data

#

And if you are using Susbcriptions you should already have a webhook listener

#

But I get it that finding the right tax calculation for each Customer when receiving a payment_intent.succeeded event might be pretty tricky to get right

pallid sable
#

Yes yes, but I wonder if the automatic_tax is not enough really

#

seems a pretty normal use-case to me

#

especially for connect

#

I imagine that most services works like this for physical products (ie: Uber, InstaCart, etc)

robust inlet
#

Nothing is "pretty normal" if Connect is invovled IMO πŸ˜…

But I recommend discussing tax liabilities with our Support staff (https://support.stripe.com/contact) to get clarity on whether or not automatic tax would work in this scenario

pallid sable
#

Exactly, probably I will chat with them to understand better

#

thank you so much for the pointers

robust inlet
#

Sure thing! happy to shed what πŸ’‘ I can πŸ™‚

ionic remnantBOT
pallid sable
#

hey

#

just to make sure of one thing, how can I reproduce this behaviour you have in the dashboard:

#

for some reasons my tax calculation is showing the VAT as excluded when it should be included

#

this is the req: req_nDybgjx3Revqhs

random obsidian
#

hello! Gimme a while to take a look

#

I'm a little confused, that request (req_nDybgjx3Revqhs) you shared does show VAT, where are you not seeing it?

#
  tax_breakdown: [
    {
      amount: 210,
      inclusive: false,
      tax_rate_details: {
        country: "ES",
        flat_amount: null,
        percentage_decimal: "21.0",
        rate_type: "percentage",
        state: null,
        tax_type: "vat",
      },
      taxability_reason: "standard_rated",
      taxable_amount: 1000,
    },
  ],
pallid sable
#

yes I was expecting it to see it included tho

random obsidian
#

ah, inclusive vs exclusive tax

pallid sable
#

yes

#

I see that there is a tax_behavior in the line_item which default to exclusive

#

so this seems to be the issue, but how should I handle it? Should I know the convention in each country and provide one or the other?

random obsidian
pallid sable
#

consider that this is Connect

random obsidian
#

I don't think it should matter in this case. I think this is going to take a while for me to look into, can you write in and we'll get back to you about it. I'm going to share a DM with you where you can write in

ionic remnantBOT
#

Hello @pallid sable, we have sent you a direct message, please check it at https://discord.com/channels/@me/1349549208709107785

  • πŸ”—The message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.