You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 17, 2020. It is now read-only.
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');
}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
@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');
}
The text was updated successfully, but these errors were encountered: