fix ACH refunds w/IPPay. B:OP 3.01 and IPPay 0.05_02 required. RT#_7673
authorivan <ivan>
Mon, 8 Mar 2010 22:13:22 +0000 (22:13 +0000)
committerivan <ivan>
Mon, 8 Mar 2010 22:13:22 +0000 (22:13 +0000)
FS/FS/cust_main.pm

index d4ce0fd..3c91a31 100644 (file)
@@ -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 ) {