mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-03-15 20:30:28 +01:00
fix indentation
This commit is contained in:
parent
89266f9aa2
commit
6a262428cd
1 changed files with 18 additions and 20 deletions
|
@ -55,26 +55,24 @@ async def on_invoice_paid(payment: Payment) -> None:
|
||||||
tagged = target.tag in payment.extra
|
tagged = target.tag in payment.extra
|
||||||
if tagged or target.percent > 0:
|
if tagged or target.percent > 0:
|
||||||
|
|
||||||
if tagged:
|
if tagged:
|
||||||
memo = f"Pushed tagged payment to {target.alias}"
|
memo = f"Pushed tagged payment to {target.alias}"
|
||||||
amount_msat = int(amount_to_split)
|
amount_msat = int(amount_to_split)
|
||||||
else:
|
else:
|
||||||
amount_msat = int(amount_to_split * target.percent / 100)
|
amount_msat = int(amount_to_split * target.percent / 100)
|
||||||
memo = (
|
memo = f"Split payment: {target.percent}% for {target.alias or target.wallet}"
|
||||||
f"Split payment: {target.percent}% for {target.alias or target.wallet}"
|
|
||||||
|
payment_hash, payment_request = await create_invoice(
|
||||||
|
wallet_id=target.wallet,
|
||||||
|
amount=int(amount_msat / 1000),
|
||||||
|
internal=True,
|
||||||
|
memo=memo,
|
||||||
)
|
)
|
||||||
|
|
||||||
payment_hash, payment_request = await create_invoice(
|
extra = {**payment.extra, "splitted": True}
|
||||||
wallet_id=target.wallet,
|
|
||||||
amount=int(amount_msat / 1000),
|
|
||||||
internal=True,
|
|
||||||
memo=memo,
|
|
||||||
)
|
|
||||||
|
|
||||||
extra = {**payment.extra, "splitted": True}
|
await pay_invoice(
|
||||||
|
payment_request=payment_request,
|
||||||
await pay_invoice(
|
wallet_id=payment.wallet_id,
|
||||||
payment_request=payment_request,
|
extra=extra,
|
||||||
wallet_id=payment.wallet_id,
|
)
|
||||||
extra=extra,
|
|
||||||
)
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue