question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Paying again for the order is too complicated

See original GitHub issue

In 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:

  1. We must add custom order flow to allow transition from PaymentAuthorised to ArrangingAdditionalPayment. 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.
  2. 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:open
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
s3m3ncommented, Mar 11, 2021

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.

0reactions
michaelbromleycommented, Nov 30, 2021

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 the ArrangingPayment state, not just the ArrangingAdditionalPayment state.

Now I want to make sure I fully understand the original issue from @s3m3n:

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

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does anyone else get customers who apologize for ... - Reddit
Does anyone else get customers who apologize for “complicated orders” and then order the easiest thing in the world? This happens to ...
Read more >
Restitution Process - Department of Justice
A court may also decline to order restitution if it finds that determining restitution in a case is too complex.
Read more >
karolina bumbak on Instagram: “Hi guys Adding the card payment ...
gvg_ceramics Hi guys Adding the card payment option turned out to be a little too complicated to resolve in one week. I need...
Read more >
Complex Payment Terms - Selling/CRM - ERPNext Forum
All your items are registered as being sold two times or even more if you have your payment terms split into more terms....
Read more >
A Fax is too complicated GoDaddy - Andy Polaine
After I queried GoDaddy about whether they really needed my security details in order to tell me their fax number, I got this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found