-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Customers are able to pay twice for an order in Mollie #2620
Comments
👀 Joining this issue :-) |
I remember encountering this. There are multiple scenarios possibly:
So depending on the scenario, different limitions / checks should probably be applied. Perhaps a solution could be the Mollie Plugin:
This will probably tackle the issue reported. It won't be perfect but I will be an improvement. I think I remember the "Payment API" of Mollie to be a limitation in removing payment intents/updating them/.. |
Thanks for yout input @seminarian. The Mollie Plugin now uses the order API, so indeed with a reference to the Mollie order, we are able to cancel the order and create a new one. How would you cancel the Mollie order when transitioning to |
Just make sure this statement correct. I remember something about payments not always being cancelable: https://docs.mollie.com/reference/v1/payments-api/cancel-payment#:~:text=Some%20payment%20methods%20are%20cancellable,the%20payment%20can%20be%20canceled.
Not sure about that, the backend could probably track if it got succesfully cancelled or if it's a different amount to be paid. |
I guess when the order or one of the payments couldn't be cancelled, we just log an error and create a new order with payments, just as we do now. |
Thanks for all the input. Great that this has been moved to the backlog |
If we use a custom OrderProcess we could put this check in the inTransitionEnd hook which would execute non-async (i.e. serially with the state transition) which should prevent the edge case you mention. @martijnvdbrug do you have any capacity to work on this in the near future? |
Thats an option, but it feels pretty intrusive if a payment plugin installs a custom order process. Plus a consumer could define their own order process, breaking the payment plugin. @seminarian s suggestion for doing it on new payment creation also works ai think.
Yep, still working together with Nico, and its causing issues, so I will be picking this up. |
Remember that the And great to hear you can work on this 👍 |
Ahh I see it now. Thanks. |
Yes correct. The only way to prevent it from executing would be to actively remove that OrderProcess from the array. Source reference: vendure/packages/core/src/service/helpers/order-state-machine/order-state-machine.ts Line 79 in cf301eb
|
Seeking inputOk, so the proposed solution is:
The question still remains, who will transition the order back into |
So do you mean that the
I would leave this as a concern of the storefront implementation. |
So, we are struggling a bit on when the storefront should transition an order back to
Any suggestions are welcome :-) |
After discusssing with @nicoes we opted for the following solution: Transition to
|
Describe the bug
We get reports from customer service that every now and then a customer pays twice for an order in Mollie.
In Mollie I do indeed see two payments created for that order. Whereas we would expect that this is prevented somehow. As in prevent the customers from starting a 2nd check-out.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
At step 4 an error is returned / user is warned that another payment has already been started.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: