working tests!
[Business-OnlinePayment-Skipjack.git] / t / credit_card_mc.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 $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'} || '000843232776';
18 my $password = $ENV{'sj_devel_serial_number'} || '100025931874';
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     name           => 'Tofu Beast',
30     address        => '123 Anystreet',
31     city           => 'Anywhere',
32     state          => 'UT',
33     zip            => '84058',
34     phone          => '415-420-5454',
35     email          => 'ivan-skipjack-test@420.am',
36 );
37 $tx->test_transaction(1); # test, dont really charge
38 $tx->submit();
39
40 if($tx->is_success()) {
41     print "ok 1\n";
42 } else {
43     warn $tx->server_response."\n";
44     warn $tx->error_message. "\n";
45     print "not ok 1\n";
46 }
47