bitlair_mqtt: Add hook to publish the amount of cash
This commit is contained in:
parent
be4abcb9dc
commit
96d0e0f51c
1 changed files with 7 additions and 0 deletions
|
@ -17,3 +17,10 @@ sub hook_checkout {
|
|||
for 1..$entry->quantity;
|
||||
}
|
||||
}
|
||||
|
||||
sub hook_user_balance {
|
||||
my ($class, $user, $old, $delta, $new, $transaction_id) = @_;
|
||||
|
||||
$mqtt->publish("bitlair/bank/cash" => -$new)
|
||||
if $user eq "-cash";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue