Adyen / adyen-magento2

Adyen Payment plugin for Magento2
MIT License
155 stars 213 forks source link

Order status pending when payment cancelled and later authorized #488

Closed evs-xsarus closed 4 years ago

evs-xsarus commented 5 years ago

Magento version: 2.2.7 Plugin version: 3.0.0 Description

I have an order with this payment history:

I believe that the order items must also be uncancelled by this Adyenplugin since it's weird to have a pending order with only cancelled items.

ryanpalmerweb commented 5 years ago

Hi Adyen,

We've noticed this problem in our stores aswell, we are using plugin version 4.0.1

When the customer returns from a failed payment, it looks like the order ID is not being changed, and they are being allowed to go back to Adyen to make a second attempt.

As the original order is cancelled, the success notification is unable to change the order to a processing state.

I would expect the behaviour here to be that a new order number was issued

I've attached the access log so that you can see the customer flow, with any identifying information removed.

(customer ip address removed) - - [21/Aug/2019:17:03:32 +0100] "GET /adyen/process/redirect/ HTTP/2.0" 200 1998 "https://www.ourwebsite.co.uk/checkout/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36"

(customer ip address removed) - - [21/Aug/2019:17:03:47 +0100] "GET /adyen/process/result?authResult=CANCELLED&merchantReference=9000018715&merchantSig=(merchant sig removed)%3D&paymentMethod=amex&shopperLocale=en_GB&skinCode=(skin code removed) HTTP/2.0" 499 0 "https://live.adyen.com/hpp/details.shtml" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36"

(customer ip address removed) - - [21/Aug/2019:17:04:26 +0100] "GET /adyen/process/result?authResult=CANCELLED&merchantReference=9000018715&merchantSig=(merchant sig removed)%3D&paymentMethod=amex&shopperLocale=en_GB&skinCode=(skin code removed) HTTP/2.0" 499 0 "https://live.adyen.com/hpp/details.shtml" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36"

(customer ip address removed) - - [21/Aug/2019:17:04:29 +0100] "GET /adyen/process/result?authResult=CANCELLED&merchantReference=9000018715&merchantSig=(merchant sig removed)%3D&paymentMethod=amex&shopperLocale=en_GB&skinCode=(skin code removed) HTTP/2.0" 499 0 "https://live.adyen.com/hpp/details.shtml" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36"

(customer ip address removed) - - [21/Aug/2019:17:04:29 +0100] "GET /checkout/ HTTP/2.0" 499 0 "https://www.ourwebsite.co.uk/checkout/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36"

(customer ip address removed) - - [21/Aug/2019:17:04:31 +0100] "GET /checkout/ HTTP/2.0" 499 0 "https://www.ourwebsite.co.uk/checkout/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36"

(customer ip address removed) - - [21/Aug/2019:17:04:31 +0100] "GET /checkout/ HTTP/2.0" 499 0 "https://www.ourwebsite.co.uk/checkout/cart/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36"

(customer ip address removed) - - [21/Aug/2019:17:04:35 +0100] "GET /checkout/cart/ HTTP/2.0" 499 0 "https://www.ourwebsite.co.uk/a-product-page/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36"

(customer ip address removed) - - [21/Aug/2019:17:07:19 +0100] "GET /adyen/process/result?authResult=AUTHORISED&merchantReference=9000018715&merchantSig=(removed)%3D&paymentMethod=amex&pspReference=1515664036371234&shopperLocale=en_GB&skinCode=(skin code removed) HTTP/2.0" 302 860 "https://live.adyen.com/hpp/completeCard.shtml" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36"

(customer ip address removed) - - [21/Aug/2019:17:07:20 +0100] "GET /checkout/onepage/success/?utm_nooverride=1 HTTP/2.0" 200 19576 "https://live.adyen.com/hpp/completeCard.shtml" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36"

We are in the process of moving from the HPP to API by updating the Adyen module, so it might be that this issue is resolved by the changed customer flow.

Thanks, Ryan

@cyattilakiss

JeroenVanLeusden commented 4 years ago

@cyattilakiss You have an update? We see this regularly but our order will be closed. Payment is successful second time the customer tries.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

cyattilakiss commented 4 years ago

Hi @evs-xsarus , @ryanpalmerweb

The issue that you were describing should be fixed after the version 5.0.0, we moved from our custom exposed API to handle the payment and the order back to the Magento provided process. Could you please verify that you still experience this issue?

@JeroenVanLeusden the issue you mention also should be fixed in one of the latest versions: https://github.com/Adyen/adyen-magento2/blob/5.1.0/Model/Cron.php#L410-L421 Could you please verify that you still experience this issue?

I will keep this ticket open until your feedback.

Have a great day! Best, Attila Adyen

evs-xsarus commented 4 years ago

Will be able to monitor this from coming monday.

atty31 commented 4 years ago

Hi, I am facing the same issue. See my pic: Screenshot (14)

on Magento ver. 2.3.3 and the module version is 5.0.1 .

cyattilakiss commented 4 years ago

Hi @evs-xsarus , @ryanpalmerweb , @JeroenVanLeusden , @atty31

Thank you all for the input. We created a fix #679 for this issue. After investigating we found that redirect payment methods can redirect the shopper back to the store with cancelled status even though the payment was authorised or was still pending. In the plugin we were cancelling the order to make the reserved item available again in the stock as fast as possible. Because of the redirect resultCode inconsistency now we rely on the notifications to cancel (or authorise) the order.

This patch will be released in 6.x.x but since the code change is compact enough you can patch your current version yourself just to validate and proceed faster.

Let me know if you have further questions.

Best, Attila Adyen

Beagon commented 4 years ago

Hi,

I seem to still encounter this issue. I've seen this on 2 yesterday one if which was a PayPal order and the other one iDeal. We're running version 6.4.0 but are upgrading to 6.6.0 but I don't feel like this has to do with 6.4.0 since this should be fixed in 6.2.

Sincerely,

Robin

cyattilakiss commented 4 years ago

Hi @Beagon ,

I've just answered in the ticket: #717

Best, Attila