diff options
author | ivan <ivan> | 2007-04-12 02:27:36 +0000 |
---|---|---|
committer | ivan <ivan> | 2007-04-12 02:27:36 +0000 |
commit | caf9f9932406e627207197c577c211f3fda0be20 (patch) | |
tree | aa9a8201e87702b3e4150e05fae906401c12054c | |
parent | 5a322e9cf2be599b4c6bcf3959178506dd5992be (diff) |
remove 'backend-realtime' flag required for recharges, want that just for signups, running recharges right away by default is fine. also fix the 'fatal error - unknown payby' error that'll probably never be reached
-rwxr-xr-x | httemplate/misc/process/recharge_svc.html | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/httemplate/misc/process/recharge_svc.html b/httemplate/misc/process/recharge_svc.html index df6715630..dc9d5ea2d 100755 --- a/httemplate/misc/process/recharge_svc.html +++ b/httemplate/misc/process/recharge_svc.html @@ -28,7 +28,8 @@ % %unless ($error) { % -%my ($amount, $seconds, $up, $down, $total) = (0, 0, 0, 0, 0); +% my ($amount, $seconds, $up, $down, $total) = (0, 0, 0, 0, 0); +% #should probably use payby.pm but whatever % if ($payby eq 'PREP') { % $error = $cust_main->get_prepay($prepaid, \$amount, \$seconds, \$up, \$down, \$total) % || $svc_acct->increment_seconds($seconds) @@ -36,7 +37,7 @@ % || $svc_acct->increment_downbytes($down) % || $svc_acct->increment_totalbytes($total) % || $cust_main->insert_cust_pay_prepay( $amount, $prepaid ); -% }elsif ($payby =~ /^(CARD|DCRD|CHEK|DCHK|LECB|BILL|COMP)$/) { +% } elsif ( $payby =~ /^(CARD|DCRD|CHEK|DCHK|LECB|BILL|COMP)$/ ) { % my $part_pkg = $svc_acct->cust_svc->cust_pkg->part_pkg; % $amount = $part_pkg->option('recharge_amount', 1); % my %rhash = map { $_ =~ /^recharge_(.*)$/; $1, $part_pkg->option($_, 1) } @@ -54,17 +55,16 @@ % % $error ||= $svc_acct->recharge(\%rhash); % -% if ($conf->exists('backend-realtime')) { -% my $old_balance = $cust_main->balance; -% $error ||= $cust_main->bill; -% $cust_main->apply_payments_and_credits unless $error; -% my $bill_error = $cust_main->collect('realtime' => 1) unless $error; -% $error ||= "Failed to collect - $bill_error" -% if ($cust_main->balance > $old_balance && $cust_main->balance > 0 -% && $payby ne 'BILL'); -% } -% }else{ -$ $error "fatal error - unknown payby: $payby"; +% my $old_balance = $cust_main->balance; +% $error ||= $cust_main->bill; +% $cust_main->apply_payments_and_credits unless $error; +% my $bill_error = $cust_main->collect('realtime' => 1) unless $error; +% $error ||= "Failed to collect - $bill_error" +% if $cust_main->balance > $old_balance && $cust_main->balance > 0 +% && $payby ne 'BILL'; +% +% } else { +% $error = "fatal error - unknown payby: $payby"; % } %} % |