#Rooders - Checkout + Tax

1 messages · Page 1 of 1 (latest)

main moon
#

Hello, can you show me your code for how you are creating these Checkout Sessions?

low rampart
#

Yes let me get that

#
session = await stripe.checkout.sessions.create({
        mode: "subscription",
        payment_method_types: ["card"],
        customer: customerId,
        line_items: [
          {
            price: priceId,
            quantity: 1,
          },
        ],
        subscription_data,
        allow_promotion_codes: true,
        success_url: `https://${hostname}/payment/success?session_id={CHECKOUT_SESSION_ID}`,
        cancel_url: `https://${hostname}/payment/canceled`,
        client_reference_id: user.id,
      });
#

I found some sources in doc showing this:

  automatic_tax: {
    enabled: true,
  },

But in my tests when I use "bacs_debit" and not "card" it seems to work properly

#

Is it something mandatory for card?

#

Or maybe there is some issue with the fact that my customer is already existing without address?

main moon
#

Can you clarify on that last question? Are you saying VAT worked with a pre-existing customer but not one that the Checkout Session created?

low rampart
#

Sorry... I mean that I pre-create Customer (before Checkout Session creation) in order to have capability to not multiply customers in Stripe DB for the same user in my platform. Then I create the Checkout Session depending on user input to payment_method_types: ["card"] or payment_method_types: ["bacs_debit"]. In the last case scenario it seems that VAT is correctly calculated while it is not for the first case (for card).

#

But in both cases I do not have address for the Customer.

#

But for bacs_debit an address is required so maybe the difference comes from there and the Country + Post Code does't suffice to calculate VAT?

#

Code for bacs_debit part:

session = await stripe.checkout.sessions.create({
        mode: "setup",
        payment_method_types: ["bacs_debit"],
        customer: customerId,
        success_url: `https://${hostname}/payment/success?session_id={CHECKOUT_SESSION_ID}`,
        cancel_url: `https://${hostname}/payment/canceled`,
        client_reference_id: user.id,
      });
main moon
#

As far as I know, Checkout should make sure to ask for any info needed to calculate tax. To clarify, is anything else different between these calls other than specifying card or bacs_debit?

#

Also out of curiosity, have you created a Checkout Session that uses both to see if there is a difference between them within the same session?

low rampart
#

There is no difference between these calls except the fact that the mode for bacs_debit have to be setup and have obviously other subcription handling on the webhook part in order to use the Intent and create the actual Subscription.

#

And to respond to your second question: you cannot (except if something has changed) because unfortunately bacs_debit is not handled by Checkout form in mode subscription...

#

I had a chat on support about this topic and the way I implemented it was the only way: 1. setup intent 2. create subscription

#

As far as I know, Checkout should make sure to ask for any info needed to calculate tax.
That was my thought too but someone succeed to create a subscription without VAT with card method that is why I am here now 😅

main moon
#

Sorry I dropped off of this thread for a while. Do you have the ID of both of these subscriptions?

#

I was a bit too busy to try to reproduce this myself before but now I am working on that and will let you know what I can find.

low rampart
#

You mean in production?

#

Maybe I can try to create this in test env and give you IDs

main moon
#

Wherever you saw the subscription without VAT

low rampart
#

sub_1LKlOWFPuxSmQJV9ji9EfJhU

#

For the other I need to dig...

#

And I have kid to pick up so... To be continued... :/

main moon
#

No worries, thanks for the ID, I will let you know what I can find here in this thread

#

We can follow up on this through email instead of Discord if you would like. Just write in to support@stripe.com, mention you talked to me, and then DM me your email address so I can grab the email