mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2024-11-19 18:11:30 +01:00
fix typo in tasks and add/fix extra props
This commit is contained in:
parent
c22329e86b
commit
ea91c37489
@ -86,9 +86,13 @@ async def lnurl_callback(
|
||||
|
||||
ls = await get_livestream_by_track(track_id)
|
||||
|
||||
extra_amount = amount_received - int(
|
||||
amount_received * (100 - ls.fee_pct) / 100
|
||||
) # msats
|
||||
|
||||
payment_hash, payment_request = await create_invoice(
|
||||
wallet_id=ls.wallet,
|
||||
amount=int(amount_received / 1000),
|
||||
amount=int(amount_received / 1000), # sats
|
||||
memo=await track.fullname(),
|
||||
unhashed_description=(await track.lnurlpay_metadata()).encode(),
|
||||
extra={"tag": "livestream", "track": track.id, "comment": comment},
|
||||
|
@ -41,21 +41,26 @@ async def on_invoice_paid(payment: Payment) -> None:
|
||||
ls = await get_livestream_by_track(track.id)
|
||||
assert ls, f"track {track.id} is not associated with a livestream"
|
||||
|
||||
# now we make a special kind of internal transfer
|
||||
amount = int(payment.amount * (100 - ls.fee_pct) / 100)
|
||||
amount = int(payment.amount * (100 - ls.fee_pct) / 100) # msats
|
||||
|
||||
payment_hash, payment_request = await create_invoice(
|
||||
wallet_id=tpos.tip_wallet,
|
||||
amount=amount, # sats
|
||||
wallet_id=producer.wallet,
|
||||
amount=int(amount / 1000), # sats
|
||||
internal=True,
|
||||
memo=f"Revenue from '{track.name}'.",
|
||||
)
|
||||
logger.debug(f"livestream: producer invoice created: {payment_hash}")
|
||||
logger.debug(
|
||||
f"livestream: producer invoice created: {payment_hash}, {amount} msats"
|
||||
)
|
||||
|
||||
checking_id = await pay_invoice(
|
||||
payment_request=payment_request,
|
||||
wallet_id=payment.wallet_id,
|
||||
extra={"tag": "livestream"},
|
||||
extra={
|
||||
**payment.extra,
|
||||
"shared_with": f"Producer ID: {producer.id}",
|
||||
"received": payment.amount,
|
||||
},
|
||||
)
|
||||
logger.debug(f"livestream: producer invoice paid: {checking_id}")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user