34cf56aae586349cb1cb237453a7e05e1e63fe40
[Business-OnlinePayment-Skipjack.git] / t / void_card_mc.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("Skipjack");
11
12 #$Business::OnlinePayment::HTTPS::DEBUG = 1;
13 #$Business::OnlinePayment::HTTPS::DEBUG = 1;
14 #$Business::OnlinePayment::Skipjack::DEBUG = 1;
15 #$Business::OnlinePayment::Skipjack::DEBUG = 1;
16
17 my $login = $ENV{'sj_html_serial_number'} || '000944785470';
18 my $password = $ENV{'sj_devel_serial_number'} || '100594217288';
19
20 $tx->content(
21     type           => 'VISA',
22     login          => $login, # "HTML serial number"
23     password       => $password, # "Developer serial number"
24     action         => 'Normal Authorization',
25     description    => 'Business::OnlinePayment::Skipjack test',
26     amount         => '32',
27     card_number    => '5121212121212124',
28     expiration     => '03/10',
29     #cvv2           => '123',
30     name           => 'Tofu Beast',
31     address        => '8320',
32     city           => 'Anywhere',
33     state          => 'UT',
34     zip            => '85284',
35     phone          => '415-420-5454',
36     email          => 'ivan-skipjack-test@420.am',
37 );
38 $tx->test_transaction(1); # test, dont really charge
39 $tx->submit();
40
41 if($tx->is_success()) {
42     print "ok 1\n";
43 } else {
44     #warn $tx->server_response."\n";
45     warn $tx->error_message. "\n";
46     print "not ok 1\n";
47 }
48
49 my $v_tx = new Business::OnlinePayment("Skipjack");
50
51 $v_tx->content(
52     type           => 'VISA',
53     login          => $login, # "HTML serial number"
54     password       => $password, # "Developer serial number"
55     action         => 'Void',
56     description    => 'Business::OnlinePayment::Skipjack test',
57     order_number   => $tx->order_number(),
58 );
59
60 $v_tx->test_transaction(1); # test, dont really charge
61 $v_tx->submit();
62
63 if($v_tx->is_success()) {
64     print "ok 2\n";
65 } else {
66     #warn $v_tx->server_response."\n";
67     #warn $v_tx->error_message. "\n";
68     print "not ok 2\n";
69 }
70
71
72
73