Order modification impossible (4 bugs)
See original GitHub issueDescribe the bug
1.) Currently when I make any modification to Order, the “Preview changes” button is always disabled - this is UI bug as when I enable it via DevTools then the update works.
2.) Updates to addresses are not made, the payload of this update call is empty "updateShippingAddress": {}, "updateBillingAddress": {},
3.) When updating an order that has failed/cancelled payments then it’s impossible to add additional payment, as the outstanding value does not match to order total. The outstanding order amount (114800) should equal the unsettled OrderModifications total (10000)
4.) If order contains promotion already and we change the order value, then the outstanding value is higher by value of this promotion (e.g. order have promotion “Discount 10%”: -3€; we add surcharge 10€, now the outstanding value is 13€ instead of 10€ (applied promotion “dissapears”).
Environment (please complete the following information):
- @vendure/core version: v0.18.3
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (11 by maintainers)
Top GitHub Comments
Got it. Once https://github.com/vendure-ecommerce/vendure/pull/539 is resolved then I’ll also work on making the payments more flexible so it is easier to deal with more unusual payment flows like you described.
Yes, didn’t consider there is no way by default to transition to this state. (I have a custom rest endpoint where payment provider notify us on payment status-if it’s declined or timeouts then we cancel that payment as it’s transaction ID is not valid, but keep order alive and if customer wants he can create a new payment for another 24hours) - and this is the use case, where would modification be useful for us, if some non-techy customer calls us to that he will pay in person or by direct payment we want to be able to handle this scenario even for a case that there is need to modify the order. ^ That’s just the context where you can see the issue.
Anyway for reproduction of the bug I believe changing a state of your payment to “Error” in DB will suffice and I guess there should be a check “isOrderSettled” before actual outstanding amount calculation.