#clarity-tax-checkout

1 messages · Page 1 of 1 (latest)

cedar bisonBOT
#

Hello! We'll be with you shortly. 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.

spark lagoon
#

@patent relic Hello! Can I ask you to provide more specific details like an exact Checkout Session that I can look at? Also did you properly configure Stripe Tax in your account first? You have to configure the right registrations and such first https://dashboard.stripe.com/tax/registrations

#

clarity-tax-checkout

patent relic
#

Okay that's what I think is going wrong. Didn't see this in the documentation. I am including my checkout session object just in case you have notes but I am pretty sure thats the issue.

const session = await stripe.checkout.sessions.create({
        mode: 'payment',
        payment_method_types: ['card'],
        billing_address_collection: 'auto',
        automatic_tax: {
          enabled: true,
        },
        shipping_address_collection: {
          allowed_countries: ['US', 'CA'],
        },
        shipping_options: [
          {
            shipping_rate_data: {
              type: 'fixed_amount',
              fixed_amount: {
                amount: 1200,
                currency: 'usd',
              },
              display_name: 'Flat shipping',
              delivery_estimate: {
                minimum: {
                  unit: 'business_day',
                  value: 7,
                },
                maximum: {
                  unit: 'business_day',
                  value: 10,
                },
              },
            },
          },
          {
            shipping_rate: 'shr_1ODClDD2rF1QyUrxuGDoaHZs',
          },
        ],
        success_url: `${req.headers.origin}/success?session_id={CHECKOUT_SESSION_ID}`,
        cancel_url: `${req.headers.origin}`,
        line_items,
        metadata,
      });
spark lagoon
#

yeah petty sure it's the issue too but you'd have to check first

patent relic
#

I did update to collect sales tax in california but its still not calculating. does the registration maybe take some time to process?

spark lagoon
#

No it doesn't. sorry you're going super fast here, try to go one step at a time and fully understand what you are doing

#

First remove everything about shipping, try the simplest approach possible and confirm it work with just one Price id and nothing else and report back

patent relic
#

I removed the shipping options array and the metadata. Added a single product excluding the images, leaving only name, id, price, and currency. Still no calculation.

spark lagoon
#

Cool so now share your exact code, exact Price id and exact Checkout Session id so I can have a look

#

Not sure what it could be just yet (it works fine for me locally)

patent relic
#

Let me check one thing with my Tax id and get back to you. My client may have provided incorrect information. Thank you for your help.

spark lagoon
#

sure thing!

patent relic
#

Okay I did verify the tax info seems to be okay. This is a log of my session. Its status is open. Let me know if you need a completed?

#
{
  id: 'cs_test_a1OD2rCsUBTFnApPiT7wK5HuXtQQfRElwNQdpA544UytcUjnD9uqiLHkry',
  object: 'checkout.session',
  after_expiration: null,
  allow_promotion_codes: null,
  amount_subtotal: 2000,
  amount_total: 2000,
  automatic_tax: { enabled: true, status: 'requires_location_inputs' },
  billing_address_collection: 'auto',
  cancel_url: 'http://localhost:3000',
  client_reference_id: null,
  client_secret: null,
  consent: null,
  consent_collection: null,
  created: 1700527653,
  currency: 'usd',
  currency_conversion: null,
  custom_fields: [],
  custom_text: {
    shipping_address: null,
    submit: null,
    terms_of_service_acceptance: null
  },
  customer: null,
  customer_creation: 'if_required',
  customer_details: null,
  customer_email: null,
  expires_at: 1700614053,
  invoice: null,
  invoice_creation: {
    enabled: false,
    invoice_data: {
      account_tax_ids: null,
      custom_fields: null,
      description: null,
      footer: null,
      metadata: {},
      rendering_options: null
    }
  },
#
livemode: false,
  locale: null,
  metadata: { '122136': '{"Quantity":1,"Price":2000}' },
  mode: 'payment',
  payment_intent: null,
  payment_link: null,
  payment_method_collection: 'always',
  payment_method_configuration_details: null,
  payment_method_options: {},
  payment_method_types: [ 'card' ],
  payment_status: 'unpaid',
  phone_number_collection: { enabled: false },
  recovered_from: null,
  setup_intent: null,
  shipping_address_collection: { allowed_countries: [ 'US', 'CA' ] },
  shipping_cost: null,
  shipping_details: null,
  shipping_options: [],
  status: 'open',
  submit_type: null,
  subscription: null,
  success_url: 'http://localhost:3000/success?session_id={CHECKOUT_SESSION_ID}',
  total_details: { amount_discount: 0, amount_shipping: 0, amount_tax: 0 },
  ui_mode: 'hosted',
  url: 'https://checkout.stripe.com/c/pay/cs_test_a1OD2rCsUBTFnApPiT7wK5HuXtQQfRElwNQdpA544UytcUjnD9uqiLHkry#fidkdWxOYHwnPyd1blpxYHZxWjA0SENJUWxBN3dDNFR8UHd9NWxtTjFWUUpsVk9DSGhNMEpwTzxpXFw9UVZ1cHR0cFRdcHZOdWtCQnF3QnFXMUI0andMbl9BPHVvSWtOaFBjUFdkQk5cT1c3NTVWd0tSQn1wRicpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl'
}
spark lagoon
#

Okay so when I load that last URL there's a clear UI that talks about tax calculation right there. Sorry I thought you were saying Tax wasn't working?

#

So your problem is just that you get $0 tax every time instead?

patent relic
#

correct

#

sorry if that wasnt clear

spark lagoon
#

all good, so yeah I'm fairly certain it's because you didn't configure Stripe Tax with the relevant registrations and such but looking

cedar bisonBOT
spark lagoon
patent relic
#

yep thats working now. thats a little silly. thanks for taking the time though. Thought it had been filled out.