#Th3FalleN
1 messages ยท Page 1 of 1 (latest)
long time no see....
I'm not super familiar with React but let's see what we get
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
- update the subscription,
- get a new setup intent for that updated subscription
- 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.
Can you try testing this out using the elements.fetchUpdates() function? This should update the Payment Element based on changes to the associated intent:
https://stripe.com/docs/js/elements_object/fetch_updates
ah, so with that my flow would now be...
- update the subscription
- call
fetchUpdateson the elements - then proceed with payment as usual
๐ 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
๐ i'll give it a shot and report back if this thread is still open.
๐
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?
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.
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?
Oh I thought you were using the Avalara plugin where they do this all for you.
whoa whoa whoa there's a plugin that does it for me?
Yes ๐
I believe https://www.avalara.com/us/en/products/integrations/stripe-invoicing.html is info on the plugin
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
oh trust me i would LOVE it to use your tax product but that is not my call ๐ฟ
I understand