test fixes
authorivan <ivan>
Sun, 6 Mar 2011 22:07:35 +0000 (22:07 +0000)
committerivan <ivan>
Sun, 6 Mar 2011 22:07:35 +0000 (22:07 +0000)
Changes [new file with mode: 0644]
USAePay.pm
t/USAePay.t
t/lib/test_account.pl [new file with mode: 0644]

diff --git a/Changes b/Changes
new file mode 100644 (file)
index 0000000..a6c9a31
--- /dev/null
+++ b/Changes
@@ -0,0 +1,8 @@
+Revision history for Perl extension Business::OnlinePayment::USAePay.
+
+0.02    unreleased
+        - test fixes
+
+0.01    unreleased
+        - Initial version 
+
index a1ac81a..fd49797 100644 (file)
@@ -15,7 +15,7 @@ $DEBUG = 0;
 
 sub _info {
   {
-    'info_compat'           => '0.01',
+    'info_compat'           => '0.02',
     'gateway_name'          => 'USAePay',
     'gateway_url'           => 'http://www.usaepay.com',
     'module_version'        => $VERSION,
@@ -79,9 +79,12 @@ sub map_fields {
   }
   $content{'action'} = $actions{lc($content{'action'})} || $content{'action'};
                  
-  $content{'expiration'} =~ s/\D//g;
+  $content{'expiration'} =~ s/\D//g if exists $content{'expiration'};
 
-  $content{'md5hash'} = md5_hex(join(':', map "$content{$_}", qw(action password amount invoice_number md5key))) if defined $content{'password'};
+  $content{'md5hash'} =
+      md5_hex( join(':', map { defined($content{$_}) ? $content{$_} : '' }
+                             qw(action password amount invoice_number md5key)))
+    if defined $content{'password'};
 
   $self->content(%content);
 }
@@ -151,12 +154,15 @@ sub submit {
       UMdlstate UMclerk UMterminal UMtable UMip UMsoftware UMredir
       UMredirApproved UMredirDeclined UMechofields UMtestmode
     ) );
+
     # test_transaction(0): normal mode
     #                  1 : test mode (validates formatting only)
     #                  2 : use sandbox server
     #                  3 : test mode on sandbox server
-    $self->server('sandbox.usaepay.com') if ( $self->test_transaction & 2 );
-    $post_data{'UMtestmode'} = ($self->test_transaction() & 1) ? 1 : 0;
+    my $test = $self->test_transaction || 0;
+    $self->server('sandbox.usaepay.com') if ( $test & 2 );
+    $post_data{'UMtestmode'} = ($test & 1) ? 1 : 0;
+
     $post_data{'UMsoftware'} = __PACKAGE__. " $VERSION";
     if ( $DEBUG ) {
       warn "post_data:$_ => $post_data{$_}\n" foreach keys %post_data;
@@ -241,7 +247,9 @@ http://www.usaepay.com/topics/api.html for details.
 
 =head1 AUTHOR
 
-Jeff Finucane <jeff@cmh.net>
+Original author: Jeff Finucane <jeff@cmh.net>
+
+0.02 update and current maintainer: Ivan Kohler <ivan-usaepay@freeside.biz>
 
 =head1 SEE ALSO
 
index 7ce6947..73f2f4d 100644 (file)
@@ -2,23 +2,28 @@
 # `make test'. After `make install' it should work as `perl eWay.t'
 
 use Test;
-BEGIN { plan tests => 391, todo => [379,380,382] };
+require "t/lib/test_account.pl";
+
+BEGIN { plan tests => 391, todo => [361,376,382,383,388,389] };
 use Business::OnlinePayment::USAePay;
 
+my %auth = test_account();
+
 # a test transaction
 my ($tx, $txnum, $res);
 ok($tx = new Business::OnlinePayment("USAePay"));
+$tx->test_transaction(2);
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4005562233445564',
-        expiration     => '11/08',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
     )
@@ -48,14 +53,14 @@ ok(($tx->server_response->{UMauthCode} - $txnum) > 0);
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4005562233445564',
-        expiration     => '11/08',
+        expiration     => expiration_date(),
        cvv2           => '123',
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
@@ -65,13 +70,13 @@ ok($tx->submit());
 ok($tx->is_success());
 ok($tx->error_message(), 'Approved');
 ok($tx->authorization(), '/\d{6}/');
-ok($tx->server_response->{UMcvv2Result}, "Not Processed");
+ok($tx->server_response->{UMcvv2Result}, "No Match"); #"Not Processed");
 
 # a failing transaction
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
@@ -83,11 +88,14 @@ ok(
         address        => '1234 Bean Curd Lane, Sydney',
         zip            => '2034',
         card_number    => '4646464646464646',
-        expiration     => '11/08',
+        expiration     => expiration_date(),
        cvv2           => '123',
     )
 );
-ok($tx->test_transaction(0),0);
+
+#ok($tx->test_transaction(0),0);
+ok($tx->test_transaction(2),2);
+
 ok($tx->submit());
 ok($tx->is_success(),0);
 ok($tx->error_message(), 'Invalid Card Number (3)');
