added changelog, boilerplate POD and README, tests. use test_transaction flag,...
[Business-OnlinePayment-Skipjack.git] / t / return_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 $tx->content(
18     type           => 'VISA',
19     login          => '000944785470', # "HTML serial number"
20     action         => 'Normal Authorization',
21     description    => 'Business::OnlinePayment::Skipjack test',
22     amount         => '32',
23     card_number    => '5121212121212124',
24     expiration     => '03/10',
25     cvv2           => '999',
26     name           => 'Tofu Beast',
27     address        => '8320',
28     city           => 'Anywhere',
29     state          => 'UT',
30     zip            => '85284',
31     phone          => '415-420-5454',
32     email          => 'ivan-skipjack-test@420.am',
33 );
34 $tx->test_transaction(1); # test, dont really charge
35 $tx->submit();
36
37 if($tx->is_success()) {
38     print "ok 1\n";
39 } else {
40     #warn $tx->server_response."\n";
41     warn $tx->error_message. "\n";
42     print "not ok 1\n";
43 }
44
45 print "ok 2 # Skipped: Credit needs a settled transaction\n"; exit;
46
47 my $cr_tx = new Business::OnlinePayment("Skipjack");
48
49 $cr_tx->content(
50     type           => 'VISA',
51     login          => '000944785470', # "HTML serial number"
52     password       => '100594217288', # "developer serial number"
53     action         => 'Credit',
54     description    => 'Business::OnlinePayment::Skipjack test',
55     amount         => 11,
56     order_number   => $tx->order_number(),
57 );
58
59 $cr_tx->test_transaction(1); # test, dont really charge
60 $cr_tx->submit();
61
62 if($cr_tx->is_success()) {
63     print "ok 2\n";
64 } else {
65     #warn $cr_tx->server_response."\n";
66     warn $cr_tx->error_message. "\n";
67     print "not ok 2\n";
68 }
69
70
71
72