fix issue with splitting to multiple wallets-queue
This commit is contained in:
parent
f7ca9d1c82
commit
ba74d0ef7a
|
@ -28,6 +28,10 @@ async def on_invoice_paid(payment: Payment) -> None:
|
||||||
|
|
||||||
# now we make some special internal transfers (from no one to the receiver)
|
# now we make some special internal transfers (from no one to the receiver)
|
||||||
targets = await get_targets(payment.wallet_id)
|
targets = await get_targets(payment.wallet_id)
|
||||||
|
|
||||||
|
if not targets:
|
||||||
|
return
|
||||||
|
|
||||||
transfers = [
|
transfers = [
|
||||||
(target.wallet, int(target.percent * payment.amount / 100))
|
(target.wallet, int(target.percent * payment.amount / 100))
|
||||||
for target in targets
|
for target in targets
|
||||||
|
@ -41,9 +45,6 @@ async def on_invoice_paid(payment: Payment) -> None:
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
if not targets:
|
|
||||||
return
|
|
||||||
|
|
||||||
# mark the original payment with one extra key, "splitted"
|
# mark the original payment with one extra key, "splitted"
|
||||||
# (this prevents us from doing this process again and it's informative)
|
# (this prevents us from doing this process again and it's informative)
|
||||||
# and reduce it by the amount we're going to send to the producer
|
# and reduce it by the amount we're going to send to the producer
|
||||||
|
|
Loading…
Reference in New Issue
Block a user