Adyen / adyen-shopware5

MIT License
11 stars 12 forks source link

paymentData missing in the /payments/details request #108

Closed ataberkylmz closed 3 years ago

ataberkylmz commented 3 years ago

Describe the bug

/payments request was a success and paymentData, MD, PaReq and redirectUrl returned in the response all together with RedirectShopper action. Server/instance redirected shopper to bank's 3DS1 challenge page correctly and challenge completed correctly. Returned to Shopware 5 instance with MD and PaRes. Then the server/instance made the /payments/details call with MD and PaRes however paymentData key was set to nothing "". This resulted in error in Adyen's side and the payment stuck in Offers section as the payment has never finalized/completed.

This might be an issue related to session variables as paymentData is stored in the session instead of in the database. Check the corresponding lines: https://github.com/Adyen/adyen-shopware5/blob/1.6.0/Components/Manager/AdyenManager.php#L35-L61

The session problem might also be the root cause of the issue https://github.com/Adyen/adyen-shopware5/issues/106.

jensvandorpe commented 3 years ago

@acampos1916 could you look into this, how do you handle this in other plugins? Is it normal we don't get an error message if we don't pass the paymentData in the API call?

acampos1916 commented 3 years ago

Hello @jensvandorpe,

I checked what @ataberkylmz describes and indeed the issues seems to be here, as he describes the payment data is being fetched from the session, which doesn't always work. By the time the user is redirected back to the store the session could be terminated, or the browser could close it due to the SameSite cookie policy, etc.

In the Shopware 6 plugin the payment response is stored in the database after the initial /payments call and queried right before the /payments/details call.