@@ -99,14 +107,14 @@ ok($tx->server_response->{UMcvv2Result}, "No CVV2/CVC data available for transac
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000100011112224',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -129,14 +137,14 @@ ok($tx->server_response->{UMbatch}, qr/^\d+/);
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000100111112223',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -161,14 +169,14 @@ ok($tx->server_response->{UMcvv2ResultCode}, "M");
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000100211112222',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -193,14 +201,14 @@ ok($tx->server_response->{UMcvv2ResultCode}, "M");
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000100311112221',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -225,14 +233,14 @@ ok($tx->server_response->{UMcvv2ResultCode}, "M");
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000100411112220',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -257,14 +265,14 @@ ok($tx->server_response->{UMcvv2ResultCode}, "M");
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000100511112229',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -289,14 +297,14 @@ ok($tx->server_response->{UMcvv2ResultCode}, "M");
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000100611112228',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -321,14 +329,14 @@ ok($tx->server_response->{UMcvv2ResultCode}, "M");
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000100711112227',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -353,14 +361,14 @@ ok($tx->server_response->{UMcvv2ResultCode}, "M");
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000100811112226',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -385,14 +393,14 @@ ok($tx->server_response->{UMcvv2ResultCode}, "M");
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000100911112225',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -406,7 +414,7 @@ ok($tx->server_response->{UMavsResultCode}, "XXS");
 ok($tx->server_response->{UMresult}, "A");
 ok($tx->server_response->{UMcvv2Result}, "Match");
 ok($tx->server_response->{UMversion}, "2.9");
-ok($tx->server_response->{UMavsResult}, "Service Not Support");
+ok($tx->server_response->{UMavsResult}, "Service Not Supported");
 ok($tx->server_response->{UMrefNum}, qr/^\d+/);
 ok($tx->server_response->{UMerrorcode}, "00000");
 ok($tx->server_response->{UMbatch}, qr/^\d+/);
@@ -417,14 +425,14 @@ ok($tx->server_response->{UMcvv2ResultCode}, "M");
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000101011112222',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -449,14 +457,14 @@ ok($tx->server_response->{UMcvv2ResultCode}, "M");
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000101111112221',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -481,14 +489,14 @@ ok($tx->server_response->{UMcvv2ResultCode}, "M");
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000101211112220',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -502,7 +510,7 @@ ok($tx->server_response->{UMavsResultCode}, "YYG");
 ok($tx->server_response->{UMresult}, "A");
 ok($tx->server_response->{UMcvv2Result}, "Match");
 ok($tx->server_response->{UMversion}, "2.9");
-ok($tx->server_response->{UMavsResult}, "International Address: Match & Zip: Not Compatible");
+ok($tx->server_response->{UMavsResult}, "International Address: Match & Postal: Not Compatible");
 ok($tx->server_response->{UMrefNum}, qr/^\d+/);
 ok($tx->server_response->{UMerrorcode}, "00000");
 ok($tx->server_response->{UMbatch}, qr/^\d+/);
@@ -513,14 +521,14 @@ ok($tx->server_response->{UMcvv2ResultCode}, "M");
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000101311112229',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -534,7 +542,7 @@ ok($tx->server_response->{UMavsResultCode}, "GGG");
 ok($tx->server_response->{UMresult}, "A");
 ok($tx->server_response->{UMcvv2Result}, "Match");
 ok($tx->server_response->{UMversion}, "2.9");
-ok($tx->server_response->{UMavsResult}, "International Address: Match & Zip: Match");
+ok($tx->server_response->{UMavsResult}, "International Address: Match & Postal: Match");
 ok($tx->server_response->{UMrefNum}, qr/^\d+/);
 ok($tx->server_response->{UMerrorcode}, "00000");
 ok($tx->server_response->{UMbatch}, qr/^\d+/);
@@ -545,14 +553,14 @@ ok($tx->server_response->{UMcvv2ResultCode}, "M");
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000101411112228',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -566,7 +574,7 @@ ok($tx->server_response->{UMavsResultCode}, "YGG");
 ok($tx->server_response->{UMresult}, "A");
 ok($tx->server_response->{UMcvv2Result}, "Match");
 ok($tx->server_response->{UMversion}, "2.9");
-ok($tx->server_response->{UMavsResult}, "International Address: No Compatible & Zip: Match");
+ok($tx->server_response->{UMavsResult}, "International Address: No Compatible & Postal: Match");
 ok($tx->server_response->{UMrefNum}, qr/^\d+/);
 ok($tx->server_response->{UMerrorcode}, "00000");
 ok($tx->server_response->{UMbatch}, qr/^\d+/);
@@ -577,14 +585,14 @@ ok($tx->server_response->{UMcvv2ResultCode}, "M");
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000200011112222',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -609,14 +617,14 @@ ok($tx->server_response->{UMcvv2ResultCode}, "M");
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000200111112221',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -641,14 +649,14 @@ ok($tx->server_response->{UMcvv2ResultCode}, "N");
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000200211112220',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -673,14 +681,14 @@ ok($tx->server_response->{UMcvv2ResultCode}, "P");
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000200311112229',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -688,7 +696,7 @@ ok(
 );
 ok($tx->submit());
 ok($tx->is_success(),0);
