diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-11-05 10:44:21 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-11-05 10:44:21 -0800 |
commit | 3399a25eba1da01491ede8a86cc99b5be0b1dfe8 (patch) | |
tree | db2527706eba020cb71912a9e5b0644bb36c6448 | |
parent | 2b3eb91eaa841175eeb9f998a4457427670e7df0 (diff) |
pass an invoice_number for void/refund when available, RT#37292
-rw-r--r-- | FS/FS/cust_main/Billing_Realtime.pm | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/FS/FS/cust_main/Billing_Realtime.pm b/FS/FS/cust_main/Billing_Realtime.pm index 06e1a4f8b..bb2b41ff5 100644 --- a/FS/FS/cust_main/Billing_Realtime.pm +++ b/FS/FS/cust_main/Billing_Realtime.pm @@ -11,6 +11,7 @@ use FS::Misc qw( send_email ); 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; @@ -1357,6 +1358,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 ### @@ -1375,6 +1378,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) = ( @@ -1447,7 +1453,8 @@ sub realtime_refund_bop { eval "use $namespace"; die $@ if $@; - my %content = ( + %content = ( + %content, 'type' => $options{method}, 'login' => $login, 'password' => $password, |