Closed marinagociulybe closed 4 months ago
@RokPopov, thanks for checking this! Unfortunately, I'm not sure that will solve all situations. I'm seeing this on orders where the payments were successful too. They are being reverted from Processing back into Pending.
I suspect the issue is in that mentioned file, but on a different line: https://github.com/Adyen/adyen-magento2/blob/develop/Helper/PaymentResponseHandler.php#L200. The state and status of the order are changed without checking the presumption that the order is indeed in the state pending_payment
.
Describe the bug After upgrading the Adyen module to 9.2.0 from version 8, some of the orders paid with the Swish payment method get wrongly updated back to Pending, after being in the correct states of Canceled or Processing.
To Reproduce I do not currently have a way to reproduce this, as the Swish payment method only offers a way to test the approved status. What I do see in the logs and on the order comments is:
/adyen/return?merchantReference=%ORDER ID%
adyen/result.log
: AdyenLoggerTest.ADYEN_RESULT: Updating the order/rest/default/V1/adyen/guest-carts/%CART INFO%/payments-details
-> I assume this is the request messing up with the orderadyen/result.log
: AdyenLoggerTest.ADYEN_RESULT: Updating the orderExpected behavior I expect orders to not get updated to Pending if the current status is Processing.
Magento version 8.4.6-p3
Plugin version 9.22.0
Additional context I've traced all this back to
\Adyen\Payment\Helper\PaymentResponseHandler::handlePaymentsDetailsResponse
when$this->orderHelper->setStatusOrderCreation($order)
is called. I would expect this method to be triggered only when the order state ispending_payment
, and not in the other situations. I've see the exact same behaviour with Canceled orders. They are reverted back to Pending by this method.