我无法使用 Paypal Payments Pro 在 Magento 1.6.1 上调试支付网关。它一直失败并显示消息“处理您的订单时出错。请联系我们或稍后再试”。
我已经尝试检查错误日志,并在下面发布了结果。第一次使用这个系统和更多的前端开发,但我正在设法跟随 php。
它似乎失败的关键线是
$this->_importFromResponse($this->_doDirectPaymentResponse, $response);
有人可以准确解释这条线的作用吗?调查这个过程的下一步应该是什么明智的?任何额外的 paypal / magento 特定知识都非常受欢迎!
我猜既然创建了数组,那么转移到贝宝可能会出现问题(我的 api 签名应该没问题 - 快速网关有效) - 我将如何确认或反驳这个假设?
谢谢
(var/exception.log 的前 8 行带有引用的代码片段,以及由 Mage::log() 函数生成的 var/system.log 中的一些额外内容。)
exception 'Mage_Core_Exception' with message 'There was an error processing your order.
Please contact us or try again later.' in /var/www/magento/app/Mage.php:563
堆栈跟踪:
#0 /var/www/magento/app/code/core/Mage/Paypal/Model/Api/Nvp.php(974):
Mage::throwException('There was an er...')
if (!$this->_validateResponse($methodName, $response)) {
Mage::logException(new Exception(
Mage::helper('paypal')->__("PayPal response hasn't required fields.")
));
Mage::throwException(Mage::helper('paypal')->__('There was an error processing
your order.
Please contact us or try again later.'));
}
#1 /var/www/magento/app/code/core/Mage/Paypal/Model/Api/Nvp.php(648):
Mage_Paypal_Model_Api_Nvp->call('DoDirectPayment', Array)
public function callDoDirectPayment()
{
Mage::log("hello world");
// 2013-03-20T00:04:50+00:00 调试 (7): 你好世界
$request = $this->_exportToRequest($this->_doDirectPaymentRequest);
Mage::log($request);
// 2013-03-20T00:04:50+00:00 调试 (7): 数组
$this->_exportLineItems($request);
if ($this->getAddress()) {
$request = $this->_importAddresses($request);
}
$response = $this->call(self::DO_DIRECT_PAYMENT, $request);
Mage::log($response);
(
[PAYMENTACTION] => 授权
[IPADDRESS] => 81.98.95.116
[退货详情] => 1
[AMT] => 0.50
[货币代码] => 英镑
[INVNUM] => 100000063
[NOTIFYURL] => http://www.store.com/paypal/ipn/
[电子邮件] => 你好@电子邮件
[信用卡] => xxxxxxxxxxxxxx
[扩展] => xxxxxx
[CVV2] => XXX
[问题编号] =>
)
$this->_importFromResponse($this->_doDirectPaymentResponse, $response);
Mage::log("nothing to see here")
// 这不会向 system.log 返回任何内容,因此我认为这是故障点
}
#2 /var/www/magento/app/code/core/Mage/Paypal/Model/Direct.php(343):
Mage_Paypal_Model_Api_Nvp->callDoDirectPayment()
// call api and import transaction and other payment information
/**
* Place an order with authorization or capture action
*
* @param Mage_Sales_Model_Order_Payment $payment
* @param float $amount
* @return Mage_Paypal_Model_Direct
*/
protected function _placeOrder(Mage_Sales_Model_Order_Payment $payment, $amount)
{ //...........(343)
$api->callDoDirectPayment();
$this->_importResultToPayment($api, $payment);
try {
$api->callGetTransactionDetails();
} catch (Mage_Core_Exception $e) {
// if we recieve errors, but DoDirectPayment response is Success, then set
Pending status for transaction
$payment->setIsTransactionPending(true);
}
(343)
$this->_importResultToPayment($api, $payment);
return $this;
}
#3 /var/www/magento/app/code/core/Mage/Paypal/Model/Direct.php(178):
Mage_Paypal_Model_Direct->_placeOrder(Object(Mage_Sales_Model_Order_Payment), 45)
#4 /var/www/magento/app/code/core/Mage/Sales/Model/Order/Payment.php(1026):
Mage_Paypal_Model_Direct->authorize(Object(Mage_Sales_Model_Order_Payment), 45)
#5 /var/www/magento/app/code/core/Mage/Sales/Model/Order/Payment.php(311):
Mage_Sales_Model_Order_Payment->_authorize(true, 45)
#6 /var/www/magento/app/code/core/Mage/Sales/Model/Order.php(855):
Mage_Sales_Model_Order_Payment->place()
#7 /var/www/magento/app/code/core/Mage/Sales/Model/Order.php(1073):
Mage_Sales_Model_Order->_placePayment()
#8 [internal function]: Mage_Sales_Model_Order->place()