laybuy / magento-1-deprecated Goto Github PK
View Code? Open in Web Editor NEWLaybuy Payment Module for Magento 1
License: Apache License 2.0
Laybuy Payment Module for Magento 1
License: Apache License 2.0
I simply integrated the extension without any problem, but upon clicking "place order" there is an error where it prevents the customers from reaching laybuy page
Sorry there was an Error redirecting you to Laybuy: ERROR (Specified tax amount is invalid.)
When I reviewed the logs I have seen this:
2019-03-21T02:31:16+00:00 DEBUG (7): 5c92f7732f2c3 -- Laybuy_Payments_Model_Payments::setupLaybuy CLIENT INIT: 104052:UWgejQo7E42nZV4TMTzXPwngenZdNSQRr2w94VMGRS1V3hBsgm78sqJG8xesTcqg
2019-03-21T02:31:16+00:00 DEBUG (7): 5c92f7732f2c3 -- Laybuy_Payments_Model_Payments::setupLaybuy SETUP COMPLETE
2019-03-21T02:31:17+00:00 DEBUG (7): 5c92f7732f2c3 -- stdClass Object
(
[result] => ERROR
[error] => Specified tax amount is invalid.
)
2019-03-21T02:31:17+00:00 DEBUG (7): 5c92f7732f2c3 -- LAYBUY: ORDER CREATE FAILED (ERROR -> Specified tax amount is invalid.)
2019-03-21T02:31:17+00:00 DEBUG (7): 5c92f7732f2c3 -- LAYBUY: ORDER CREATE FAILED, found quote 213151
Now I am not quite sure if this a problem from our side or laybuy servers not taking ZERO Taxes value.
The $totalOrderValue is incorrectly hardcoded to be 10 there, which looks like a debugging statement supposed to be deleted.
After placing the order you get only the headline, but the following does not return with the proper data:
<?php if ($this->getOrderId()):?>
<?php if ($this->getCanViewOrder()) :?>
And because of this, the customer cannot see the order number nor the thank you message!
Unsure, maybe a Magento error page or a page saying the payment has already been processed
The second time the user returns to Magento the response contains an error, therefore the order is deleted from Magento. The initial payment remains in Laybuy but it no longer has a matching order in Magento.
Using magento 1.9.3.8
If you cancel a payment (or get declined). Your items are not added back into the system. For example your try to purchase product A with qty of 1. The order is created and the qty becomes 0. If the order is deleted you get returned to the cart but the qty is zero so the user cannot try again. In our case the user gets a message saying sorry some of your products are out of stock.
Hi Carl,
I was investigating an issue for a client, where customers saw the HTTP 500 error page after checking out using Laybuy from Magento.
Here is the stack trace for multiple occurrences:
[Tue Sep 12 12:36:42 2017] [error] [client 121.99.181.227]
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Mage_Payment_Helper_Data::getInfoBlock() must be an instance of Mage_Payment_Model_Info, boolean given, called in app/code/core/Mage/Sales/Model/Order.php on line 1269 and defined in app/code/core/Mage/Payment/Helper/Data.php:117
Stack trace:
#0 app/code/core/Mage/Sales/Model/Order.php(1269): Mage_Payment_Helper_Data->getInfoBlock(false)
#1 app/code/community/Laybuy/Payments/controllers/PaymentController.php(88): Mage_Sales_Model_Order->sendNewOrderEmail()
#2 app/code/core/Mage/Core/Controller/Varien/Action.php(419): Laybuy_Payments_PaymentController->responseAction()
#3 app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('response')
#4 app/code/core/Mage/Core/Controller/Vari in app/code/core/Mage/Payment/Helper/Data.php on line 117, referer: https://payment.laybuy.com/pay/ICOZQUAKYBUE1gCaVxgRzeRPcu6kCmoOVBQlhOZG
[Tue Sep 12 12:36:51 2017] [error] [client 121.99.181.227]
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Mage_Payment_Helper_Data::getInfoBlock() must be an instance of Mage_Payment_Model_Info, boolean given, called in app/code/core/Mage/Sales/Model/Order.php on line 1269 and defined in app/code/core/Mage/Payment/Helper/Data.php:117
Stack trace:
#0 app/code/core/Mage/Sales/Model/Order.php(1269): Mage_Payment_Helper_Data->getInfoBlock(false)
#1 app/code/community/Laybuy/Payments/controllers/PaymentController.php(88): Mage_Sales_Model_Order->sendNewOrderEmail()
#2 app/code/core/Mage/Core/Controller/Varien/Action.php(419): Laybuy_Payments_PaymentController->responseAction()
#3 app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('response')
#4 app/code/core/Mage/Core/Controller/Vari in app/code/core/Mage/Payment/Helper/Data.php on line 117
[Tue Sep 12 12:37:51 2017] [error] [client 121.99.32.138]
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Mage_Payment_Helper_Data::getInfoBlock() must be an instance of Mage_Payment_Model_Info, boolean given, called in app/code/core/Mage/Sales/Model/Order.php on line 1269 and defined in app/code/core/Mage/Payment/Helper/Data.php:117
Stack trace:
#0 app/code/core/Mage/Sales/Model/Order.php(1269): Mage_Payment_Helper_Data->getInfoBlock(false)
#1 app/code/community/Laybuy/Payments/controllers/PaymentController.php(88): Mage_Sales_Model_Order->sendNewOrderEmail()
#2 app/code/core/Mage/Core/Controller/Varien/Action.php(419): Laybuy_Payments_PaymentController->responseAction()
#3 app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('response')
#4 app/code/core/Mage/Core/Controller/Vari in app/code/core/Mage/Payment/Helper/Data.php on line 117, referer: https://payment.laybuy.com/pay/UnVaEAy1exJZh15XlYmNXfSGi8ZIB4XL3fV1SfuI
[Tue Sep 12 12:38:02 2017] [error] [client 121.99.32.138]
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Mage_Payment_Helper_Data::getInfoBlock() must be an instance of Mage_Payment_Model_Info, boolean given, called in app/code/core/Mage/Sales/Model/Order.php on line 1269 and defined in app/code/core/Mage/Payment/Helper/Data.php:117
Stack trace:
#0 app/code/core/Mage/Sales/Model/Order.php(1269): Mage_Payment_Helper_Data->getInfoBlock(false)
#1 app/code/community/Laybuy/Payments/controllers/PaymentController.php(88): Mage_Sales_Model_Order->sendNewOrderEmail()
#2 app/code/core/Mage/Core/Controller/Varien/Action.php(419): Laybuy_Payments_PaymentController->responseAction()
#3 app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('response')
#4 app/code/core/Mage/Core/Controller/Vari in app/code/core/Mage/Payment/Helper/Data.php on line 117, referer: https://payment.laybuy.com/pay/UnVaEAy1exJZh15XlYmNXfSGi8ZIB4XL3fV1SfuI
[Tue Sep 12 12:38:20 2017] [error] [client 121.99.32.138]
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Mage_Payment_Helper_Data::getInfoBlock() must be an instance of Mage_Payment_Model_Info, boolean given, called in app/code/core/Mage/Sales/Model/Order.php on line 1269 and defined in app/code/core/Mage/Payment/Helper/Data.php:117
Stack trace:
#0 app/code/core/Mage/Sales/Model/Order.php(1269): Mage_Payment_Helper_Data->getInfoBlock(false)
#1 app/code/community/Laybuy/Payments/controllers/PaymentController.php(88): Mage_Sales_Model_Order->sendNewOrderEmail()
#2 app/code/core/Mage/Core/Controller/Varien/Action.php(419): Laybuy_Payments_PaymentController->responseAction()
#3 app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('response')
#4 app/code/core/Mage/Core/Controller/Vari in app/code/core/Mage/Payment/Helper/Data.php on line 117, referer: https://payment.laybuy.com/pay/UnVaEAy1exJZh15XlYmNXfSGi8ZIB4XL3fV1SfuI
I tried to replicate the issue on the staging site, but the checking out process succeeded without this issue on staging.
After some code digging, I came up with the following theory:
The order object is supposed to be populated with data by the loadByIncrementId() method. However, it might fail silently and leave an empty order object if the provided increment id is not valid somehow.
In the following call to Mage_Sales_Model_Order->sendNewOrderEmail(), Mage_Sales_Model_Order->getPayment() was called but can only return false due the failure of order loading. The false value is then passed to Mage::helper('payment')->getInfoBlock() in Mage_Sales_Model_Order->sendNewOrderEmail(), which trigger the fatal error above in the stack trace.
I found that the reserved the order increment id in the quote is different from the actual order increment id. Maybe that's worth investigation?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.