/** * Get the shipping address for the request * * @param OnePica_AvaTax_Model_Sales_Quote_Address $address * @return OnePica\AvaTax16\Document\Part\Location\Address */ protected function _getDestinationAddress($address) { $street1 = $address->getStreet(1); $street2 = $address->getStreet(2); $city = (string) $address->getCity(); $zip = $address->getPostcode(); $state = Mage::getModel('directory/region')->load($address->getRegionId())->getCode(); $country = $address->getCountry(); $address = $this->_newAddress($street1, $street2, $city, $state, $zip, $country); return $address; }
/** * Sets attributes from the Mage address on the AvaTax Request address. * * @return $this */ protected function _convertRequestAddress() { if (!$this->_requestAddress) { $this->_requestAddress = new Address(); } $this->_requestAddress->setLine1($this->_mageAddress->getStreet(1)); $this->_requestAddress->setLine2($this->_mageAddress->getStreet(2)); $this->_requestAddress->setCity($this->_mageAddress->getCity()); $this->_requestAddress->setRegion($this->_mageAddress->getRegionCode()); $this->_requestAddress->setCountry($this->_mageAddress->getCountry()); $this->_requestAddress->setPostalCode($this->_mageAddress->getPostcode()); return $this; }