finally working
[Business-OnlinePayment-PaymentsGateway.git] / t / check.t
1 BEGIN { $| = 1; print "1..1\n"; }
2
3 use Business::OnlinePayment;
4
5 my $ctx = new Business::OnlinePayment("PaymentsGateway");
6 $ctx->content(
7     type           => 'CHECK',
8     login          => '2000',
9     password       => 'merchant4demo',
10     action         => 'Normal Authorization',
11     amount         => '49.95',
12     invoice_number => '100100',
13     customer_id    => 'jsk',
14     first_name     => 'Tofu',
15     last_name      => 'Beast',
16     account_number => '12345',
17     routing_code   => '321076441',
18     bank_name      => 'First National Test Bank',
19 );
20 $ctx->test_transaction(1); # test, dont really charge
21 $ctx->submit();
22
23 print $ctx->is_success()."\n";
24
25 if($ctx->is_success()) {
26     print "ok 1\n";
27 } else {
28     warn $ctx->result_code. ': '. $ctx->error_message();
29     print "not ok 1 (".$ctx->error_message().")\n";
30 }