add amount to livestream
This commit is contained in:
parent
c8cdf2f1d2
commit
1032ad3417
1 changed files with 8 additions and 5 deletions
|
|
@ -86,16 +86,19 @@ async def lnurl_callback(
|
||||||
|
|
||||||
ls = await get_livestream_by_track(track_id)
|
ls = await get_livestream_by_track(track_id)
|
||||||
|
|
||||||
extra_amount = amount_received - int(
|
extra_amount = amount_received - int(amount_received * (100 - ls.fee_pct) / 100)
|
||||||
amount_received * (100 - ls.fee_pct) / 100
|
|
||||||
) # msats
|
|
||||||
|
|
||||||
payment_hash, payment_request = await create_invoice(
|
payment_hash, payment_request = await create_invoice(
|
||||||
wallet_id=ls.wallet,
|
wallet_id=ls.wallet,
|
||||||
amount=int(amount_received / 1000), # sats
|
amount=int(amount_received / 1000),
|
||||||
memo=await track.fullname(),
|
memo=await track.fullname(),
|
||||||
unhashed_description=(await track.lnurlpay_metadata()).encode(),
|
unhashed_description=(await track.lnurlpay_metadata()).encode(),
|
||||||
extra={"tag": "livestream", "track": track.id, "comment": comment},
|
extra={
|
||||||
|
"tag": "livestream",
|
||||||
|
"track": track.id,
|
||||||
|
"comment": comment,
|
||||||
|
"amount": int(extra_amount / 1000),
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
if amount_received < track.price_msat:
|
if amount_received < track.price_msat:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue