freeside/FS/FS cust_main.pm,1.171,1.172

ivan ivan at pouncequick.420.am
Sun Mar 13 03:12:22 PST 2005


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory pouncequick:/tmp/cvs-serv16600

Modified Files:
	cust_main.pm 
Log Message:
add some additional debugging to refunds

Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.171
retrieving revision 1.172
diff -u -d -r1.171 -r1.172
--- cust_main.pm	12 Mar 2005 14:31:47 -0000	1.171
+++ cust_main.pm	13 Mar 2005 11:12:19 -0000	1.172
@@ -2122,6 +2122,7 @@
 
   #first try void if applicable
   if ( $cust_pay && $cust_pay->paid == $amount ) { #and check dates?
+    warn "FS::cust_main::realtime_bop: attempting void\n" if $DEBUG;
     my $void = new Business::OnlinePayment( $processor, @bop_options );
     $void->content( 'action' => 'void', %content );
     $void->submit();
@@ -2134,10 +2135,14 @@
         warn $e;
         return $e;
       }
+      warn "FS::cust_main::realtime_bop: void successful\n" if $DEBUG;
       return '';
     }
   }
 
+  warn "FS::cust_main::realtime_bop: void unsuccessful, trying refund\n"
+    if $DEBUG;
+
   #massage data
   my $address = $self->address1;
   $address .= ", ". $self->address2 if $self->address2;
@@ -2183,7 +2188,7 @@
 
   #then try refund
   my $refund = new Business::OnlinePayment( $processor, @bop_options );
-  $refund->content(
+  my %sub_content = $refund->content(
     'action'         => 'credit',
     'customer_id'    => $self->custnum,
     'last_name'      => $paylast,
@@ -2196,6 +2201,8 @@
     'country'        => $self->country,
     %content, #after
   );
+  warn join('', map { "  $_ => $sub_content{$_}\n" } keys %sub_content )
+    if $DEBUG > 1;
   $refund->submit();
 
   return "$processor error: ". $refund->error_message




More information about the freeside-commits mailing list