Ejemplo n.º 1
0
 public function callValidateQuoteAddress(Mage_Sales_Model_Quote_Address $address)
 {
     /** @var Aoe_AvaTax_Helper_Soap $helper */
     $helper = Mage::helper('Aoe_AvaTax/Soap');
     $request = new AvaTax\ValidateRequest($this->getAddress($address), \AvaTax\TextCase::$Mixed, true);
     $request->setTaxability(true);
     Mage::dispatchEvent('aoe_avatax_soapapi_validate_quote_address_before', array('request' => $request, 'address' => $address));
     return $this->callValidate($address->getQuote()->getStore(), $request);
 }
Ejemplo n.º 2
0
 /**
  * @param \AvaTax\ValidateRequest $soapRequest
  *
  * @return array
  */
 public function normalizeValidateRequest(AvaTax\ValidateRequest $soapRequest)
 {
     $soapAddress = $soapRequest->getAddress();
     $request = array('Address' => array('Line1' => $soapAddress ? $soapAddress->getLine1() : '', 'Line2' => $soapAddress ? $soapAddress->getLine2() : '', 'Line3' => $soapAddress ? $soapAddress->getLine3() : '', 'City' => $soapAddress ? $soapAddress->getCity() : '', 'Region' => $soapAddress ? $soapAddress->getRegion() : '', 'Country' => $soapAddress ? $soapAddress->getCountry() : '', 'PostalCode' => $soapAddress ? $soapAddress->getPostalCode() : ''), 'TextCase' => $soapRequest->getTextCase(), 'Coordinates' => $soapRequest->getCoordinates());
     return $this->recursiveKeySort($request);
 }