projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
finish fixing declined signup of prepaid package provisioning to RADIUS anyway, RT...
[freeside.git]
/
FS
/
FS
/
cust_main
/
Billing_Realtime.pm
diff --git
a/FS/FS/cust_main/Billing_Realtime.pm
b/FS/FS/cust_main/Billing_Realtime.pm
index
dc896fa
..
1006b95
100644
(file)
--- a/
FS/FS/cust_main/Billing_Realtime.pm
+++ b/
FS/FS/cust_main/Billing_Realtime.pm
@@
-322,7
+322,9
@@
sub realtime_bop {
###
my $cc_surcharge = 0;
###
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) {
# always add cc surcharge if called from event
if($options{'cc_surcharge_from_event'} && $cc_surcharge_pct > 0) {
@@
-335,11
+337,10
@@
sub realtime_bop {
# amount as post-surcharge
$cc_surcharge = $options{'amount'} - ($options{'amount'} / ( 1 + $cc_surcharge_pct/100 ));
}
# 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";
if ( $DEBUG ) {
warn "$me realtime_bop (new): $options{method} $options{amount}\n";
@@
-460,9
+461,9
@@
sub realtime_bop {
$content{bank_state} = exists($options{'paystate'})
? $options{'paystate'}
: $self->getfield('paystate');
$content{bank_state} = exists($options{'paystate'})
? $options{'paystate'}
: $self->getfield('paystate');
- $content{account_type}
= exists(
$options{'paytype'})
- ? uc($options{'paytype'})
|| 'CHECKING'
- : uc($self->getfield('paytype')) || 'CHECKING';
+ $content{account_type}
= (exists($options{'paytype'}) &&
$options{'paytype'})
+ ? uc($options{'paytype'})
+ : uc($self->getfield('paytype')) || '
PERSONAL
CHECKING';
$content{account_name} = $self->getfield('first'). ' '.
$self->getfield('last');
$content{account_name} = $self->getfield('first'). ' '.
$self->getfield('last');
@@
-985,7
+986,7
@@
sub _realtime_bop_result {
my $error = $placeholder->depended_delete;
$error ||= $placeholder->delete;
warn "error removing provisioning jobs after declined paypendingnum ".
my $error = $placeholder->depended_delete;
$error ||= $placeholder->delete;
warn "error removing provisioning jobs after declined paypendingnum ".
- $cust_pay_pending->paypendingnum. "\n";
+ $cust_pay_pending->paypendingnum. "
: $error
\n";
} else {
my $e = "error finding job $jobnum for declined paypendingnum ".
$cust_pay_pending->paypendingnum. "\n";
} else {
my $e = "error finding job $jobnum for declined paypendingnum ".
$cust_pay_pending->paypendingnum. "\n";