diff options
author | Mark Wells <mark@freeside.biz> | 2015-11-05 15:56:33 -0800 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2015-11-05 15:56:33 -0800 |
commit | 59285fa7c07ac86914f3998f2635caf067c07506 (patch) | |
tree | 854cf65ef24c3bef47828f6e8f6a41da0ba85b63 | |
parent | 5ac8279c29897a5dc620047b5579f83a7ed0ae9c (diff) | |
parent | 5da68ff1a7c638e30cbafbc9b0749f1e82b333df (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
-rw-r--r-- | FS/FS/cust_main/Billing_Realtime.pm | 16 | ||||
-rwxr-xr-x | FS/bin/freeside-paymentech-download | 2 | ||||
-rwxr-xr-x | FS/bin/freeside-paymentech-upload | 2 |
3 files changed, 15 insertions, 5 deletions
diff --git a/FS/FS/cust_main/Billing_Realtime.pm b/FS/FS/cust_main/Billing_Realtime.pm index 7a204073b..c700cf7f8 100644 --- a/FS/FS/cust_main/Billing_Realtime.pm +++ b/FS/FS/cust_main/Billing_Realtime.pm @@ -11,6 +11,7 @@ use FS::Record qw( qsearch qsearchs ); use FS::payby; use FS::cust_pay; use FS::cust_pay_pending; +use FS::cust_bill_pay; use FS::cust_refund; use FS::banned_pay; @@ -266,7 +267,10 @@ sub _bop_defaults { } } - $options->{payinfo} = $self->payinfo unless exists( $options->{payinfo} ); + unless ( exists( $options->{'payinfo'} ) ) { + $options->{'payinfo'} = $self->payinfo; + $options->{'paymask'} = $self->paymask; + } # Default invoice number if the customer has exactly one open invoice. if( ! $options->{'invnum'} ) { @@ -888,7 +892,7 @@ sub _realtime_bop_result { '_date' => '', 'payby' => $cust_pay_pending->payby, 'payinfo' => $options{'payinfo'}, - 'paymask' => $options{'paymask'}, + 'paymask' => $options{'paymask'} || $cust_pay_pending->paymask, 'paydate' => $cust_pay_pending->paydate, 'pkgnum' => $cust_pay_pending->pkgnum, 'discount_term' => $options{'discount_term'}, @@ -1366,6 +1370,8 @@ sub realtime_refund_bop { warn " $_ => $options{$_}\n" foreach keys %options; } + my %content = (); + ### # look up the original payment and optionally a gateway for that payment ### @@ -1384,6 +1390,9 @@ sub realtime_refund_bop { or return "Unknown paynum $options{'paynum'}"; $amount ||= $cust_pay->paid; + my @cust_bill_pay = qsearch('cust_bill_pay', { paynum=>$cust_pay->paynum }); + $content{'invoice_number'} = $cust_bill_pay[0]->invnum if @cust_bill_pay; + if ( $cust_pay->get('processor') ) { ($gatewaynum, $processor, $auth, $order_number) = ( @@ -1456,7 +1465,8 @@ sub realtime_refund_bop { eval "use $namespace"; die $@ if $@; - my %content = ( + %content = ( + %content, 'type' => $options{method}, 'login' => $login, 'password' => $password, diff --git a/FS/bin/freeside-paymentech-download b/FS/bin/freeside-paymentech-download index 1b2f95175..9a1f609bc 100755 --- a/FS/bin/freeside-paymentech-download +++ b/FS/bin/freeside-paymentech-download @@ -20,7 +20,7 @@ getopts('vta:'); sub log_and_die { my $message = shift; - my $log = FS::Log->new('freeside-paymenttech-download'); + my $log = FS::Log->new('freeside-paymentech-download'); $log->error($message); die $message; } diff --git a/FS/bin/freeside-paymentech-upload b/FS/bin/freeside-paymentech-upload index a6e6a5d28..5ae147d07 100755 --- a/FS/bin/freeside-paymentech-upload +++ b/FS/bin/freeside-paymentech-upload @@ -20,7 +20,7 @@ getopts('avtp:'); sub log_and_die { my $message = shift; - my $log = FS::Log->new('freeside-paymenttech-upload'); + my $log = FS::Log->new('freeside-paymentech-upload'); $log->error($message); die $message; } |