summaryrefslogtreecommitdiff
path: root/t/errorcodes.t
diff options
context:
space:
mode:
authorivan <ivan>2010-12-20 02:35:20 +0000
committerivan <ivan>2010-12-20 02:35:20 +0000
commit0aaa3a6a62a90d74f9fa23103e568888c905f7eb (patch)
treea16387690f4dc79b87da69bf0c675ba5038781a0 /t/errorcodes.t
parentf82fc3906ef6014e0571f6cd25b0c995a239f454 (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.t36
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/ );