mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-25 23:21:21 +01:00
24 lines
656 B
Python
24 lines
656 B
Python
from .models import Charges
|
|
|
|
|
|
def public_charge(charge: Charges):
|
|
c = {
|
|
"id": charge.id,
|
|
"description": charge.description,
|
|
"onchainaddress": charge.onchainaddress,
|
|
"payment_request": charge.payment_request,
|
|
"payment_hash": charge.payment_hash,
|
|
"time": charge.time,
|
|
"amount": charge.amount,
|
|
"balance": charge.balance,
|
|
"paid": charge.paid,
|
|
"timestamp": charge.timestamp,
|
|
"time_elapsed": charge.time_elapsed,
|
|
"time_left": charge.time_left,
|
|
"paid": charge.paid,
|
|
}
|
|
|
|
if charge.paid:
|
|
c["completelink"] = charge.completelink
|
|
|
|
return c
|