/** * Sets attributes from the AvaTax Response address on the Mage address. * * @return $this */ protected function _convertResponseAddress() { $street = array($this->_responseAddress->getLine1(), $this->_responseAddress->getLine2()); $region = Mage::getModel('directory/region')->loadByCode($this->_responseAddress->getRegion(), $this->_mageAddress->getCountryId()); $this->_mageAddress->setStreet($street)->setCity($this->_responseAddress->getCity())->setRegionId($region->getId())->setPostcode($this->_responseAddress->getPostalCode())->setCountryId($this->_responseAddress->getCountry())->save()->setAddressNormalized(true); return $this; }