#Th3FalleN

1 messages ยท Page 1 of 1 (latest)

sleek rainBOT
icy needle
#

long time no see....

abstract adder
#

I'm not super familiar with React but let's see what we get

icy needle
#

the left is obviously stripe elements which require a setup or payment intent

#

in our case that is linked to a subscription

#

but! the right pane lets them adjust seats and intervals (of the current subscription) and my brain is melting trying to understand how i could accomplish that since the elements require the setup intent BUT cannot be updated. so if i understand right when they hit purchase, i'd have to

  1. update the subscription,
  2. get a new setup intent for that updated subscription
  3. rerender the elements with their old values somehow and then submit them so i can do the await const { error, paymentIntent } = await stripe.confirmPayment({`stuff
#

im praying there is a more sane way to handle this case.

abstract adder
icy needle
#

ah, so with that my flow would now be...

  1. update the subscription
  2. call fetchUpdates on the elements
  3. then proceed with payment as usual
winged thicket
#

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

#

Yep the above is correct

#

fetchUpdates should handle any changes to the UI such as updating the wallet modal or if other PaymentMethods were now available (certain PaymentMethod types have amount limitations).

#

Mostly it won't change but yes this is the correct flow

icy needle
#

๐Ÿ‘ i'll give it a shot and report back if this thread is still open.

winged thicket
#

๐Ÿ‘

icy needle
#

actually regarding updating subscriptions, we use a third party tax provider (avalara) is there a way im missing to give that tax amount to the subscription so it's total is right?

winged thicket
#

Hmm I'm actually not positive how Avalara responds to updates in terms of calculating tax for you.

#

You would likely need to talk to Avalara in this case so you can confer with them for your integration if you are creating a Sub then performing updates and need re-calculation of tax.

icy needle
#

right, im more asking how would i update the subscription to tell it what the tax should be?

#

would i use it's default_tax_rates field?

winged thicket
#

Oh I thought you were using the Avalara plugin where they do this all for you.

icy needle
#

whoa whoa whoa there's a plugin that does it for me?

winged thicket
#

Yes ๐Ÿ™‚

icy needle
#

well then.... ignore that question

#

thank you!

winged thicket
#

That said, we recommend just using Stripe Tax since then you don't have to rely on a third party and their integration with us!

#

But you can go either way

icy needle
#

oh trust me i would LOVE it to use your tax product but that is not my call ๐Ÿ˜ฟ

winged thicket
#

I understand