#ronho
1 messages · Page 1 of 1 (latest)
i can see the new postal/zip attached to the customer
When you customer go back and correct the mistake, what is the status of the Invoice?
stil in draft
in_1OCvAGBrTZhN2ebMUWqwdhej
the postal code on the customer is in BC, so theoretically it should charge GST/PST instead of HST
just not sure how to get the tax_rate to update
Have you enabled this when call Update Invoice API? https://stripe.com/docs/api/invoices/update#update_invoice-automatic_tax
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
yeah
this is the code snippet after i modified the customer
invoice_details = stripe.Invoice.modify(
draft_invoice,
automatic_tax={"enabled": True},
expand = ['total_tax_amounts.tax_rate'],
)
Umm can you provide its request id? req_xxx
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
i think this might be it
Hmm I see, and txr_1OCv6rBrTZhN2ebModynXhsn on the response is the old tax rate?
yes thats correct
Just idea but can you try to turn off automatic_tax and then turn on again, via 2 API calls
Btw this says you can just finalize after update the address
Could you try in test mode to see if it's updated to the new address?
ok i can try to turn it off and on
im not sure about the second suggestion about finalizing after updating.. what do i do if the updated address is still invalid?
The second suggestion is to update the address to correct value (correct the mistake) and then try to finalize again. Let's just try it to see if it still give you the previous error
ok turning it off and on actually worked
would that result in extra charges? i guess one extra charge since stripe tax has to recalculate?
or not really since the first one didn't calculate in the first place
I don't think so though. But any the second suggestions mean if you just proceed to finalize (without tunring off and on) you can still have the same effect. Can you quickly try it?
ok
wait so
so right now my flow is
enter card info (and gather postal/zip) -> show the confirmation screen with tax -> finalize and pay
i wait till the last moment to finalize
so i need to move up my finalization step basically?
but when stripe tries to calculate tax, it gives me an error
Which step is this on your above flow?
during finalize and pay
but we would like to display the updated tax during the confirmation screen, before we finalize
because the user can still back out and change their card info, and then we'd have to update the tax
and if we finalize before they hit confirm and pay, then we cannot update the tax values
Yes so you would want them to inpurt again back in the previous screen, then proceeed again to the finalize and pay screen
right, but once i get to the confirm page, i haven't finalized yet
but i would need the updated tax values already
I know, but the suggestion means if you finalize there, with your customer already update the newest address, it should automatically use the updated value
Can you just try it in test mode?
ok, so basically try to finalize on the confirm screen
so if i finalize on the confirm screen then yes i dont need to turn it off and on
but it causes the other issue where if the customer goes back again to update their address then the invoice is locked
Why? The Invoice is still in draft and how can it be locked?
but you said to try to finalize again right?
so now its:
- user enters bad postal
- try to finalize on confirm screen, fails
- goes back to correct
- go to confirm screen again
- try to finalize
- finalize successfully
- user presses "confirms" invoice gets paid
Yeah this flow looks great to me. Do you mean even after this the customer can go back again and update their address?
yea that is correct
the customer can still go back to change their payment at this point
which is why i finalize so late in the flow, so that if the customer returns to a previous screen i can still update the invoice
Finalized Invoice can't be changed anyway. So if you want to provide the flexibility, should be before finalizing