summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2007-03-21 22:09:07 +0000
committerivan <ivan>2007-03-21 22:09:07 +0000
commitfcba6b0d7945a63197096ffabebcdad2445544bb (patch)
tree16ff8bb8fbd8850fce69a327ab7e899ea56a24c7 /FS
parentfa81e2694906ade89f6b7260c621cd86f10cdba0 (diff)
realtime_bop: if a transaction fails without an error_message, output additional debugging information, if available
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cust_main.pm37
1 files changed, 37 insertions, 0 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index f6270e1d4..c60fc8345 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -21,6 +21,7 @@ use Date::Parse;
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 @@ sub realtime_bop {
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