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

MolliePlugin >= v2.2.0 may duplicates order items resulting in higher charges #2813

Open
kyunal opened this issue Apr 25, 2024 · 1 comment
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@kyunal
Copy link

kyunal commented Apr 25, 2024

Describe the bug
The updated MolliePlugin that re-uses existing mollie orders rather than creating new ones can cause erroneous charges by not re-using or cancelling order lines correctly. While beneficial to the shop owner unless the customer notices, I do not think this is intentional.

To Reproduce
Steps to reproduce the behavior:

  1. Go to mollie checkout (in our storefront: AddingItems -> ArrangingPayment, then create intent)
  2. Return from mollie checkout again (in our storefront: ArrangingPayment -> AddingItems)
  3. Go to mollie checkout again (in our storefront: AddingItems -> ArrangingPayment, then create intent)
  4. See error

Expected behavior
Only order line items present in the vendure order end up being present in the mollie order.

Environment (please complete the following information):

  • @vendure/core version: 2.2.0
  • Nodejs version 18
  • Database (mysql/postgres etc): pg14.9.0

Additional context
I haven't debugged the issue but I believe it might stem from here https://github.com/vendure-ecommerce/vendure/blob/7d50b5446d823f933103442ac6ce99f5bd02e5b6/packages/payments-plugin/src/mollie/mollie.service.ts#L486C13-L492C14

If the order lines are equal, the first condition is not met and they will be pushed again into the mollie order by using the add operation, while old order lines are still present. I think for safety reasons it might make sense to simply cancel all old lines and then create new ones rather than to mess with re-using the existing lines, but that is just my gut feeling.

@kyunal kyunal added the type: bug 🐛 Something isn't working label Apr 25, 2024
@michaelbromley
Copy link
Member

Paging @martijnvdbrug - when you get time can you share your opinion on this? You're now much more familiar with this plugin than I am :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants