Closed dimitriBouteille closed 3 weeks ago
Hello @dimitriBouteille,
Thank you for creating this issue. We will fix that issue as a part of our internal ticket ECP-9534 together with #2775.
Best Regards, Can
Hey @dimitriBouteille,
Here is the related PR - https://github.com/Adyen/adyen-magento2/pull/2796 Closing the issue.
Regards! Khushboo
Hello !
There is a small bug with the payment method Twint with classic magento - I have not tested with the other methods - in headless integration (graphql) no problem :
/adyen/return
twice, the page/checkout/success
is displayed the second time.Cancel payment
, the success page is displayed.The problem between the two environments is slightly different but the source is the same: the function
Adyen\Payment\Controller\Return\Index::validateRedirectResponse()
.validateRedirectResponse :
When calling the
/adyen/return
for the first time, this function returnsfalse
.On the second call, there is a check using the
isResponseAlreadyProcessed
function to verify whether the payment has already been processed or not. The problem is thatisResponseAlreadyProcessed
returnstrue
.The
isResponseAlreadyProcessed
function is based on the order history to know if the reference PSP reference exists in the comments. On the second call, there is a comment with the PSP reference and returnstrue
without checking if the payment is valid, canceled, ...https://github.com/Adyen/adyen-magento2/blob/e3af5ed622fce24d449cf0be3373071c3d59a8c3/Controller/Return/Index.php#L198-L216
Here is what happens globally :
/adyen/return
validateRedirectResponse
returnfalse
/cart
with error/adyen/return
isResponseAlreadyProcessed
returnstrue
because the PSP reference exist in order comment historyvalidateRedirectResponse
returnstrue
/checkout/success
with canceled error -_-To Reproduce
In testing environment :
Twint
method/checkout/cart
page is displayed with error (payment canceled)/adyen/return
with same arguments/checkout/success
is displayed with error (payment canceled)In production environment :
Twint
methodCancel payment
in Twint interface/checkout/success
is displayed with error (payment canceled)Between the production and test env, there is a difference since on the production environment Twint or Adyen makes two calls to
/adyen/return
, I do not know why:( Here is an example of the logs in production :Expected behavior
If customer cancel payment, page
/checkout/cart
must be displayed in all cases with error (e.g: Payment canceled).Magento version
2.4.5-p10
Plugin version
9.8.0