From 0aaa3a6a62a90d74f9fa23103e568888c905f7eb Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 20 Dec 2010 02:35:20 +0000 Subject: - 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 --- t/card_arb.t | 2 +- t/errorcodes.t | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 t/errorcodes.t (limited to 't') diff --git a/t/card_arb.t b/t/card_arb.t index 99f0914..4ce6951 100644 --- a/t/card_arb.t +++ b/t/card_arb.t @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -use Test::More; +use Test::More skip_all => 'Authorize.net test account throwing errors about duplicates'; require "t/lib/test_account.pl"; my($login, $password) = test_account_or_skip('arb'); 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/ ); -- cgit v1.2.1