Php Magento-Paypal chack审核前发送客户电子邮件
我已经创建了一个自定义Magento模块来检查来自Paypal的被禁止的客户。我覆盖了returnfromPaypal函数: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
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()