- Incorporate Business::OnlinePayment::AuthorizeNet::AIM::ErrorCodes by
[Business-OnlinePayment-AuthorizeNet.git] / t / errorcodes.t
1 #!/usr/bin/perl -w
2
3 use Test::More;
4 require "t/lib/test_account.pl";
5
6 my($login, $password) = test_account_or_skip();
7 plan tests => 3;
8   
9 use_ok 'Business::OnlinePayment';
10
11 my $tx = Business::OnlinePayment->new("AuthorizeNet");
12 $tx->server('test.authorize.net');
13 $tx->content(
14     type           => 'VISA',
15     login          => $login,
16     password       => $password,
17     action         => 'Normal Authorization',
18     description    => 'Business::OnlinePayment visa test',
19     amount         => '49.95',
20     invoice_number => '100100',
21     customer_id    => 'jsk',
22     first_name     => 'Tofu',
23     last_name      => 'Beast',
24     address        => '123 Anystreet',
25     city           => 'Anywhere',
26     state          => 'UT',
27     zip            => '84058',
28     card_number    => '4007000000027',
29     expiration     => 'BADFORMAT', #expiration_date(),
30 );
31 $tx->test_transaction(1); # test, dont really charge
32 $tx->submit();
33
34 ok(!$tx->is_success);
35
36 ok($tx->error_message() =~ /The format of the date submitted was incorrect/ );