throw a fatal exception on non-decline problems, per B:OP
authorIvan Kohler <ivan@freeside.biz>
Sat, 15 Feb 2014 20:34:19 +0000 (12:34 -0800)
committerIvan Kohler <ivan@freeside.biz>
Sat, 15 Feb 2014 20:34:19 +0000 (12:34 -0800)
notes_for_module_writers_v3

Changes
lib/Business/OnlinePayment/PaymenTech.pm

diff --git a/Changes b/Changes
index f7554a0..5d3821a 100644 (file)
--- 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
 
index 3d060bb..5363a8d 100644 (file)
@@ -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 :