-ok($tx->error_message(), 'Card Declined');
+ok($tx->error_message(), 'Card Declined (00)');
 ok($tx->authorization(), '/\d{6}/');
 ok($tx->server_response->{UMavsResultCode}, "YYY");
 ok($tx->server_response->{UMresult}, "D");
@@ -705,14 +713,14 @@ ok($tx->server_response->{UMcvv2ResultCode}, "S");
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000200411112228',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -737,14 +745,14 @@ ok($tx->server_response->{UMcvv2ResultCode}, "U");
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000200511112227',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -769,14 +777,14 @@ ok($tx->server_response->{UMcvv2ResultCode}, "X");
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000300011112220',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -784,11 +792,11 @@ ok(
 );
 ok($tx->submit());
 ok($tx->is_success(),0);
-ok($tx->error_message(), 'Card Declined');
+ok($tx->error_message(), 'Card Declined (00)');
 ok($tx->authorization(), '/\d{6}/');
 ok($tx->server_response->{UMavsResultCode}, "YYY");
 ok($tx->server_response->{UMresult}, "D");
-ok($tx->server_response->{UMcvv2Result}, "Not Processed");
+ok($tx->server_response->{UMcvv2Result}, "No Match"); #"Not Processed");
 ok($tx->server_response->{UMversion}, "2.9");
 ok($tx->server_response->{UMavsResult}, "Address: Match & 5 Digit Zip: Match");
 ok($tx->server_response->{UMrefNum}, qr/^\d+/);
@@ -801,14 +809,14 @@ ok($tx->server_response->{UMcvv2ResultCode}, "P");
 ok(
     $tx->content(
         type           => 'CC',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
         invoice_number => '100100',
         name           => 'Tofu Beast',
         card_number    => '4000300111112229',
-        expiration     => '09/09',
+        expiration     => expiration_date(),
         address        => '1234 Bean Curd Lane, San Francisco',
         zip            => '94102',
         cvv2           => '102',
@@ -820,7 +828,7 @@ ok($tx->error_message(), 'Transaction Requires Voice Authentication. Please Call
 ok($tx->authorization(), '/\d{6}/');
 ok($tx->server_response->{UMavsResultCode}, "YYY");
 ok($tx->server_response->{UMresult}, "E");
-ok($tx->server_response->{UMcvv2Result}, "Not Processed");
+ok($tx->server_response->{UMcvv2Result}, "No Match"); #"Not Processed");
 ok($tx->server_response->{UMversion}, "2.9");
 ok($tx->server_response->{UMavsResult}, "Address: Match & 5 Digit Zip: Match");
 ok($tx->server_response->{UMrefNum}, qr/^\d+/);
@@ -833,7 +841,7 @@ ok($tx->server_response->{UMcvv2ResultCode}, "P");
 ok(
     $tx->content(
         type           => 'ECHECK',
-        login          => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+        %auth,
         action         => 'Normal Authorization',
         description    => 'Business::OnlinePayment test',
         amount         => '49.95',
@@ -847,13 +855,13 @@ ok(
 );
 ok($tx->submit());
 ok($tx->is_success());
-ok($tx->error_message(), 'Approved');
-ok($tx->authorization(), '/^\d{6}/');
+ok($tx->error_message(), ''); #'Approved');
+ok($tx->authorization(), '/^\w{6}/'); #\d{6}/');
 ok($tx->server_response->{UMavsResultCode}, "YYY");
 ok($tx->server_response->{UMresult}, "E");
 ok($tx->server_response->{UMcvv2Result}, "No CVV2/CVC data available for transaction.");
 ok($tx->server_response->{UMversion}, "2.9");
-ok($tx->server_response->{UMavsResult}, "n/a");
+ok($tx->server_response->{UMavsResult}, "No AVS response (Typically no AVS data sent or swiped transaction)"); #"n/a");
 ok($tx->server_response->{UMrefNum}, qr/^\d+/);
 ok($tx->server_response->{UMerrorcode}, "00011");
 ok($tx->server_response->{UMbatch}, qr/^\d+/);
diff --git a/t/lib/test_account.pl b/t/lib/test_account.pl
new file mode 100644 (file)
index 0000000..39dd4f6
--- /dev/null
@@ -0,0 +1,16 @@
+sub test_account {
+#  'login' => 'yCaWGYQsSVR0S48B6AKMK07RQhaxHvGu', #test platform
+  'login' => 'tSfl065j5F1Z5Uw7jQ2i69z9sd30A6k1',
+  'password' => '5432',
+}
+
+sub expiration_date {
+    my($month, $year) = (localtime)[4,5];
+    $month += 1;
+    $year++;       # So we expire next year.
+    $year %= 100;  # y2k?  What's that?
+
+    return sprintf("%02d/%02d", $month, $year);
+}
+
+1;