Closed grantsingleton closed 3 months ago
Anyone from stripe? Express checkout is currently not usable if you need to calculate tax from the shipping address.
Do you have a reproduction of this in test mode that you can share? This does not align with my expectations and behaviour for updating the Express Checkout Element.
@brendanm-stripe how would you like me to share that? What I shared is the code that im running with the behavior. Do I need to host something and share a link?
To reproduce you just need to update the payment amount in onShippingAddressChange to higher than you started with.
Actually I chatted with a teammate who helped point out that it looks like you're using an "intent first" pattern supplying the payment intent client secret up front. Note that our recommended integration is using a "deferred" approach with the intent created at the end just before confirming.
The way you've configured things should work, but requires you to update your payment intent amount
server side (perhaps in your updateCheckout()
), then client-side you need to retrieve the latest details using elements.fetchUpdates()
instead of elements.update(...)
.
@brendanm-stripe that makes sense. I just confirmed using fetchUpdates()
works as expected. Thank you!!
What happened?
Issue
I need the shipping address to calculate tax. I listen to onShippingAddressChange, use the address to calculate tax and update the total amount to reflect the increase in price due to tax.
The amount wont update in the apple pay modal unless the amount is less than the previous amount. The line items do update with the correct tax amount, but the price doesnt change.
In this example the after tax price is $19.02, but it does not reflect.
Full Code Snippet
Environment
No response
Reproduction
No response