diff options
| author | ivan <ivan> | 2007-04-12 02:27:37 +0000 | 
|---|---|---|
| committer | ivan <ivan> | 2007-04-12 02:27:37 +0000 | 
| commit | 96c091e3dbda1eb26635aee05d29e6b9ce8bc15c (patch) | |
| tree | f6a22f87f82d9d300211b3686bd3414bddd30656 /httemplate | |
| parent | ab79178a5d9077be8d130dea76a3dfb0da8c35fb (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
Diffstat (limited to 'httemplate')
| -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";  %  }  %}  % | 
