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

Mollie total is incorrect when order price changes on ArrangingPayment #3269

Open
martijnvdbrug opened this issue Dec 11, 2024 · 2 comments
Open
Assignees
Labels
P3: minor Non-critical, no workarounds exist status: research needed 🔍 More in-depth research need to make a decision+ type: bug 🐛 Something isn't working

Comments

@martijnvdbrug
Copy link
Collaborator

martijnvdbrug commented Dec 11, 2024

Describe the bug
We have a product bundle plugin, that adds bundle items to the order on transitioning to ArrangingPayment. This in turn triggers a promotion which changes the price.

Mollie currently works like this:

  1. Dry run transitionToArrangingPayment if that succeeds, it discards the result and creates a payment intent. The order is still in AddingItems
  2. After payment succeeds, the Mollie plugin transitions the order to ArrangingPayment, and then to PaymentSettled.

This last step changed the order total, because promotions were added. The customer now paid to much for the order.

Need your thoughts
Is it valid to change the order price when changing the order to ArrangingPayment, or is this not a case we should support?

Proposed solution
If we should support this use case, we could transition the order to ArrangingPayment on createMolliePaymentIntent(), instead of doing a dry run.

When a customer cancels a payment, or clicks back in the browser, the order will be in ArrangingPayment state, and the storefront will have to handle this state.

image

Environment (please complete the following information):

  • @vendure/core version: 3.0.8
  • Nodejs version 18
  • Database (mysql/postgres etc): MySQL
@martijnvdbrug martijnvdbrug added type: bug 🐛 Something isn't working P3: minor Non-critical, no workarounds exist status: research needed 🔍 More in-depth research need to make a decision+ labels Dec 11, 2024
@martijnvdbrug martijnvdbrug self-assigned this Dec 11, 2024
@martijnvdbrug
Copy link
Collaborator Author

martijnvdbrug commented Dec 11, 2024

Input from Discord:

Daniel Biegler — Today at 10:34 AM

Mhh I could be wrong here and please correct me if so, but at first ignorant glance this issue sounds more like a problem of the bundle plugin and not the mollie plugin, maybe?

Why is it only adding stuff on the state transition? The storefront could add the products beforehand?

Trying to understand 🙏
Did I get this right: you put bundle X in your cart and after transitioning to arrangingpayment the plugin resolves the bundle X and populates the cart with the products that are inside of X so that stock management etc works per product?

Daniel Biegler — Today at 10:42 AM

Is it valid to change the order price when changing the order to ArrangingPayment, or is this not a case we should support?

My subjective opinion: feels to me that the displayed price before finalizing and committing to arrangingpayment should be the amount you will have to pay
Customers will feel cheated when the cart says 5€, you go to checkout and all of a sudden it says 10€ with some new thing added
Even if it's lower, like going from 5€ to 4€ I would feel uncomfortable that the prices didn't match between shop and checkout. My thought would be "mh maybe my order was screwed up or something went wrong"
But again, these are just my gut feel things from only thinking about it for a minute. Maybe someone else with more experience can chime in.

@martijnvdbrug
Copy link
Collaborator Author

Lui — Today at 10:58 AM

I totally agree. As a customer I would want to know the total before I move to the payment.
And I don't expect changes to the price after I decide that I'm fine with the current price.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3: minor Non-critical, no workarounds exist status: research needed 🔍 More in-depth research need to make a decision+ type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant