initial import
[Business-OnlinePayment-PPIPayMover.git] / t / void.t
1 BEGIN { $| = 1; print "1..2\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 $tx = new Business::OnlinePayment("PPIPayMover");
11
12 $tx->content(
13     type           => 'VISA',
14     'login'        => '195325FCC230184964CAB3A8D93EEB31888C42C714E39CBBB2E541884485D04B', #token
15     action         => 'Normal Authorization',
16     description    => 'Business::OnlinePayment void test',
17     amount         => '0.01',
18     card_number    => '4445999922225',
19     expiration     => '03/10',
20     cvv2           => '999',
21     name           => 'Tofu Beast',
22     address        => '8320',
23     city           => 'Anywhere',
24     state          => 'UT',
25     zip            => '85284',
26     phone          => '415-420-5454',
27     email          => 'ivan-ppipaymover-test@420.am',
28     customer_id    => '5454',
29 );
30 $tx->test_transaction(1); # test, dont really charge
31 $tx->submit();
32
33 if($tx->is_success()) {
34     print "ok 1\n";
35 } else {
36     #warn $tx->server_response."\n";
37     warn $tx->error_message. "\n";
38     print "not ok 1\n";
39 }
40
41 my $v_tx = new Business::OnlinePayment("PPIPayMover");
42
43 $v_tx->content(
44     type           => 'VISA',
45     'login'        => '195325FCC230184964CAB3A8D93EEB31888C42C714E39CBBB2E541884485D04B', #token
46     action         => 'Void',
47     description    => 'Business::OnlinePayment::PPIPayMover test',
48     customer_id    => '5454',
49     order_number   => $tx->order_number(),
50 );
51
52 $v_tx->test_transaction(1); # test, dont really charge
53 $v_tx->submit();
54
55 if($v_tx->is_success()) {
56     print "ok 2\n";
57 } else {
58     #warn $v_tx->server_response."\n";
59     warn $v_tx->error_message. "\n";
60     print "not ok 2\n";
61 }
62
63
64
65