projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a87e91e
)
pass an invoice_number for void/refund when available, RT#37292
author
Ivan Kohler
<ivan@freeside.biz>
Thu, 5 Nov 2015 18:44:31 +0000
(10:44 -0800)
committer
Ivan Kohler
<ivan@freeside.biz>
Thu, 5 Nov 2015 18:44:31 +0000
(10:44 -0800)
FS/FS/cust_main/Billing_Realtime.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cust_main/Billing_Realtime.pm
b/FS/FS/cust_main/Billing_Realtime.pm
index
7a20407
..
403d8dd
100644
(file)
--- 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::payby;
use FS::cust_pay;
use FS::cust_pay_pending;
+use FS::cust_bill_pay;
use FS::cust_refund;
use FS::banned_pay;
use FS::cust_refund;
use FS::banned_pay;
@@
-1366,6
+1367,8
@@
sub realtime_refund_bop {
warn " $_ => $options{$_}\n" foreach keys %options;
}
warn " $_ => $options{$_}\n" foreach keys %options;
}
+ my %content = ();
+
###
# look up the original payment and optionally a gateway for that payment
###
###
# look up the original payment and optionally a gateway for that payment
###
@@
-1384,6
+1387,9
@@
sub realtime_refund_bop {
or return "Unknown paynum $options{'paynum'}";
$amount ||= $cust_pay->paid;
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) =
(
if ( $cust_pay->get('processor') ) {
($gatewaynum, $processor, $auth, $order_number) =
(
@@
-1456,7
+1462,8
@@
sub realtime_refund_bop {
eval "use $namespace";
die $@ if $@;
eval "use $namespace";
die $@ if $@;
- my %content = (
+ %content = (
+ %content,
'type' => $options{method},
'login' => $login,
'password' => $password,
'type' => $options{method},
'login' => $login,
'password' => $password,