da64193806a089a62bc87e7f8bef56c5d7f07f04
[Business-OnlinePayment-OpenECHO.git] / t / bad_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    => '4005550000000020',
33     expiration     => '08/06',
34     card_start     => '05/04',
35     cvv2           => '1234', #optional
36     issue_number   => '5678',
37 );
38 $tx->test_transaction(1); # test, dont really charge
39 $tx->submit();
40
41 if($tx->is_success()) {
42     print "not ok 1\n";
43 } else {
44     #warn $tx->server_response."\n";
45     #warn  $tx->error_message. "\n";
46     print "ok 1\n";
47 }