###
my $cc_surcharge = 0;
- my $cc_surcharge_pct = $conf->config('credit-card-surcharge-percentage');
+ my $cc_surcharge_pct = 0;
+ $cc_surcharge_pct = $conf->config('credit-card-surcharge-percentage')
+ if $conf->config('credit-card-surcharge-percentage');
# always add cc surcharge if called from event
if($options{'cc_surcharge_from_event'} && $cc_surcharge_pct > 0) {
# amount as post-surcharge
$cc_surcharge = $options{'amount'} - ($options{'amount'} / ( 1 + $cc_surcharge_pct/100 ));
}
- if ( $cc_surcharge > 0) {
- $cc_surcharge = sprintf("%.2f",$cc_surcharge);
- $options{'cc_surcharge'} = $cc_surcharge;
- }
-
+
+ $cc_surcharge = sprintf("%.2f",$cc_surcharge) if $cc_surcharge > 0;
+ $options{'cc_surcharge'} = $cc_surcharge;
+
if ( $DEBUG ) {
warn "$me realtime_bop (new): $options{method} $options{amount}\n";