working tests!
[Business-OnlinePayment-Skipjack.git] / t / crypt_credit_card_mc.t
1 BEGIN {
2   $| = 1; print "1..1\n";
3   $Business::OnlinePayment::HTTPS::skip_NetSSLeay=1;
4   $Business::OnlinePayment::HTTPS::skip_NetSSLeay=1;
5 }
6
7 eval "use Crypt::SSLeay;";
8 if ( $@ ) {
9   print "ok 1 # Skipped: Crypt::SSLeay is not installed\n"; exit;
10 }
11
12 use Business::OnlinePayment;
13
14 my $tx = new Business::OnlinePayment("Skipjack");
15
16 #$Business::OnlinePayment::HTTPS::DEBUG = 1;
17 #$Business::OnlinePayment::HTTPS::DEBUG = 1;
18 #$Business::OnlinePayment::Skipjack::DEBUG = 1;
19 #$Business::OnlinePayment::Skipjack::DEBUG = 1;
20
21 my $login = $ENV{'sj_html_serial_number'} || '000843232776';
22 my $password = $ENV{'sj_devel_serial_number'} || '100025931874';
23
24 $tx->content(
25     type           => 'VISA',
26     login          => $login, # "HTML serial number"
27     password       => $password, # "Developer serial number"
28     action         => 'Normal Authorization',
29     description    => 'Business::OnlinePayment::Skipjack test',
30     amount         => '32',
31     card_number    => '5121212121212124',
32     expiration     => '03/10',
33     name           => 'Tofu Beast',
34     address        => '123 Anystreet',
35     city           => 'Anywhere',
36     state          => 'UT',
37     zip            => '84058',
38     phone          => '415-420-5454',
39     email          => 'ivan-skipjack-test@420.am',
40 );
41 $tx->test_transaction(1); # test, dont really charge
42 $tx->submit();
43
44 if($tx->is_success()) {
45     print "ok 1\n";
46 } else {
47     #warn $tx->server_response."\n";
48     warn $tx->error_message. "\n";
49     print "not ok 1\n";
50 }
51