diff options
Diffstat (limited to 't')
-rw-r--r-- | t/bad_card.t | 5 | ||||
-rw-r--r-- | t/bad_check.t | 39 | ||||
-rw-r--r-- | t/check.t | 15 | ||||
-rw-r--r-- | t/credit_card.t | 5 | ||||
-rw-r--r-- | t/crypt_bad_card.t | 5 | ||||
-rw-r--r-- | t/crypt_bad_check.t | 43 | ||||
-rw-r--r-- | t/crypt_check.t | 43 | ||||
-rw-r--r-- | t/crypt_credit_card.t | 5 |
8 files changed, 144 insertions, 16 deletions
diff --git a/t/bad_card.t b/t/bad_card.t index 3d0913c..760242b 100644 --- a/t/bad_card.t +++ b/t/bad_card.t @@ -10,9 +10,8 @@ use Business::OnlinePayment; my $tx = new Business::OnlinePayment("OpenECHO"); $tx->content( type => 'VISA', - #login => '123>4684752', - login => '1234684752', - password => '54321420', + 'login' => '123>4685706', + 'password' => '09437869', action => 'Normal Authorization', description => 'Business::OnlinePayment visa test', amount => '49.95', diff --git a/t/bad_check.t b/t/bad_check.t new file mode 100644 index 0000000..6b44591 --- /dev/null +++ b/t/bad_check.t @@ -0,0 +1,39 @@ +BEGIN { $| = 1; print "1..1\n"; } + +eval "use Net::SSLeay;"; +if ( $@ ) { + print "ok 1 # Skipped: Net::SSLeay is not installed\n"; exit; +} + +use Business::OnlinePayment; + +# checks are broken it seems +my $ctx = new Business::OnlinePayment("OpenECHO"); +$ctx->content( + type => 'CHECK', + 'login' => '123>4685706', + 'password' => '09437869', + action => 'Normal Authorization', + amount => '49.95', + invoice_number => '100100', + customer_id => 'jsk', + first_name => 'Tofu', + last_name => 'Beast', + account_number => '12345', + routing_code => '026009593', + bank_name => 'First National Test Bank', + phone => '420-420-5454', + payee => 'Tofu Heavy Enterprises, GmbH', + check_number => '420', +); +$ctx->test_transaction(1); # test, dont really charge +$ctx->submit(); + +print $ctx->is_success()."\n"; + +if($ctx->is_success()) { + #warn $ctx->error_message(); + print "not ok 1 (".$ctx->error_message().")\n"; +} else { + print "ok 1\n"; +} @@ -1,6 +1,9 @@ BEGIN { $| = 1; print "1..1\n"; } -print "ok 1 # Skipped: no ACH test yet\n"; exit; +eval "use Net::SSLeay;"; +if ( $@ ) { + print "ok 1 # Skipped: Net::SSLeay is not installed\n"; exit; +} use Business::OnlinePayment; @@ -8,8 +11,8 @@ use Business::OnlinePayment; my $ctx = new Business::OnlinePayment("OpenECHO"); $ctx->content( type => 'CHECK', - login => 'testing', - password => 'testing', + 'login' => '123>4685706', + 'password' => '09437869', action => 'Normal Authorization', amount => '49.95', invoice_number => '100100', @@ -17,8 +20,11 @@ $ctx->content( first_name => 'Tofu', last_name => 'Beast', account_number => '12345', - routing_code => '123456789', + routing_code => '026009593', bank_name => 'First National Test Bank', + phone => '420-420-5454', + payee => 'Tofu Heavy Enterprises, GmbH', + check_number => '420', ); $ctx->test_transaction(1); # test, dont really charge $ctx->submit(); @@ -28,5 +34,6 @@ print $ctx->is_success()."\n"; if($ctx->is_success()) { print "ok 1\n"; } else { + warn $ctx->error_message(); print "not ok 1 (".$ctx->error_message().")\n"; } diff --git a/t/credit_card.t b/t/credit_card.t index 3878374..62b6c8d 100644 --- a/t/credit_card.t +++ b/t/credit_card.t @@ -10,9 +10,8 @@ use Business::OnlinePayment; my $tx = new Business::OnlinePayment("OpenECHO"); $tx->content( type => 'VISA', - #login => '123>4684752', - login => '1234684752', - password => '54321420', + 'login' => '123>4685706', + 'password' => '09437869', action => 'Normal Authorization', description => 'Business::OnlinePayment visa test', amount => '49.95', diff --git a/t/crypt_bad_card.t b/t/crypt_bad_card.t index 9e10fc2..572b187 100644 --- a/t/crypt_bad_card.t +++ b/t/crypt_bad_card.t @@ -14,9 +14,8 @@ use Business::OnlinePayment; my $tx = new Business::OnlinePayment("OpenECHO"); $tx->content( type => 'VISA', - #login => '123>4684752', - login => '1234684752', - password => '54321420', + 'login' => '123>4685706', + 'password' => '09437869', action => 'Normal Authorization', description => 'Business::OnlinePayment visa test', amount => '49.95', diff --git a/t/crypt_bad_check.t b/t/crypt_bad_check.t new file mode 100644 index 0000000..4903b48 --- /dev/null +++ b/t/crypt_bad_check.t @@ -0,0 +1,43 @@ +BEGIN { + $| = 1; print "1..1\n"; + $Business::OnlinePayment::HTTPS::skip_NetSSLeay=1; + $Business::OnlinePayment::HTTPS::skip_NetSSLeay=1; +} + +eval "use Crypt::SSLeay;"; +if ( $@ ) { + print "ok 1 # Skipped: Crypt::SSLeay is not installed\n"; exit; +} + +use Business::OnlinePayment; + +# checks are broken it seems +my $ctx = new Business::OnlinePayment("OpenECHO"); +$ctx->content( + type => 'CHECK', + 'login' => '123>4685706', + 'password' => '09437869', + action => 'Normal Authorization', + amount => '49.95', + invoice_number => '100100', + customer_id => 'jsk', + first_name => 'Tofu', + last_name => 'Beast', + account_number => '12345', + routing_code => '026009593', + bank_name => 'First National Test Bank', + phone => '420-420-5454', + payee => 'Tofu Heavy Enterprises, GmbH', + check_number => '420', +); +$ctx->test_transaction(1); # test, dont really charge +$ctx->submit(); + +print $ctx->is_success()."\n"; + +if($ctx->is_success()) { + #warn $ctx->error_message(); + print "not ok 1 (".$ctx->error_message().")\n"; +} else { + print "ok 1\n"; +} diff --git a/t/crypt_check.t b/t/crypt_check.t new file mode 100644 index 0000000..7d01a85 --- /dev/null +++ b/t/crypt_check.t @@ -0,0 +1,43 @@ +BEGIN { + $| = 1; print "1..1\n"; + $Business::OnlinePayment::HTTPS::skip_NetSSLeay=1; + $Business::OnlinePayment::HTTPS::skip_NetSSLeay=1; +} + +eval "use Crypt::SSLeay;"; +if ( $@ ) { + print "ok 1 # Skipped: Crypt::SSLeay is not installed\n"; exit; +} + +use Business::OnlinePayment; + +# checks are broken it seems +my $ctx = new Business::OnlinePayment("OpenECHO"); +$ctx->content( + type => 'CHECK', + 'login' => '123>4685706', + 'password' => '09437869', + action => 'Normal Authorization', + amount => '49.95', + invoice_number => '100100', + customer_id => 'jsk', + first_name => 'Tofu', + last_name => 'Beast', + account_number => '12345', + routing_code => '026009593', + bank_name => 'First National Test Bank', + phone => '420-420-5454', + payee => 'Tofu Heavy Enterprises, GmbH', + check_number => '420', +); +$ctx->test_transaction(1); # test, dont really charge +$ctx->submit(); + +print $ctx->is_success()."\n"; + +if($ctx->is_success()) { + print "ok 1\n"; +} else { + warn $ctx->error_message(); + print "not ok 1 (".$ctx->error_message().")\n"; +} diff --git a/t/crypt_credit_card.t b/t/crypt_credit_card.t index 8f5c252..6b7c01a 100644 --- a/t/crypt_credit_card.t +++ b/t/crypt_credit_card.t @@ -14,9 +14,8 @@ use Business::OnlinePayment; my $tx = new Business::OnlinePayment("OpenECHO"); $tx->content( type => 'VISA', - #login => '123>4684752', - login => '1234684752', - password => '54321420', + 'login' => '123>4685706', + 'password' => '09437869', action => 'Normal Authorization', description => 'Business::OnlinePayment visa test', amount => '49.95', |