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