cvv2_response should never be passed back as a hashref
authorIvan Kohler <ivan@freeside.biz>
Thu, 19 Feb 2015 21:38:45 +0000 (13:38 -0800)
committerIvan Kohler <ivan@freeside.biz>
Thu, 19 Feb 2015 21:38:45 +0000 (13:38 -0800)
Changes
lib/Business/OnlinePayment/vSecureProcessing.pm

diff --git a/Changes b/Changes
index 60b97e4..9f89ed7 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 Revision history for Perl module Business::OnlinePayment::vSecureProcessing
 
 Revision history for Perl module Business::OnlinePayment::vSecureProcessing
 
+0.05    Thu Feb 19 13:38:21 PST 2015
+        - cvv2_response should never be passed back as a hashref
+
 0.04    Mon Feb 16 06:20:51 PST 2015
         - Normalize return fields with non-standard names (avs_code and
           cvv2_response)
 0.04    Mon Feb 16 06:20:51 PST 2015
         - Normalize return fields with non-standard names (avs_code and
           cvv2_response)
index fddf9ec..0ae9adc 100644 (file)
@@ -11,7 +11,7 @@ use Business::OnlinePayment::HTTPS;
 
 @ISA = qw(Business::OnlinePayment::HTTPS);
 $DEBUG = 0;
 
 @ISA = qw(Business::OnlinePayment::HTTPS);
 $DEBUG = 0;
-$VERSION = '0.04';
+$VERSION = '0.05';
 
 # mapping out all possible endpoints
 # but this version will only be building out "charge", "void", & "credit"
 
 # mapping out all possible endpoints
 # but this version will only be building out "charge", "void", & "credit"
@@ -347,7 +347,13 @@ sub parse_response {
         $self->result_code($response->{Status}); # 0 /1
         $self->response_code($response->{ResponseCode}); # see documentation for translation
         $self->avs_code($response->{AvsResponse}); # Y / N
         $self->result_code($response->{Status}); # 0 /1
         $self->response_code($response->{ResponseCode}); # see documentation for translation
         $self->avs_code($response->{AvsResponse}); # Y / N
-        $self->cvv2_response($response->{CvvResponse}); # P / F
+
+        #weird (missing?) gateway responses turn into a hashref screwing up Card Fortress
+        $self->cvv2_response( $response->{CvvResponse} =~ /^\w$/
+                                ? $response->{CvvResponse}
+                                : ''
+                            );
+
         $self->txn_date($response->{TransactionDate}); # MMDDhhmmss
         $self->txn_amount($response->{TransactionAmount} / 100); # 00000003500 / 100
         $self->reference_number($response->{ReferenceNumber});
         $self->txn_date($response->{TransactionDate}); # MMDDhhmmss
         $self->txn_amount($response->{TransactionAmount} / 100); # 00000003500 / 100
         $self->reference_number($response->{ReferenceNumber});