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

Product Remains Unavailable After Mollie Payment Cancellation #846

Open
danielMikicevic opened this issue Jan 7, 2025 · 3 comments
Open
Assignees
Labels
Investigating We are working on this issue together with the customer. Question / Issue Further information is requested

Comments

@danielMikicevic
Copy link

Used versions

  • Magento Version number (2.4.6-p4):
  • Magento Open source
  • Mollie version number (2.34.0):

Describe the bug
When a product with a stock quantity of 1 is purchased, and the payment is canceled on the Mollie payment page, the user is redirected to the cart page with the following error message:

The requested quantity is not available.

The user is unable to start the payment process again with the same product because it is no longer available in stock.

To Reproduce
Steps to reproduce the behavior:

  1. Set up a product with a stock quantity of 1.
  2. Add the product to the cart and proceed to checkout.
  3. Choose credit card as the payment method.
  4. Cancel the payment on the Mollie payment page using the return button.
  5. Observe the redirection to the cart page with the error message: The requested quantity is not available.

Expected behavior
If the payment is canceled by Mollie for any reason, the product should be returned to stock before the cart page is loaded. This ensures the stock level is correctly updated, and the error does not occur.

Additional Observation:
If the cart is updated using the "Update Cart" button, the order is canceled, and the product becomes available for purchase again.

@Frank-Magmodules
Copy link
Collaborator

Hi There @danielMikicevic ,

Thank you for raising this issue.

We have reviewed the situation, and the behavior you described is working as intended.
When a customer initiates a transaction, an order is created, and the stock is reserved for that order.
If the customer uses the back button, the transaction remains pending.

Eventually, this transaction will time out, the order will be canceled, and the stock reservation will be released. Unfortunately, this delay can result in the customer encountering an “out of stock” message during that time.

To improve the experience, you might consider enabling the second-chance email feature.
This sends the customer an email after some time, notifying them that their payment is still pending.

I hope I understood your issue correctly.
Please let me know if this response addresses your concern.

@Frank-Magmodules Frank-Magmodules added Question / Issue Further information is requested Investigating We are working on this issue together with the customer. labels Jan 9, 2025
@danielMikicevic
Copy link
Author

screencast.mp4

Hi @Frank-Magmodules ,

exactly, everything works as it should, but in this scenario, the customer gets confused. The customer would need to manually click the "Update Cart" button to proceed to the checkout again, check the video. Some customers don’t understand this and contact support.

Yes, we have also activated the Second Chance email, but it would still be nice if the customer could immediately purchase the product again.

Can you reproduce the problem?

Thank you for your time and quick response.

Bg
Daniel

@Frank-Magmodules
Copy link
Collaborator

I understand your comment and intention, but no immediate solution comes to mind at the moment, especially with Mollie webhooks now being asynchronous.

This seems to be primarily a timing issue. When the user clicks back, they land on the shopping cart page. At that point, the stock is still reserved, and the order hasn’t yet been canceled. In the background, the webhook is triggered, canceling the order and releasing the stock. However, by the time this process completes, the user is already viewing the shopping cart page, so the update comes too late.

I’m not entirely sure how we can resolve this, but I’ll discuss it with the team and follow up.
If you have any ideas or suggestions in the meantime, feel free to share.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigating We are working on this issue together with the customer. Question / Issue Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants