diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-08-03 13:09:05 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-08-03 13:09:05 -0700 |
commit | 45346fd655ba53b82c80b920da945cc0b87ece01 (patch) | |
tree | 25453139d733720bb9c2b92817d35adffd63c776 /httemplate | |
parent | 8b4b2a97a84d17087c3fac19b8f768ca146cf897 (diff) |
selfservice payment fees, RT#18345
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/elements/tr-amount_fee.html | 4 | ||||
-rw-r--r-- | httemplate/misc/payment.cgi | 15 |
2 files changed, 4 insertions, 15 deletions
diff --git a/httemplate/elements/tr-amount_fee.html b/httemplate/elements/tr-amount_fee.html index a1a9e3433..12488521a 100644 --- a/httemplate/elements/tr-amount_fee.html +++ b/httemplate/elements/tr-amount_fee.html @@ -90,7 +90,9 @@ if ( $amount > 0 ) { $amount += $fee if $fee && $fee_display eq 'subtract'; - &{ $opt{post_fee_callback} }( \$amount ) if $opt{post_fee_callback}; + #&{ $opt{post_fee_callback} }( \$amount ) if $opt{post_fee_callback}; + $amount += $amount * $opt{'surcharge_percentage'}/100 + if $opt{'surcharge_percentage'} > 0; $amount = sprintf("%.2f", $amount); } diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi index 1ae15b930..e221c600a 100644 --- a/httemplate/misc/payment.cgi +++ b/httemplate/misc/payment.cgi @@ -16,7 +16,7 @@ 'process-display' => scalar($conf->config('manual_process-display')), 'process-skip-first' => $conf->exists('manual_process-skip_first'), 'num_payments' => scalar($cust_main->cust_pay), - 'post_fee_callback' => $post_fee_callback, + 'surcharge_percentage' => scalar($conf->config('credit-card-surcharge-percentage')), &> <& /elements/tr-select-discount_term.html, @@ -269,19 +269,6 @@ if ( $balance > 0 ) { $amount = $balance; } -my $post_fee_callback = sub { - my( $amountref ) = @_; - - return unless $$amountref > 0; - - my $conf = new FS::Conf; - - my $cc_surcharge_pct = $conf->config('credit-card-surcharge-percentage'); - $$amountref += $$amountref * $cc_surcharge_pct/100 if $cc_surcharge_pct > 0; - - $$amountref = sprintf("%.2f", $$amountref); -}; - my $payunique = "webui-payment-". time. "-$$-". rand() * 2**32; </%init> |