#ram._777

1 messages ยท Page 1 of 1 (latest)

craggy bluffBOT
thick kindle
#

Can you illustrate this scenario in an example?

toxic creek
#

sure, I started with something like this:

stripe.checkout.sessions.create({
    customer: customerId,
    mode: "subscription",
    line_items: [
      {
        price: priceId,
        quantity: 1,
      },
    ],
    payment_method_collection: "if_required",

This worked well, but I need to add a tax rate for one specific country. I registered the tax rate on the dashboard and added it on dynamic_tax_rates in the line_item. However, I got an error that only some countries are supported (the documentation mentions it too).
https://stripe.com/docs/billing/taxes/collect-taxes?tax-calculation=tax-rates

Learn how to collect and report taxes for recurring payments.

#

so the problem is- I need to add taxes dynamically (based on the country input in the payment form), but couldn't find documentation on the right way to do it

thick kindle
toxic creek
#

ok, so i need ti implement the form myself?

#

I've already started to do that so 2 related questions if that's ok:

#
  1. Can I use the address element to only include the country? (and listen to that in my client in order to change the tax when needed, alternatively listen to changes in the payment element's country select)
#
  1. What's the correct way to update a subscription (and invoice and payment intent) tax rate? I tried a few ways but ended up just creating a new subscription with every plan/tax rate change
#
  1. Is there a way for me to show the actual amount needed to pay (hopefully with tax etc using Stripe Elements? (or do i have to fetch that info and render it myself?)
#

thanks for the quick response btw! I tried emailing this question to support and got no relevant responses

thick kindle
#
  1. Can I use the address element to only include the country? (and listen to that in my client in order to change the tax when needed, alternatively listen to changes in the payment element's country select)
    Address Element is meant to full address and can't be just collecting country only. You can use own text box to create country only.
  1. What's the correct way to update a subscription (and invoice and payment intent) tax rate? I tried a few ways but ended up just creating a new subscription with every plan/tax rate change
    If the invoice is finalised, the tax rate can't be changed. However, the tax rate update on the subscription will be applied to the next invoice.

For updating the plan, you can refer to the guide here: https://stripe.com/docs/billing/subscriptions/upgrade-downgrade

  1. Is there a way for me to show the actual amount needed to pay (hopefully with tax etc using Stripe Elements? (or do i have to fetch that info and render it myself?)
    Those information should be fetched and render yourself with Element integration

Learn how to upgrade and downgrade subscriptions by changing the price.

toxic creek
#

thanks!

#

regarding 2- I actually think now recreating the subscription is not an option because it then rerenders the form and resets the country select

#

what's the right way to do that? I can't add my own select box because the tax application needs to match the one on the stripe form

thick kindle
toxic creek
#

ok thanks, that sounds like it can work (I can break the flow in two, first collecting the billing address and then create the subscription with static tax)

#

another question- can i create a checkout session strictly without a country selector?

thick kindle
#

I'm afraid that's not possible in Checkout Session

toxic creek
#

thank you

#

one last question if that's ok: is there an option I might have missed with only collection country in AddressElement?

thick kindle
#

As mentioned earlier, Address Element is meant for collecting full address and can't be just collecting country only

toxic creek
#

might have missed that, sorry ๐Ÿ˜ฌ

#

thanks for the help! really appreciate it ๐Ÿ™‚