Paying again for the order is too complicated
See original GitHub issueIn our case customer fails with payment of any reason - he could have no battery on smartphone to approve transaction on time. We want him to try again right away, he’s paying customer, he’s gold for us.
Unfortunately Vendure is not easy on developer to support this simple scenario as ShopApi does not allow to add payment to historical Order, only the active one known from session. Additionally there is Order state ArrangingAdditionalPayment
available, seems to be perfect in such situation but it’s not available in natural flow, you must reach Modifying
state first which is typical for Admin and then transition to ArrangingAdditionalPayment
.
Our ideas how to achieve this:
- We must add custom order flow to allow transition from
PaymentAuthorised
toArrangingAdditionalPayment
. When our payment controller receives info that the payment is declined it would transition the Order to the new state right away. Front knows exactly what to do with such order. - We must write extra GQL mutation for ShopApi to either:
- change active order in user session to historical order and then allow store frontend to call natural
addPaymentToOrder
OR - write responsible method of adding payment to historical Order and have stress each time Vendure is updated if we follow all required steps.
I think this should be easier as we all want Vendure to be the best e-commerce engine ever!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (6 by maintainers)
Top GitHub Comments
OK, but this method is not exposed via GQL to frontend. As we discussed on Slack we took the most safe way to do it - we are changing active order in session and then move on with typical
addPaymentToOrder
.Hi all,
I’m finally revisiting this to wrap it up and make sure we have all cases handled. I just implemented a couple of changes which will allow the Administrator to manually add a payment, as requested by @stefanvanherwijnen:
https://user-images.githubusercontent.com/6275952/144060126-849bd3a5-6667-4d68-be5c-78ca61bd562e.mp4
The concrete change is that the
addManualPaymentToOrder
can now also be executed from theArrangingPayment
state, not just theArrangingAdditionalPayment
state.Now I want to make sure I fully understand the original issue from @s3m3n:
I am not 100% clear on how the order gets into the state which causes the issue. Can you lay out step-by-step instructions of how to recreate the bad state?