8
0
Fork 0

Import from revbank fork

This commit is contained in:
polyfloyd 2025-05-07 00:20:31 +02:00
commit 30c55d21de
6 changed files with 152 additions and 0 deletions

19
bitlair_mqtt Normal file
View file

@ -0,0 +1,19 @@
#!perl
use Cwd ();
use Net::MQTT::Simple;
my $mqtt = Net::MQTT::Simple->new("mqtt.bitlair.nl");
sub command { NEXT }
sub hook_checkout {
my ($class, $cart, $user, $transaction_id) = @_;
my @entries = $cart->entries('product_id') or return;
for my $entry (@entries) {
$mqtt->publish("bitlair/pos/product" => $entry->{description})
for 1..$entry->quantity;
}
}