From 1f9268fdb19129426222d2da3d072144868bd149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Rouleau?= Date: Thu, 28 Jan 2021 01:24:28 -0500 Subject: [PATCH] Fix bug in getOrderSignature() Similar to #24. `getOrderSignature()` currently ignores the state, which means that changing the state of an address whose tax has already been calculated will incorrectly use the cached result. --- src/services/SalesTaxService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/services/SalesTaxService.php b/src/services/SalesTaxService.php index 6124e56..916936c 100644 --- a/src/services/SalesTaxService.php +++ b/src/services/SalesTaxService.php @@ -746,9 +746,10 @@ private function getOrderSignature(Order $order) $address1 = $order->shippingAddress->address1; $address2 = $order->shippingAddress->address2; $city = $order->shippingAddress->city; + $state = $this->getState($order->shippingAddress); $zipCode = $order->shippingAddress->zipCode; $country = $this->getCountry($order->shippingAddress); - $address = $address1.$address2.$city.$zipCode.$country; + $address = $address1.$address2.$city.$state.$zipCode.$country; $lineItems = ''; foreach ($order->lineItems as $lineItem)