X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=t%2Ferrorcodes.t;fp=t%2Ferrorcodes.t;h=130ae716259d976bf6ae65eef88116f0ad7746a9;hb=0aaa3a6a62a90d74f9fa23103e568888c905f7eb;hp=0000000000000000000000000000000000000000;hpb=f82fc3906ef6014e0571f6cd25b0c995a239f454;p=Business-OnlinePayment-AuthorizeNet.git 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/ );