Skip to content
This repository has been archived by the owner on Mar 17, 2020. It is now read-only.

Avatax module validateAddress not checking state (from @alex974) #4

Open
transitguru opened this issue Feb 25, 2015 · 0 comments
Open

Comments

@transitguru
Copy link

@alex974 sent us this:

In avalaratax.php , method public function validateAddress(Address $address) , one issue i got is that it doesn't tell the customer a warning for choosing the wrong state(it does warn for zip code country etc) , but at the same time avalara call do return the right state.

The issue is that Avalara doesn't warn you nor does it change your state in you address and that lead a wrong address being save and again even tough the avalara call will return the rigth state if it was California and you put Colorado , California is return(just for avatax) but user keep the colorado state save in his address .

That can quickly create issue it you use any other module like i don't know UPS , FEDEX, DHL or even for invoice , if you manually ship because you are using a wrong address.

What i did which is super ugly but work is add
if the current state different than the return state , i set a warning to true
if ($avalaraAddress->getRegion() != $addresses->ValidAddress->getRegion()) {
$warning = true;
}
//then in resultcode
if($warning) {
$buffer['ResultCode'] = 'Error';
$buffer['Messages']['Name'][] = Tools::safeOutput('Wrong state');
$buffer['Messages']['Summary'][] = Tools::safeOutput('The State you selected does not match your address');
}

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

No branches or pull requests

1 participant