Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stripe Tax: Update customer address when needed #19882

Closed
wants to merge 1 commit into from

Conversation

verement
Copy link

Use the billing address entered during checkout to assess the customer's location for Stripe Tax. This is also needed to avoid an error if an existing customer lacks an address.

Got some code for us? Awesome 馃帄!

Please include a description of your change & check your PR against this list, thanks!

  • There's a clear use-case for this code change, explained below
  • Commit message has a short title & references relevant issues
  • The build will pass (run yarn test and yarn lint)

We appreciate your contribution!


The Stripe Tax integration, when enabled, works well for new subscriptions. It does not work when an existing member tries to upgrade their subscription and Stripe鈥檚 customer record does not already have address information Stripe can use to determine a tax jurisdiction, resulting in the following error:

Unable to initiate checkout session

Error: Automatic tax calculation in Checkout requires a valid address on the Customer. Add a valid address to the Customer or set either customer_update[address] to 'auto' or customer_update[shipping] to 'auto' to save the address entered in Checkout to the Customer.

This change instructs Stripe to update and use the customer鈥檚 billing address entered during checkout to determine the customer鈥檚 location for Stripe Tax. It does not include the same instruction when Stripe does not already have a customer record, as that will result in a different error (Error: customer_update can only be used with customer.)

Use the billing address entered during checkout to assess the customer's
location for Stripe Tax. This is also needed to avoid an error if an
existing customer lacks an address.
@ronaldlangeveld
Copy link
Member

Hi @verement! Thank you so much for your time creating this PR.
A similar fix has been merged by the team and the issue should be resolved.
Take care! 鈽猴笍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants