Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Magento-Paypal chack审核前发送客户电子邮件_Php_Magento_Paypal - Fatal编程技术网

Php Magento-Paypal chack审核前发送客户电子邮件

Php Magento-Paypal chack审核前发送客户电子邮件,php,magento,paypal,Php,Magento,Paypal,我已经创建了一个自定义Magento模块来检查来自Paypal的被禁止的客户。我覆盖了returnfromPaypal函数: public function returnFromPaypal($token) { $this->_getApi(); $this->_api->setToken($token)->callGetExpressCheckoutDetails(); // import billing address $bi

我已经创建了一个自定义Magento模块来检查来自Paypal的被禁止的客户。我覆盖了returnfromPaypal函数:

    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
第一次保存在quote中时,
$this->\u quote->getBillingAddress()->getEmail()
将为空

我想知道是否有其他方法可以直接从
$exportedBillingAddress
获取客户电子邮件我搜索了相关文档。但什么也没找到。
提前谢谢

我想起来了。我所需要的只是重写
prepareOrderView()
,而不是
returnfromPaypal()