Skip to content

Commit

Permalink
Merge pull request #26 from surprisehighway/release/v2.1.2
Browse files Browse the repository at this point in the history
Release/v2.1.2
  • Loading branch information
imagehat authored Jan 5, 2021
2 parents 2df2566 + c701256 commit 6cb070c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 2.1.2
### Fixed
- Skip address validation for estimated addresses to avoid errors with incomplete addresses. [#22](https://github.com/surprisehighway/craft-avatax/issues/22)
- Fixed an issue where updating the shipping state did not refresh the cached tax. [#24](https://github.com/surprisehighway/craft-avatax/issues/24)
- Fixed an issue where addresses returned by Avalara as unresolved were still considered valid. [#25](https://github.com/surprisehighway/craft-avatax/issues/25)

## 2.1.1
### Fixed
- Fixed an issue where settings fields were readonly even when not being overridden by config file. [#20](https://github.com/surprisehighway/craft-avatax/issues/20)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "surprisehighway/craft-avatax",
"description": "Calculate and add sales tax to an order's base tax using Avalara's Avatax service.",
"type": "craft-plugin",
"version": "2.1.1",
"version": "2.1.2",
"keywords": [
"craft",
"cms",
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/JsonController.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function actionValidateAddress()

$response = $taxService->getValidateAddress($address);

if(!empty($response->validatedAddresses) || isset($response->coordinates))
if(!empty($response->validatedAddresses) && isset($response->coordinates))
{
return $this->asJson([
'success' => true,
Expand Down
10 changes: 8 additions & 2 deletions src/services/SalesTaxService.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,15 @@ public function validateAddress(Address $address)
return false;
}

if($address->isEstimated) {
Avatax::info(__FUNCTION__.'(): Skipping address validation for estimated shipping.');

return false;
}

$response = $this->getValidateAddress($address);

if(!empty($response->validatedAddresses) || isset($response->coordinates))
if(!empty($response->validatedAddresses) && isset($response->coordinates))
{
return true;
}
Expand Down Expand Up @@ -768,6 +774,6 @@ private function getAddressSignature(Address $address)
$zipCode = $address->zipCode;
$country = $this->getCountry($address);

return md5($address1.$address2.$city.$zipCode.$country);
return md5($address1.$address2.$city.$state.$zipCode.$country);
}
}

0 comments on commit 6cb070c

Please sign in to comment.