[freeside-commits] freeside/FS/FS cust_main.pm,1.271.2.4,1.271.2.5

Ivan,,, ivan at wavetail.420.am
Wed Mar 21 15:09:35 PDT 2007


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/tmp/cvs-serv32502

Modified Files:
      Tag: FREESIDE_1_7_BRANCH
	cust_main.pm 
Log Message:
realtime_bop: if a transaction fails without an error_message, output additional debugging information, if available

Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.271.2.4
retrieving revision 1.271.2.5
diff -u -d -r1.271.2.4 -r1.271.2.5
--- cust_main.pm	20 Mar 2007 22:33:36 -0000	1.271.2.4
+++ cust_main.pm	21 Mar 2007 22:09:32 -0000	1.271.2.5
@@ -21,6 +21,7 @@
 use String::Approx qw(amatch);
 use Business::CreditCard 0.28;
 use Locale::Country;
+use Data::Dumper;
 use FS::UID qw( getotaker dbh );
 use FS::Record qw( qsearchs qsearch dbdef );
 use FS::Misc qw( send_email );
@@ -2767,6 +2768,42 @@
 
     my $perror = "$processor error: ". $transaction->error_message;
 
+    unless ( $transaction->error_message ) {
+
+      my $t_response;
+      #this should be normalized :/
+      #
+      # bad, ad-hoc B:OP:PayflowPro "transaction_response" BS
+      if ( $transaction->can('param')
+           && $transaction->param('transaction_response') ) {
+        $t_response = $transaction->param('transaction_response')
+
+      # slightly better, ad-hoc B:OP:TransactionCentral without "param"
+      } elsif ( $transaction->can('response_page') ) {
+        $t_response = {
+                        'page'    => ( $transaction->can('response_page')
+                                         ? $transaction->response_page
+                                         : ''
+                                     ),
+                        'code'    => ( $transaction->can('response_code')
+                                         ? $transaction->response_code
+                                         : ''
+                                     ),
+                        'headers' => ( $transaction->can('response_headers')
+                                         ? $transaction->response_headers
+                                         : ''
+                                     ),
+                      };
+      } else {
+        $t_response .=
+          "No additional debugging information available for $processor";
+      }
+
+      $perror .= "No error_message returned from $processor -- ";
+                 ( ref($t_response) ? Dumper($t_response) : $t_response );
+
+    }
+
     if ( !$options{'quiet'} && !$realtime_bop_decline_quiet
          && $conf->exists('emaildecline')
          && grep { $_ ne 'POST' } $self->invoicing_list



More information about the freeside-commits mailing list