diff options
author | C.J. Adams-Collier <cjac@colliertech.org> | 2014-09-23 12:03:37 -0700 |
---|---|---|
committer | C.J. Adams-Collier <cjac@colliertech.org> | 2014-09-23 12:03:37 -0700 |
commit | 18cd553dba851f6b2bdc4a3bf4316ff563c900cc (patch) | |
tree | 17baf9bc3006c3ed7aeefd67362e51f489620f81 | |
parent | 9507ff8c668fcfe73f56a871a10002583a8b7369 (diff) |
reduced price of test transaction to minimum, exercising new test_transaction method, printing error_message on failure
-rw-r--r-- | t/Business-OnlinePayment-Exact.t | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/t/Business-OnlinePayment-Exact.t b/t/Business-OnlinePayment-Exact.t index 0754ac3..f51520a 100644 --- a/t/Business-OnlinePayment-Exact.t +++ b/t/Business-OnlinePayment-Exact.t @@ -5,7 +5,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; -use Test::More tests => 8; +use Test::More; use Term::ReadLine; BEGIN { use_ok('Business::OnlinePayment::Exact') }; @@ -34,7 +34,7 @@ my $name = $term->readline($prompt); my $tx; ok($tx = new Business::OnlinePayment('Exact'), 'New Exact'); ok($tx->content( - amount => '9.95', + amount => '0.01', card_number => $card, expiration => $expiry, name => $name, @@ -45,8 +45,17 @@ ok($tx->content( ), 'Add Some Content'); +my $return = eval { $tx->test_transaction(1) }; + +my $error = $@; + +ok($error, 'enable test mode dies'); + ok($tx->submit(), 'submit'); -ok($tx->is_success(), 'Success!!!'); + +ok($tx->is_success(), 'Success!!!') + or diag "Card was rejected: ", $tx->error_message(); + my $auth; ok($auth = $tx->authorization(), "authorization $auth"); my $err; @@ -55,3 +64,4 @@ my $on; ok($on = $tx->order_number(), "order number $on"); +done_testing(); |