Bitlair changes

This commit is contained in:
polyfloyd 2022-06-12 21:36:56 +02:00
parent 996159a2ad
commit 71f1600312
5 changed files with 14 additions and 7 deletions

View file

@ -72,7 +72,7 @@ sub hook_user_balance($class, $username, $old, $delta, $new, @) {
my $sign = $delta->cents >= 0 ? '+' : '-';
my $rood = $new->cents < 0 ? '31;' : '';
my $abs = $delta->abs;
my $warn = $new->cents < -2300 ? " \e[5;1m(!!)\e[0m" : "";
my $warn = $new->cents < -1337 ? " \e[5;1m(!!)\e[0m" : "";
$_ = $_->string("+") for $old, $new;
printf "New balance for $username: $old $sign $abs = \e[${rood}1m$new\e[0m$warn\n",

View file

@ -46,6 +46,10 @@ sub how :Tab(&how_tab) ($self, $cart, $input, @) {
return shift @{ $how->{prompts} }, \&how_prompt;
}
if ( ($input eq "iban") && ($self->{amount} < 10 || $self->{amount} == 25) ) {
return REJECT, "\n\e[31;1mPlease transfer at least 10 EUR and not 25 or 32 EUR when using iban\e[0m\n\n";
}
my $contra =
$how->{_key} eq 'cash' ? '-cash'
: $how->{_key} eq 'reimburse' ? '-expenses/reimbursed'

View file

@ -20,8 +20,8 @@
use IPC::Open2 qw(open2);
use List::Util qw(sum);
my $iban = "NL99ABCD1234567890";
my $beneficiary = "Account Name";
my $iban = "NL89RABO0111741386";
my $beneficiary = "Stichting Bitlair";
sub hook_checkout($class, $cart, $user, $transaction_id, @) {
my @entries = $cart->entries("is_deposit");
@ -41,7 +41,7 @@ sub hook_checkout($class, $cart, $user, $transaction_id, @) {
"EUR" . $amount, # Amount
"",
"",
"rb $user",
"Deposit $user (RB QR)",
"",
);
close $in;
@ -57,6 +57,8 @@ sub hook_checkout($class, $cart, $user, $transaction_id, @) {
$lines[3] =~ s/$/ EPC QR codes. N26 also works./;
$lines[5] =~ s/$/ For manual transfers, use this/;
$lines[6] =~ s/$/ IBAN: $iban/;
$lines[7] =~ s/$/ Benificiary: $beneficiary/;
$lines[8] =~ s/$/ Description: Deposit $user/;
print @lines;
}

View file

@ -5,10 +5,11 @@ sub hook_deposit_methods($class, $message, $hash, @) {
Please type one of the following:
'iban': IBAN transfer (NL 69 ABNA 0431 1582 07)
'iban': IBAN transfer (Min 10 EUR / NL89 RABO 0111 7413 86)
'cash': Cash in the cash box
'reimburse': Reimbursement of expenses agreed upon in advance
Note: we require an invoice or receipt with this exact amount!
Note #1: we require an invoice or receipt with this exact amount!
Note #2: please do not use this plugin for amounts >20 EUR
'other': Provide a manual description
END

View file

@ -17,7 +17,7 @@ sub hook_checkout_done($class, $cart, $user, $transaction_id, @) {
my $balance = RevBank::Users::balance($user) or return;
my $since = RevBank::Users::since($user);
if ($balance < -22.00) {
if ($balance < -13.37) {
_box(
"Hoi $user,",
"",