Failed refunds modify the perceived payment on the order
Opened this issue · 0 comments
Describe the bug
I tried asking about this on discord to verify it's a bug, but haven't seen a response – probably y'all are busy, but this is causing me a lot of issues and is the main issue remaining keeping me from releasing my new vendure-based site.
There are multiple reasons why in some cases issuing a refund isn't possible through my card processor; thus when I try to issue it, there is the chance that the Refund will end up in a Failed state, meaning the transaction did not occur.
That's fine, but when I do the order still acts like the Refund succeeded and there doesn't seem to be any way for me to attempt the refund again or even just see that it's not been done. Being able to record a manual refund would be great, but I want that to be a specific manual operation. I can't even get the order back into the state before without adding a manual payment for the amount that wasn't really refunded.
To Reproduce
Steps to reproduce the behavior:
- Have a payment handler with a createRefund which returns a failed state (throw an exception, return
{state: 'Failed'}
, whatever - Issue the refund on an order where a refund will occur
Expected behavior
My expectation would be that if the refund fails nothing happens at all on the order; I understand that modifying the order is done in such a way that this isn't really doable, which is frustrating but okay. However, when I add the items back in now it shows that I need to arrange additional payment, even though the original payment is still there and has not in any way been refunded in whole or in part.
Environment (please complete the following information):
- @vendure/core version: 3.0.5
- Nodejs version 22.10.0
- Database (mysql/postgres etc): postgres 14
Additional context
I'm open to workarounds or suggestions for why this isn't a good strategy, I just want to be able to have vendure show reality.... at the least if the refund fails it should still show that the original payment is fully there.
Thanks for all you do