Adyen / adyen-shopware5

MIT License
11 stars 12 forks source link

Wrong Order Details, when the order has an error #121

Closed danielDigitalArt closed 3 years ago

danielDigitalArt commented 3 years ago

Describe the bug When an order is made, sometimes the shop does not process the transaction further, we only see a loading animation. When this happens we see that the function "ajaxDoPayment" results in an error where the OrderID creates a mysql-error. When this happens the Customer-Data is altered by adyen. The username and also his addresses are completely different, it seems as there were different data loaded from another shop-system or Adyen customer. If this is true and these data are not some kind of random Userdata or testdata, this will also be a security issue, as i now have the customer data of someone elses shop-system.

Expected behavior The order gets processed without an error and the customer data is not altered.

Desktop (please complete the following information):

Additional context Shopversion: 5.6.9 Pluginversion: 1.6.0 (from Shopware Store) Plugin is running in Test-Mode.

Error Message:

Oeps! Er is een fout opgetreden!

De hiernavolgende informatie helpt u wellicht verder.

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '701' for key 'orderID' in engine/Library/Zend/Db/Statement/Pdo.php on line 224

Stack trace:

#0 engine/Library/Zend/Db/Statement.php(297): Zend_Db_Statement_Pdo->_execute(Array)
#1 engine/Library/Zend/Db/Adapter/Abstract.php(472): Zend_Db_Statement->execute(Array)
#2 engine/Library/Zend/Db/Adapter/Pdo/Abstract.php(232): Zend_Db_Adapter_Abstract->query('\n        INSERT...', Array)
#3 engine/Library/Enlight/Components/Db/Adapter/Pdo/Mysql.php(83): Zend_Db_Adapter_Pdo_Abstract->query('\n        INSERT...', Array)
#4 engine/Library/Enlight/Components/Db/Adapter/Pdo/Mysql.php(98): Enlight_Components_Db_Adapter_Pdo_Mysql->query('\n        INSERT...', Array)
#5 engine/Shopware/Core/sOrder.php(1095): Enlight_Components_Db_Adapter_Pdo_Mysql->executeUpdate('\n        INSERT...', Array)
#6 engine/Shopware/Core/sOrder.php(807): sOrder->sSaveBillingAddress(Array, '701')
#7 engine/Shopware/Controllers/Frontend/Payment.php(113): sOrder->sSaveOrder()
#8 custom/plugins/AdyenPayment/Controllers/Frontend/Adyen.php(221): Shopware_Controllers_Frontend_Payment->saveOrder(33, 'dd8ec360322e467...', 17, false)
#9 custom/plugins/AdyenPayment/Controllers/Frontend/Adyen.php(169): Shopware_Controllers_Frontend_Adyen->prepareOrder(Object(AdyenPayment\Models\PaymentInfo))
#10 custom/plugins/AdyenPayment/Controllers/Frontend/Adyen.php(73): Shopware_Controllers_Frontend_Adyen->createPaymentContext()
#11 engine/Library/Enlight/Controller/Action.php(192): Shopware_Controllers_Frontend_Adyen->ajaxDoPaymentAction()
#12 engine/Library/Enlight/Controller/Dispatcher/Default.php(478): Enlight_Controller_Action->dispatch('ajaxDoPaymentAc...')
#13 engine/Library/Enlight/Controller/Front.php(228): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp))
#14 engine/Shopware/Kernel.php(188): Enlight_Controller_Front->dispatch()
#15 vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php(102): Shopware\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 vendor/symfony/http-kernel/HttpCache/HttpCache.php(453): Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle(Object(Shopware\Kernel), Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 engine/Shopware/Components/HttpCache/AppCache.php(261): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL)
#18 vendor/symfony/http-kernel/HttpCache/HttpCache.php(238): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true)
#19 vendor/symfony/http-kernel/HttpCache/HttpCache.php(255): Symfony\Component\HttpKernel\HttpCache\HttpCache->pass(Object(Symfony\Component\HttpFoundation\Request), true)
#20 engine/Shopware/Components/HttpCache/AppCache.php(143): Symfony\Component\HttpKernel\HttpCache\HttpCache->invalidate(Object(Symfony\Component\HttpFoundation\Request), true)
#21 vendor/symfony/http-kernel/HttpCache/HttpCache.php(181): Shopware\Components\HttpCache\AppCache->invalidate(Object(Symfony\Component\HttpFoundation\Request), true)
#22 engine/Shopware/Components/HttpCache/AppCache.php(113): Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 shopware.php(122): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request))
#24 {main}
acampos1916 commented 3 years ago

Hello @danielDigitalArt, thanks for opening this issue.

It is a very strange behavior indeed. Could you provide some detailed steps to try to reproduce?

Thanks, Ángel

danielDigitalArt commented 3 years ago

Sadly not really, all what happens is that i get an error when i try to get to the Payment Page of the selected Adyen Payment, i had this with multiple (ideal) Payments like Test Issuer 5 etc.

I dont get to the proper Payment page as the Shop is stuck with that loading animation in the frontend, while showing the added error in the browsers console.

So i can select i.e. Ideal > Test Issuer 5 as payment method, then i want to go to the last step, where i get redirected to the adyen payment page, but before getting there the error happens.

danielDigitalArt commented 3 years ago

@acampos1916 i think i could rule out the problem here now. The hint was the duplicate entry, there were some Data from Testings and i guess from imports, the data was in the order_billingaddress and was then added to the current orderid. I do not really know why the orderid was reset, but it explains Userdata appearing out of nowhere. So i tested after cleaning the Tables and could not yet see this particular Problem again, also the duplicate error Message in general should be gone away too now.