diff options
author | ivan <ivan> | 2010-12-20 02:35:20 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-12-20 02:35:20 +0000 |
commit | 0aaa3a6a62a90d74f9fa23103e568888c905f7eb (patch) | |
tree | a16387690f4dc79b87da69bf0c675ba5038781a0 /t/errorcodes.t | |
parent | f82fc3906ef6014e0571f6cd25b0c995a239f454 (diff) |
- Incorporate Business::OnlinePayment::AuthorizeNet::AIM::ErrorCodes by
Thomas Sibley and, using it, provide more descriptive error messages.
- Switch to Business::OnlinePayment::HTTPS instead of using Net::SSLeay
directly
Diffstat (limited to 't/errorcodes.t')
-rw-r--r-- | t/errorcodes.t | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/t/errorcodes.t b/t/errorcodes.t new file mode 100644 index 0000000..130ae71 --- /dev/null +++ b/t/errorcodes.t @@ -0,0 +1,36 @@ +#!/usr/bin/perl -w + +use Test::More; +require "t/lib/test_account.pl"; + +my($login, $password) = test_account_or_skip(); +plan tests => 3; + +use_ok 'Business::OnlinePayment'; + +my $tx = Business::OnlinePayment->new("AuthorizeNet"); +$tx->server('test.authorize.net'); +$tx->content( + type => 'VISA', + login => $login, + password => $password, + action => 'Normal Authorization', + description => 'Business::OnlinePayment visa test', + amount => '49.95', + invoice_number => '100100', + customer_id => 'jsk', + first_name => 'Tofu', + last_name => 'Beast', + address => '123 Anystreet', + city => 'Anywhere', + state => 'UT', + zip => '84058', + card_number => '4007000000027', + expiration => 'BADFORMAT', #expiration_date(), +); +$tx->test_transaction(1); # test, dont really charge +$tx->submit(); + +ok(!$tx->is_success); + +ok($tx->error_message() =~ /The format of the date submitted was incorrect/ ); |