From 89cae7353a943921f30513529e748e1fbb7628f0 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sat, 15 Feb 2014 12:34:19 -0800 Subject: [PATCH] throw a fatal exception on non-decline problems, per B:OP notes_for_module_writers_v3 --- Changes | 4 ++++ lib/Business/OnlinePayment/PaymenTech.pm | 15 +++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Changes b/Changes index f7554a0..5d3821a 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,9 @@ Revision history for Business-OnlinePayment-PaymenTech +2.06 unreleased + - throw a fatal exception on non-decline problems, per B:OP + notes_for_module_writers_v3 + 2.05 Mon Jan 14 19:07:14 PST 2013 - pass AVScountryCode diff --git a/lib/Business/OnlinePayment/PaymenTech.pm b/lib/Business/OnlinePayment/PaymenTech.pm index 3d060bb..5363a8d 100644 --- a/lib/Business/OnlinePayment/PaymenTech.pm +++ b/lib/Business/OnlinePayment/PaymenTech.pm @@ -9,7 +9,7 @@ use vars qw($VERSION $DEBUG @ISA $me); @ISA = qw(Business::OnlinePayment::HTTPS); -$VERSION = '2.05'; +$VERSION = '2.06_01'; $VERSION = eval $VERSION; # modperlstyle: convert the string into a number $DEBUG = 0; @@ -282,21 +282,20 @@ sub submit { if ($server_response !~ /^200/) { - $self->is_success(0); + #$self->is_success(0); my $error = "Server error: '$server_response'"; $error .= " / Transaction error: '". ($r->{'ProcStatusMsg'} || $r->{'StatusMsg'}) . "'" if $r->{'ProcStatus'} != 0; - $self->error_message($error); + #$self->error_message($error); + #overzealous? are there "normal decline" transaction errors being returned? + die "$error\n"; } else { - if ( !exists($r->{'ProcStatus'}) ) { + die "Unable to parse response_page\n" if !exists($r->{'ProcStatus'}); - $self->is_success(0); - $self->error_message( "Malformed response: '$page'" ); - - } elsif ( $r->{'ProcStatus'} != 0 or + if ( $r->{'ProcStatus'} != 0 or # NewOrders get ApprovalStatus, Reversals don't. ( exists($r->{'ApprovalStatus'}) ? $r->{'ApprovalStatus'} != 1 : -- 2.11.0