Initial import
[Business-OnlinePayment-Vanco.git] / t / check.t
1 #!/usr/bin/perl -w
2
3 use Test::More;
4 require "t/lib/test_account.pl";
5
6 my($login, $password, %opt) = test_account_or_skip();
7 plan tests => 2;
8
9 use_ok 'Business::OnlinePayment';
10
11 my $ctx = Business::OnlinePayment->new("Vanco", %opt);
12 $ctx->content(
13     type           => 'CHECK',
14     login          => $login,
15     password       => $password,
16     action         => 'Normal Authorization',
17     amount         => '49.95',
18     customer_id    => 'jsk',
19     name           => 'Tofu Beast',
20     account_number => '12345',
21     routing_code   => '111000025',  # BoA in Texas taken from Wikipedia
22     bank_name      => 'First National Test Bank',
23     account_type   => 'Checking',
24 );
25 $ctx->test_transaction(1); # test, dont really charge
26 $ctx->submit();
27 ok( $ctx->is_success() ) || diag $ctx->error_message;