add new test files to MANIFEST
[Business-OnlinePayment-TransactionCentral.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 require "t/lib/test_account.pl";
11 my($login, $regkey) = test_account_or_skip();
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          => $login,
23     password       => $regkey,
24     action         => 'Normal Authorization',
25     description    => 'Business::OnlinePayment::TransactionCentral test',
26     amount         => '32',
27     card_number    => '4012000000001',
28     expiration     => '01/06',
29     cvv2           => '420',
30     name           => 'Tofu Beast',
31     address        => '123 Anystreet',
32     city           => 'Anywhere',
33     state          => 'UT',
34     zip            => '84058',
35     country        => 'US',
36     email          => 'ivan-transactioncentral-test@420.am',
37 );
38 $tx->test_transaction(1); # test, dont really charge
39 $tx->submit();
40
41 if($tx->is_success()) {
42     print "ok 1\n";
43 } else {
44     #warn $tx->server_response."\n";
45     warn $tx->error_message. "\n";
46     print "not ok 1\n";
47 }
48