Skip to content

Commit

Permalink
add extra check for payment state
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Jul 26, 2024
1 parent 125ce9e commit b66f065
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cashu/lightning/lnbits.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,14 @@ async def pay_invoice(
# we do this to get the fee and preimage
payment: PaymentStatus = await self.get_payment_status(checking_id)

if not payment.paid:
return PaymentResponse(
ok=False,
error_message="Payment failed.",
)

return PaymentResponse(
ok=True,
ok=payment.paid,
checking_id=checking_id,
fee=payment.fee,
preimage=payment.preimage,
Expand Down

0 comments on commit b66f065

Please sign in to comment.