depend on B:OP v3
[Business-OnlinePayment-SecureHostingUPG.git] / t / crypt_credit_card.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("SecureHostingUPG");
15 $tx->content(
16     type           => 'VISA',
17     login          => 'SH207361', #SecureHosting Reference
18     password       => '495376',   #SecureHosting Checkcode value
19     action         => 'Normal Authorization',
20     description    => 'Business::OnlinePayment visa test',
21     amount         => '49.95',
22     currency       => 'GBP',
23     name           => 'Tofu Beast',
24     address        => '123 Anystreet',
25     city           => 'Anywhere',
26     state          => 'UT',
27     zip            => '84058',
28     phone          => '420-543-2199',
29     email          => 'tofu.beast@example.com',
30     card_number    => '4005550000000019',
31     expiration     => '08/06',
32     card_start     => '05/04',
33     cvv2           => '1234', #optional
34     issue_number   => '5678',
35 );
36 $tx->test_transaction(1); # test, dont really charge
37 $tx->submit();
38
39 if($tx->is_success()) {
40     print "ok 1\n";
41 } else {
42     #warn $tx->server_response."\n";
43     warn $tx->error_message. "\n";
44     print "not ok 1\n";
45 }
46