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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GetTaxZoneCountry class to be able to use country based tax zones #1248

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

webcraft
Copy link
Contributor

In the GetTaxZone class, there is logic for dealing with postcode-based and state-based tax zones, but not for country-based ones. This PR aims to fill this gap.

I've followed the general concept of the existing GetTaxZonePostcode and GetTaxZoneState classes for the new GetTaxZoneCountry class.

I've assumed that country comes at the bottom of the priority hierarchy: if an address has a postcode matching a TaxZonePostcode, that takes priority over state and country, after that, state takes priority over country, and only if there's no matching tax zone for postcode or state, we're gonna look for a TaxZoneCountry. This should also help ensure that this is not a breaking change.

I've also added some tests.

@vercel
Copy link

vercel bot commented Sep 14, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lunar-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 14, 2023 7:57am

@alecritson alecritson merged commit 644c72c into lunarphp:0.5 Sep 21, 2023
12 checks passed
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.

3 participants