summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2002-09-10 05:33:18 +0000
committerivan <ivan>2002-09-10 05:33:18 +0000
commitc10a15dabc2a36006e474f42355383c1231e571a (patch)
tree985d56b19065ffb74b4b6e8f424249f45afc90c0
parent652d62966e11853c8e19767fdf47089b3e48cfb6 (diff)
-quiet "$Business::OnlinePayment::VirtualNet::DEBUG used only once"
warnings in tests under old perls -fix elusive "Error in Batch in Detail Record #0003 field #19" bug: missing transactoin identifiers should default to zero-fill, not space fill
-rw-r--r--Changes7
-rw-r--r--VirtualNet.pm17
-rw-r--r--t/bad_auth.t1
-rw-r--r--t/credit_card.t1
-rw-r--r--t/credit_card2.t1
-rw-r--r--t/credit_card3.t1
6 files changed, 24 insertions, 4 deletions
diff --git a/Changes b/Changes
index 007c411..e4848bd 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,11 @@
Revision history for Perl extension Business::OnlinePayment::VirtualNet
+0.02 unreleased
+ -quiet "$Business::OnlinePayment::VirtualNet::DEBUG used only once"
+ warnings in tests under old perls
+ -fix elusive "Error in Batch in Detail Record #0003 field #19" bug:
+ missing transactoin identifiers should default to zero-fill, not
+ space fill
+
0.01 Fri Jul 19 08:25:26 PDT 2002
-original version; created by ivan 1.0
diff --git a/VirtualNet.pm b/VirtualNet.pm
index 016a525..3344f45 100644
--- a/VirtualNet.pm
+++ b/VirtualNet.pm
@@ -16,7 +16,7 @@ require Exporter;
@ISA = qw(Exporter AutoLoader Business::OnlinePayment);
@EXPORT = qw();
@EXPORT_OK = qw();
-$VERSION = '0.01';
+$VERSION = '0.02';
$DEBUG ||= 0;
@@ -339,12 +339,17 @@ sub eis1080_response {
my( $self, $response) = @_;
my %response;
- $response =~ /^$STX(.{67})([\w ]{0,15})$FS([\w ]{0,4})$FS.*$ETX(.)$/
+ #$response =~ /^$STX(.{67})([\w ]{0,15})$FS([\w ]{0,4})$FS.*$ETX(.)$/
+ $response =~ /^$STX(.{67})([\w ]{0,15})$FS([\w ]{0,4})$FS(\d{3})$ETX(.)$/
or die "can't decode (eis1080) response: $response\n". join(' ', map { sprintf("%x", unpack('C',$_)) } split('', $response) );
( $response{transaction_identifier},
$response{validation_code},
+ my $group3version,
my $lrc
- ) = ($2, $3, $4);
+ ) = ($2, $3, $4, $5);
+
+ die "group iii version $group3version ne 014"
+ unless $group3version eq '014';
warn "$response\n".
join(' ', map { sprintf("%x", unpack('C',$_)) } split('', $response) ).
@@ -548,7 +553,11 @@ sub eis1081_request {
$detail .= $param->{AVS_result_code};
# 62-76 15 A/N Transaction Identifier Left-Justified/Space-Filled 4.206
- $detail .= substr($param->{transaction_identifier}. (' 'x15), 0, 15);
+ my $transaction_identifier =
+ length($param->{transaction_identifier})
+ ? substr($param->{transaction_identifier}. (' 'x15), 0, 15)
+ : '000000000000000';
+ $detail .= $transaction_identifier;
# 77-80 4 A/N Validation Code 4.218
$detail .= substr($param->{validation_code}.' ', 0, 4);
diff --git a/t/bad_auth.t b/t/bad_auth.t
index 9dbde52..04e25a2 100644
--- a/t/bad_auth.t
+++ b/t/bad_auth.t
@@ -4,6 +4,7 @@ use Business::OnlinePayment;
$DEBUG = 0;
$Business::OnlinePayment::VirtualNet::DEBUG = $DEBUG;
+$Business::OnlinePayment::VirtualNet::DEBUG += 0; #quiet warnings with old perl
# Use this merchant information for testing only.
#
diff --git a/t/credit_card.t b/t/credit_card.t
index e766aab..ae7a1d0 100644
--- a/t/credit_card.t
+++ b/t/credit_card.t
@@ -4,6 +4,7 @@ use Business::OnlinePayment;
$DEBUG = 0;
$Business::OnlinePayment::VirtualNet::DEBUG = $DEBUG;
+$Business::OnlinePayment::VirtualNet::DEBUG += 0; #quiet warnings with old perl
# Use this merchant information for testing only.
#
diff --git a/t/credit_card2.t b/t/credit_card2.t
index 8e591e6..8de3ece 100644
--- a/t/credit_card2.t
+++ b/t/credit_card2.t
@@ -4,6 +4,7 @@ use Business::OnlinePayment;
$DEBUG = 0;
$Business::OnlinePayment::VirtualNet::DEBUG = $DEBUG;
+$Business::OnlinePayment::VirtualNet::DEBUG += 0; #quiet warnings with old perl
# Use this merchant information for testing only.
#
diff --git a/t/credit_card3.t b/t/credit_card3.t
index 2c351f4..92df9fd 100644
--- a/t/credit_card3.t
+++ b/t/credit_card3.t
@@ -4,6 +4,7 @@ use Business::OnlinePayment;
$DEBUG = 0;
$Business::OnlinePayment::VirtualNet::DEBUG = $DEBUG;
+$Business::OnlinePayment::VirtualNet::DEBUG += 0; #quiet warnings with old perl
# Use this merchant information for testing only.
#