/**
  * Perform the web request for address validation and return the response
  * @param Mage_Customer_Model_Address_Abstract $address
  * @return EbayEnterprise_Address_Model_Validation_Response|null
  */
 protected function _makeRequestForAddress(Mage_Customer_Model_Address_Abstract $address)
 {
     $config = $this->_helper->getConfigModel();
     $api = $this->_coreHelper->getSdkApi($config->apiService, $config->apiOperation);
     try {
         $this->_prepareApiForAddressRequest($address, $api);
         $api->send();
         return $this->_getValidationResponse($api);
     } catch (NetworkError $e) {
         $logMessage = 'Address validation service returned empty response.';
         $this->_logger->warning($logMessage, $this->_context->getMetaData(__CLASS__));
     } catch (Exception $e) {
         $logMessage = 'Unexpected exception from SDK.';
         $this->_logger->warning($logMessage, $this->_context->getMetaData(__CLASS__));
         $this->_logger->logException($e, $this->_context->getMetaData(__CLASS__, [], $e));
         throw $e;
     }
     return null;
 }
 /**
  * Perform the web request for address validation and return the response
  * @param Mage_Customer_Model_Address_Abstract $address
  * @return EbayEnterprise_Address_Model_Validation_Response|null
  */
 protected function _makeRequestForAddress(Mage_Customer_Model_Address_Abstract $address)
 {
     $config = $this->_helper->getConfigModel();
     $api = $this->_coreHelper->getSdkApi($config->apiService, $config->apiOperation);
     $logger = $this->_logger;
     $logContext = $this->_context;
     try {
         $this->_prepareApiForAddressRequest($address, $api);
         $api->send();
         return $this->_getValidationResponse($api);
     } catch (InvalidPayload $e) {
         $logMessage = 'Invalid payload for address validate operation. See exception log for more details.';
         $logger->warning($logMessage, $logContext->getMetaData(__CLASS__, ['exception_message' => $e->getMessage()]));
         $logger->logException($e, $logContext->getMetaData(__CLASS__, [], $e));
         throw $e;
     } catch (NetworkError $e) {
         $logMessage = 'Caught network error sending the address validation. See exception log for more details.';
         $logger->warning($logMessage, $logContext->getMetaData(__CLASS__, ['exception_message' => $e->getMessage()]));
         $logger->logException($e, $logContext->getMetaData(__CLASS__, [], $e));
         // Allow network errors to be bypassed, exception is caught and not re-thrown.
     } catch (UnsupportedOperation $e) {
         $logMessage = 'The address validate operation is unsupported in the current configuration. See exception log for more details.';
         $logger->warning($logMessage, $logContext->getMetaData(__CLASS__, ['exception_message' => $e->getMessage()]));
         $logger->logException($e, $logContext->getMetaData(__CLASS__, [], $e));
         throw $e;
     } catch (UnsupportedHttpAction $e) {
         $logMessage = 'The address validate operation is configured with an unsupported HTTP action. See exception log for more details.';
         $logger->warning($logMessage, $logContext->getMetaData(__CLASS__, ['exception_message' => $e->getMessage()]));
         $logger->logException($e, $logContext->getMetaData(__CLASS__, [], $e));
         throw $e;
     } catch (Exception $e) {
         $logMessage = 'Encountered unexpected exception from address validate operation. See exception log for more details.';
         $logger->warning($logMessage, $logContext->getMetaData(__CLASS__, ['exception_message' => $e->getMessage()]));
         $logger->logException($e, $logContext->getMetaData(__CLASS__, [], $e));
         throw $e;
     }
     return null;
 }
 /**
  * Prepare the request payload - inject address and validation header data.
  *
  * @return self
  */
 public function prepareRequest()
 {
     $this->_helper->transferAddressToPhysicalAddressPayload($this->_address, $this->_requestPayload->setMaxSuggestions($this->_helper->getConfigModel()->maxAddressSuggestions));
     return $this;
 }