add new test files to MANIFEST
[Business-OnlinePayment-TransactionCentral.git] / t / check.t
1 BEGIN { $| = 1; print "1..1\n"; }
2
3 use Business::OnlinePayment;
4
5 require "t/lib/test_account.pl";
6 my($login, $regkey) = test_account_or_skip();
7
8 my $ctx = Business::OnlinePayment->new("TransactionCentral");
9
10 #$Business::OnlinePayment::TransactionCentral::DEBUG = 1;
11 #$Business::OnlinePayment::TransactionCentral::DEBUG = 1;
12
13 $ctx->content(
14     type           => 'CHECK',
15     login          => $login,
16     password       => $regkey,
17     action         => 'Normal Authorization',
18     amount         => '49.95',
19     invoice_number => '100100',
20     customer_id    => 'jsk',
21     name           => 'Tofu Beast',
22     account_number => '12345',
23     routing_code   => '111000025',  # BoA in Texas taken from Wikipedia
24     bank_name      => 'First National Test Bank',
25     account_type   => 'Checking',
26     license_num    => '12345678',
27     license_state  => 'OR',
28     license_dob    => '1975-05-21',
29 );
30 $ctx->test_transaction(1); # test, dont really charge
31 $ctx->submit();
32
33 if($ctx->is_success()) {
34     print "ok 1\n";
35 } else {
36     warn "error message : ". $ctx->error_message(). "\n";
37     warn "response code : ". $ctx->response_code(). "\n";
38     warn "response page : ". $ctx->response_page(). "\n";
39
40     print "not ok 1 (".$ctx->error_message().")\n";
41 }