blink icon indicating copy to clipboard operation
blink copied to clipboard

[API feedback] failed payment shows SUCCESS status then reimbursed with the same invoice/payment hash

Open openoms opened this issue 1 year ago • 1 comments

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 lnInvoiceFeeProbe on 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: image

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.

openoms avatar Feb 18 '24 18:02 openoms

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.

openoms avatar Feb 21 '24 09:02 openoms

OK there has been a new status added: PENDING so failed payments should not return status: SUCCESS any more.

openoms avatar Mar 07 '24 18:03 openoms