[API feedback] failed payment shows SUCCESS status then reimbursed with the same invoice/payment hash
When a receiver node goes offline the payment from Blink fails, but the API still returns a status: SUCCESS then has a refund transaction with the same payment details, but direction: RECEIVE.
This causes a monitoring application (eg a lighningatm) signaling a successful payout before it could even be aware of the refund - which most wouldn't expect anyway.
Steps to reproduce:
- Create invoice with a LN node and then turn if off (simulate failed payment)
- Call mutation
lnInvoiceFeeProbeon the invoice, returns a "routing failed" error but also an estimate of the fee, all good - Try making a payment that fails because recipient offline
- Call query
TransactionsByPaymentHash, with the failed payment - Two entries appear in the response:
I have seen this paying to Phoenix in some cases, the payment appears successful, but does not arrive in Phoenix. Looking at the transaction history here is a subsequent refund with the same Phoenix invoice in the payment details
The settlementFee value in the refund transaction is confusing since it is an income in this case.
Desired solution: the API should return a single failure and not signal SUCCESS.
There is a PR underway to offer a solution to this:
- [x] https://github.com/GaloyMoney/galoy/pull/4039
FYI @callebtc, thank you again for pointing it out.
OK there has been a new status added: PENDING so failed payments should not return status: SUCCESS any more.