From: Ivan Kohler Date: Thu, 5 Nov 2015 18:44:38 +0000 (-0800) Subject: Merge branch 'master' of git.freeside.biz:/home/git/freeside X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=5da68ff1a7c638e30cbafbc9b0749f1e82b333df;hp=-c Merge branch 'master' of git.freeside.biz:/home/git/freeside --- 5da68ff1a7c638e30cbafbc9b0749f1e82b333df diff --combined FS/FS/cust_main/Billing_Realtime.pm index 403d8dd1c,c5039ff47..c700cf7f8 --- a/FS/FS/cust_main/Billing_Realtime.pm +++ b/FS/FS/cust_main/Billing_Realtime.pm @@@ -11,7 -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; @@@ -267,7 -266,10 +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'} ) { @@@ -889,7 -891,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'}, @@@ -1367,8 -1369,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 ### @@@ -1387,9 -1387,6 +1390,9 @@@ 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) = ( @@@ -1462,8 -1459,7 +1465,8 @@@ eval "use $namespace"; die $@ if $@; - my %content = ( + %content = ( + %content, 'type' => $options{method}, 'login' => $login, 'password' => $password,