2013-11-20 2 views
0

나는 Magento 모듈을 만들어서 Paypal에서 오는 금지 된 고객을 확인했습니다. 그리고 난 returnfromPaypal 기능 오버라이드 :Magento - 검토하기 전에 Paypal chack 고객 이메일

public function returnFromPaypal($token) 
{ 
    $this->_getApi(); 
    $this->_api->setToken($token)->callGetExpressCheckoutDetails(); 

    // import billing address 
    $billingAddress = $this->_quote->getBillingAddress(); 
    $exportedBillingAddress = $this->_api->getExportedShippingAddress(); 

     foreach ($exportedBillingAddress->getExportedKeys() as $key) { 

      if (array_key_exists($key, $dataOrg)) 
      {     
       $billingAddress->setData($key, $dataOrg[$key]); 

      } 
     } 
     $this->_quote->setBillingAddress($billingAddress); 

    if($this->isCustomerBanned($this->_quote->getBillingAddress()->getEmail())) 
     { 
      Mage::throwException(Mage::helper('paypal')->__('Sorry!, We cant process you order this time.')); 
     } 
     else 
     { 
      parent::returnFromPaypal($token); 

     } 

} 

을하지만 $billingAddress가 비어 있습니다 인용 $this->_quote->getBillingAddress()->getEmail()에 처음 저장할 때 문제입니다.

$exportedBillingAddress에서 고객 이메일을 직접받을 수있는 다른 방법이 있는지 알고 싶습니다. 설명서를 검색했습니다. 아무것도 찾지 못했습니다. 미리 감사드립니다.

답변

0

나는 그것을 알아낼 수있었습니다. 내가 원하는 건 returnfromPaypal() 대신에 prepareOrderReview()을 오버라이드하는 것뿐이었습니다.