summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2010-03-08 22:13:22 +0000
committerivan <ivan>2010-03-08 22:13:22 +0000
commit5c2a2810f7a6bd5cd3edbba3bb84dc13819585b8 (patch)
treece438af1bf420bc50fc085913053ff76aa0ccdc4
parent06a85a88bfdb0d3fc79ee055eb8327658dfe63ab (diff)
fix ACH refunds w/IPPay. B:OP 3.01 and IPPay 0.05_02 required. RT#_7673
-rw-r--r--FS/FS/cust_main.pm34
1 files changed, 28 insertions, 6 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index d4ce0fd67..3c91a3148 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -4881,9 +4881,20 @@ sub realtime_refund_bop {
) {
warn " attempting void\n" if $DEBUG > 1;
my $void = new Business::OnlinePayment( $processor, @bop_options );
- $content{'card_number'} = $cust_pay->payinfo
- if $cust_pay->payby eq 'CARD'
- && $void->can('info') && $void->info('CC_void_requires_card');
+ if ( $void->can('info') ) {
+ if ( $cust_pay->payby eq 'CARD'
+ && $void->info('CC_void_requires_card') )
+ {
+ $content{'card_number'} = $cust_pay->payinfo
+ } elsif ( $cust_pay->payby eq 'CHEK'
+ && $void->info('ECHECK_void_requires_account') )
+ {
+ $cust_pay->payinfo
+ ( $content{'account_number'}, $content{'routing_code'} ) =
+ split('@', $cust_pay->payinfo);
+ $content{'name'} = $self->get('first'). ' '. $self->get('last');
+ }
+ }
$void->content( 'action' => 'void', %content );
$void->submit();
if ( $void->is_success ) {
@@ -6224,9 +6235,20 @@ sub _new_realtime_refund_bop {
) {
warn " attempting void\n" if $DEBUG > 1;
my $void = new Business::OnlinePayment( $processor, @bop_options );
- $content{'card_number'} = $cust_pay->payinfo
- if $cust_pay->payby eq 'CARD'
- && $void->can('info') && $void->info('CC_void_requires_card');
+ if ( $void->can('info') ) {
+ if ( $cust_pay->payby eq 'CARD'
+ && $void->info('CC_void_requires_card') )
+ {
+ $content{'card_number'} = $cust_pay->payinfo;
+ } elsif ( $cust_pay->payby eq 'CHEK'
+ && $void->info('ECHECK_void_requires_account') )
+ {
+ $cust_pay->payinfo
+ ( $content{'account_number'}, $content{'routing_code'} ) =
+ split('@', $cust_pay->payinfo);
+ $content{'name'} = $self->get('first'). ' '. $self->get('last');
+ }
+ }
$void->content( 'action' => 'void', %content );
$void->submit();
if ( $void->is_success ) {