Fix voids even if an amount is passed (now ignored)
[Business-OnlinePayment-eSelectPlus.git] / t / void_ca.t
1 BEGIN { $| = 1; print "1..2\n"; }
2
3 #print "ok 1 # Skipped: Voids not working with test account\n";
4 #print "ok 2 # Skipped: Voids not working with test account\n";
5 #exit;
6
7 eval "use Net::SSLeay;";
8 if ( $@ ) {
9   print "ok 1 # Skipped: Net::SSLeay is not installed\n";
10   print "ok 2 # Skipped: Net::SSLeay is not installed\n";
11   exit;
12 }
13
14 use Business::OnlinePayment;
15
16 my $tx = new Business::OnlinePayment("eSelectPlus", 'currency' => 'CAD' );
17
18 $tx->content(
19     type           => 'VISA',
20     login          => 'moot',
21     password       => 'moot',
22     action         => 'Normal Authorization',
23     amount         => '0.80',
24     currency       => 'CAD',
25     card_number    => '4242424242424242',
26     expiration     => '01/12',
27 );
28 $tx->test_transaction(1); # test, dont really charge
29 $tx->submit();
30
31 if($tx->is_success()) {
32     #warn "authorization:". $tx->authorization."\n";
33     #warn "order_number: ". $tx->order_number."\n";
34
35     print "ok 1\n";
36 } else {
37     warn $tx->server_response."\n";
38     warn $tx->error_message. "\n";
39     print "not ok 1\n";
40 }
41
42 #--
43
44 my $void = new Business::OnlinePayment("eSelectPlus", 'currency' => 'CAD' );
45
46 $void->content(
47     type           => 'VISA',
48     login          => 'moot',
49     password       => 'moot',
50     action         => 'Void',
51     currency       => 'CAD',
52     authorization  => $tx->authorization,
53     order_number   => $tx->order_number,
54     amount         => '0.80', #not used, but shouldn't error out
55 );
56
57 #$VAR11 = 'amount';
58 #$VAR12 = '1.00';
59 #$VAR15 = 'type';
60 #$VAR16 = 'CC';
61 #$VAR17 = 'referer';
62 #$VAR18 = 'http://cleanwhisker.420.am/'; 
63
64 $void->test_transaction(1); # test, dont really charge
65 $void->submit();
66
67 if($void->is_success()) {
68     print "ok 2\n";
69 } else {
70     warn $void->server_response."\n";
71     warn $void->error_message. "\n";
72     print "not ok 2\n";
73 }
74