initial import
[Business-OnlinePayment-BankOfAmerica.git] / t2 / credit_card.t
1 BEGIN { $| = 1; print "1..2\n"; }
2
3 use Business::OnlinePayment;
4
5 my $tx = new Business::OnlinePayment("BankOfAmerica", 'merchant_id' => 'YOURMERCHANTID' );
6 $tx->content(
7     type           => 'VISA',
8     action         => 'Authorization Only',
9     description    => 'Business::OnlinePayment::BankOfAmerica visa test',
10     amount         => '0.01',
11     invoice_number => '100',
12     customer_id    => 'jsk',
13     first_name     => 'Tofu',
14     last_name      => 'Beast',
15     address        => '123 Anystreet',
16     city           => 'Anywhere',
17     state          => 'UT',
18     zip            => '84058',
19     country        => 'US',
20     email          => 'ivan-bofa@420.am',
21     card_number    => '4007000000027',
22     expiration     => '12/2002',
23     referer        => 'http://cleanwhisker.420.am/',
24 );
25 $tx->submit();
26
27 if($tx->is_success()) {
28     print "ok 1\n";
29     $auth = $tx->authorization;
30     $ordernum = $tx->order_number;
31     #warn "********* $auth ***********\n";
32     #warn "********* $ordernum ***********\n";
33 } else {
34     print "not ok 1\n";
35 #    warn '***** '. $tx->error_message. " *****\n";
36     exit;
37 }
38
39 #exit;
40 my $capture = new Business::OnlinePayment("BankOfAmerica", 'merchant_id' => 'YOURMERCHANTID' );
41
42 $capture->content(
43     action         => 'Post Authorization',
44     login          => 'YOURLOGIN
45     password       => 'YOURPASSWORD',
46     order_number   => $ordernum,
47     amount         => '0.01',
48     authorization  => $auth,
49     description    => 'Business::OnlinePayment::BankOfAmerica visa test',
50 );
51
52 $capture->submit();
53
54 if($capture->is_success()) { 
55     print "ok 2\n";
56 } else {
57 #    warn '***** '. $capture->error_message. " *****\n";
58     print "not ok 2\n";
59 }
60
61