9b7ea0af33019d0881fcbf9d0aad0b0ba113a765
[Business-OnlinePayment-OpenECHO.git] / t / check.t
1 BEGIN { $| = 1; print "1..1\n"; }
2
3 eval "use Net::SSLeay;";
4 if ( $@ ) {
5   print "ok 1 # Skipped: Net::SSLeay is not installed\n"; exit;
6 }
7
8 use Business::OnlinePayment;
9
10 my $ctx = new Business::OnlinePayment( "OpenECHO", 
11   'payee' => 'Tofu Heavy Enterprises, GmbH',
12 );
13
14 #$Business::OnlinePayment::HTTPS::DEBUG = 1;
15 #$Business::OnlinePayment::HTTPS::DEBUG = 1;
16 #$Business::OnlinePayment::OpenECHO::DEBUG = 1;
17 #$Business::OnlinePayment::OpenECHO::DEBUG = 1;
18
19 # checks are broken it seems?
20 $ctx->content(
21     type           => 'ECHECK',
22     'login'        => '123>4685706',
23     'password'     => '09437869',
24     action         => 'Normal Authorization',
25     amount         => '49.95',
26     invoice_number => '100100',
27     customer_id    => 'jsk',
28     first_name     => 'Tofu',
29     last_name      => 'Beast',
30     account_number => '12345',
31     routing_code   => '026009593',
32     bank_name      => 'First National Test Bank',
33     phone          => '420-420-5454',
34     #payee          => 'Tofu Heavy Enterprises, GmbH',
35     check_number   => '420',
36 );
37 $ctx->test_transaction(1); # test, dont really charge
38 $ctx->submit();
39
40 print $ctx->is_success()."\n";
41
42 if($ctx->is_success()) {
43     print "ok 1\n";
44 } else {
45     warn $ctx->error_message();
46     print "not ok 1 (".$ctx->error_message().")\n";
47 }