使用Paypal Pro的Magento卡付款给出错误

时间:2016-08-10 19:05:52

标签: php magento paypal

完成购买卡后,我收到以下错误:

处理您的订单时出错。请联系我们或稍后再试。

Magento错误日志在这里:

exception 'Exception' with message 'Notice: Array to string conversion  in /home/luluinth/public_html/app/code/core/Mage/Paypal/Model/Api/Nvp.php on line 1060' in /home/luluinth/public_html/app/code/local/Mage/Core/functions.php:247
    Stack trace:
#0 [internal function]: mageCoreErrorHandler(8, 'Array to string...', '/home/luluinth/...', 1060, Array)
#1 /home/luluinth/public_html/app/code/core/Mage/Paypal/Model/Api/Nvp.php(1060): sprintf('PayPal NVP gate...', Array, '4f0c10ba893f2', '72.0')
#2 /home/luluinth/public_html/app/code/core/Mage/Paypal/Model/Api/Nvp.php(1008): Mage_Paypal_Model_Api_Nvp->_handleCallErrors(Array)
#3 /home/luluinth/public_html/app/code/core/Mage/Paypal/Model/Api/Nvp.php(659): Mage_Paypal_Model_Api_Nvp->call('DoDirectPayment', Array)
#4 /home/luluinth/public_html/app/code/core/Mage/Paypal/Model/Direct.php(343): Mage_Paypal_Model_Api_Nvp->callDoDirectPayment()
#5 /home/luluinth/public_html/app/code/core/Mage/Paypal/Model/Direct.php(202): Mage_Paypal_Model_Direct->_placeOrder(Object(Mage_Sales_Model_Order_Payment), '12')
#6 /home/luluinth/public_html/app/code/core/Mage/Sales/Model/Order/Payment.php(443): Mage_Paypal_Model_Direct->capture(Object(Mage_Sales_Model_Order_Payment), '12')
#7 /home/luluinth/public_html/app/code/core/Mage/Sales/Model/Order/Invoice.php(385): Mage_Sales_Model_Order_Payment->capture(Object(Mage_Sales_Model_Order_Invoice))
#8 /home/luluinth/public_html/app/code/core/Mage/Sales/Model/Order/Payment.php(608): Mage_Sales_Model_Order_Invoice->capture()
#9 /home/luluinth/public_html/app/code/core/Mage/Sales/Model/Order/Payment.php(410): Mage_Sales_Model_Order_Payment->_invoice()
#10 /home/luluinth/public_html/app/code/core/Mage/Sales/Model/Order/Payment.php(348): Mage_Sales_Model_Order_Payment->capture(NULL)
#11 /home/luluinth/public_html/app/code/core/Mage/Sales/Model/Order.php(886): Mage_Sales_Model_Order_Payment->place()
#12 /home/luluinth/public_html/app/code/core/Mage/Sales/Model/Order.php(1104): Mage_Sales_Model_Order->_placePayment()
#13 [internal function]: Mage_Sales_Model_Order->place()
#14 /home/luluinth/public_html/app/code/core/Mage/Core/Model/Resource/Transaction.php(105): call_user_func(Array)
#15 /home/luluinth/public_html/app/code/core/Mage/Core/Model/Resource/Transaction.php(159): Mage_Core_Model_Resource_Transaction->_runCallbacks()
#16 /home/luluinth/public_html/app/code/core/Mage/Sales/Model/Service/Quote.php(189): Mage_Core_Model_Resource_Transaction->save()
#17 /home/luluinth/public_html/app/code/core/Mage/Sales/Model/Service/Quote.php(249): Mage_Sales_Model_Service_Quote->submitOrder()
#18 /home/luluinth/public_html/app/code/core/Mage/Checkout/Model/Type/Onepage.php(785): Mage_Sales_Model_Service_Quote->submitAll()
#19 /home/luluinth/public_html/app/code/core/Mage/Checkout/controllers/OnepageController.php(579): Mage_Checkout_Model_Type_Onepage->saveOrder()
#20 /home/luluinth/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_OnepageController->saveOrderAction()
#21 /home/luluinth/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('saveOrder')
#22 /home/luluinth/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#23 /home/luluinth/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#24 /home/luluinth/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#25 /home/luluinth/public_html/index.php(98): Mage::run('', 'store')
#26 {main}

1 个答案:

答案 0 :(得分:0)

您尝试将$ value作为字符串进行比较,但$ value是一个数组。如果$ value有一些你需要的值(也许它嵌套在一个数组中)进行比较,那么你必须处理它以使它不是数组。

转到那个nvp.php文件并在if语句之前执行此操作。

的var_dump($值);死;

或者

法师::日志($值); //检查var / log / system.log并启用日志记录

只需检查数据的结构如何以$ value结构化。将它变成一个字符串变量。

此处$ value是一个变量,您可以将该变量放在生成异常的行号

检查一下,让我知道它是否有效。