Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ECP-9481] Orders cannot be canceled in v9 #2748

Open
JonasFolletete opened this issue Sep 16, 2024 · 3 comments · May be fixed by #2773
Open

[ECP-9481] Orders cannot be canceled in v9 #2748

JonasFolletete opened this issue Sep 16, 2024 · 3 comments · May be fixed by #2773
Assignees
Labels
Bug report Indicates that issue has been marked as a possible bug

Comments

@JonasFolletete
Copy link

Describe the bug
Prior to version 9, there was a way to cancel pending orders by using the payment-details route : 35ebd16#diff-12bbc66d935c4130a664605599d72213df5a15629e4831bab735b1b6f2b4a295L99-L111

The cancelledparameter is still used in the javascription plugin, but doesn't seem to work anymore :

Is there a new route to do the same thing ?

Thank you very much.

To Reproduce

When I call the route payment-details : adyen/guest-carts/${cart-token}/payments-details
with the payload :
{ payload: "{"cancelled":true}", orderId: ${orderId} }

The plugin gives me the following error :
Internal Error. Details are available in Magento log file.
Warning: Undefined array key "details" in /app/do357cqtkw3dk_stg/vendor/adyen/module-payment/Helper/PaymentsDetails.php on line 114

Expected behavior

The order should be cancelled.

Magento version
2.4.5

Plugin version
9.8.0

@JonasFolletete JonasFolletete added the Bug report Indicates that issue has been marked as a possible bug label Sep 16, 2024
@khushboo-singhvi khushboo-singhvi changed the title Orders cannot be canceled in v9 [ECP-9481] Orders cannot be canceled in v9 Sep 25, 2024
@khushboo-singhvi
Copy link
Contributor

Hello @JonasFolletete,

Thank you for bringing this to our attention.

We have created an internal ticket to cleanup the code wherein with V9, we only depend on the result of the PaymentDetails call, if the response has error, then we cancel the order, otherwise for all other scenarios we wait for OFFER_CLOSE notification. And we deprecated cancelling pending orders as we did on V8. I think we need some code cleanup on the frontend for V9.

Regards!
Khushboo

@khushboo-singhvi khushboo-singhvi self-assigned this Sep 25, 2024
@JonasFolletete
Copy link
Author

JonasFolletete commented Sep 30, 2024

Hello @khushboo-singhvi ,

Thank you for your answer, I think it is still important to be able to manually cancel an order.

Otherwise every time a user tries a new payment method (without finalizing the payment), this will create a new order and lock the stock until the offer closes.

For example :
• The customer tries to buy a product with only one item in stock
• He initiates the payment with PayPal
• We create a pending order
• Finally, he decides to pay with Klarna
• We won't be able to create an order because the stock is already committed to the one created with PayPal

Do you have any solution for that ? We need to be able to cancel the first order.
Thank you very much !

@khushboo-singhvi
Copy link
Contributor

Hello @JonasFolletete,

Thank you for pointing a vey specific case. We are bainstorming internally and will soon come out with the solution where can cancel the order and move ahead.

Regards!
Khushboo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug report Indicates that issue has been marked as a possible bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants