initial import
[Business-OnlinePayment-TransactionCentral.git] / t / bad_card.t
1 BEGIN {$| = 1; print "1..1\n"; }
2
3 print "ok 1 # Skipped: No way to get a decline response out of test account";
4 exit;
5
6 eval "use Net::SSLeay;";
7 if ( $@ ) {
8   print "ok 1 # Skipped: Net::SSLeay is not installed\n"; exit;
9 }
10
11 use Business::OnlinePayment;
12
13 my $tx = new Business::OnlinePayment("TransactionCentral");
14
15 #$Business::OnlinePayment::HTTPS::DEBUG = 1;
16 #$Business::OnlinePayment::HTTPS::DEBUG = 1;
17 $Business::OnlinePayment::TransactionCentral::DEBUG = 1;
18 $Business::OnlinePayment::TransactionCentral::DEBUG = 1;
19
20 $tx->content(
21     type           => 'VISA',
22     login          => '10011',
23     password       => 'KK48NPYEJHMAH6DK', #regkey
24     action         => 'Normal Authorization',
25     amount         => '32.32',
26     #card_number    => '4012000000001',
27     #card_number    => '4342424242424242',
28     card_number    => '1',
29     expiration     => '08/06',
30     cvv2           => '420',
31     name           => 'Tofu Beast',
32     address        => '123 Anystreet',
33     city           => 'Anywhere',
34     state          => 'UT',
35     zip            => '84058',
36     country        => 'US',
37     email          => 'ivan-transactioncentral-test@420.am',
38 );
39 $tx->test_transaction(1); # test, dont really charge
40 $tx->submit();
41
42 if($tx->is_success()) {
43     print "not ok 1\n";
44 } else {
45     #warn $tx->server_response."\n";
46     #warn  $tx->error_message. "\n";
47     print "ok 1\n";
48 }