diff options
Diffstat (limited to 't2')
-rw-r--r-- | t2/bad_auth.t | 32 | ||||
-rw-r--r-- | t2/credit_card.t | 61 |
2 files changed, 93 insertions, 0 deletions
diff --git a/t2/bad_auth.t b/t2/bad_auth.t new file mode 100644 index 0000000..602c816 --- /dev/null +++ b/t2/bad_auth.t @@ -0,0 +1,32 @@ +BEGIN { $| = 1; print "1..1\n"; } + +use Business::OnlinePayment; + +my $tx = new Business::OnlinePayment("BankOfAmerica", 'merchant_id' => 'YOURMERCHANTID' ); +$tx->content( + type => 'VISA', + action => 'Authorization Only', + description => 'Business::OnlinePayment::BankOfAmerica visa test', + amount => '49.95', + invoice_number => '100', + customer_id => 'jsk', + first_name => 'Tofu', + last_name => 'Beast', + address => '123 Anystreet', + city => 'Anywhere', + state => 'UT', + zip => '84058', + country => 'US', + email => 'ivan-bofa@420.am', +# card_number => '4007000000027', + expiration => '08/2004', + referer => 'http://cleanwhisker.420.am/', +); +$tx->submit(); + +if($tx->is_success()) { + print "not ok 1\n"; +} else { +# warn '***** '. $tx->error_message. " *****\n"; + print "ok 1\n"; +} diff --git a/t2/credit_card.t b/t2/credit_card.t new file mode 100644 index 0000000..1f47875 --- /dev/null +++ b/t2/credit_card.t @@ -0,0 +1,61 @@ +BEGIN { $| = 1; print "1..2\n"; } + +use Business::OnlinePayment; + +my $tx = new Business::OnlinePayment("BankOfAmerica", 'merchant_id' => 'YOURMERCHANTID' ); +$tx->content( + type => 'VISA', + action => 'Authorization Only', + description => 'Business::OnlinePayment::BankOfAmerica visa test', + amount => '0.01', + invoice_number => '100', + customer_id => 'jsk', + first_name => 'Tofu', + last_name => 'Beast', + address => '123 Anystreet', + city => 'Anywhere', + state => 'UT', + zip => '84058', + country => 'US', + email => 'ivan-bofa@420.am', + card_number => '4007000000027', + expiration => '12/2002', + referer => 'http://cleanwhisker.420.am/', +); +$tx->submit(); + +if($tx->is_success()) { + print "ok 1\n"; + $auth = $tx->authorization; + $ordernum = $tx->order_number; + #warn "********* $auth ***********\n"; + #warn "********* $ordernum ***********\n"; +} else { + print "not ok 1\n"; +# warn '***** '. $tx->error_message. " *****\n"; + exit; +} + +#exit; +my $capture = new Business::OnlinePayment("BankOfAmerica", 'merchant_id' => 'YOURMERCHANTID' ); + +$capture->content( + action => 'Post Authorization', + login => 'YOURLOGIN + password => 'YOURPASSWORD', + order_number => $ordernum, + amount => '0.01', + authorization => $auth, + description => 'Business::OnlinePayment::BankOfAmerica visa test', +); + +$capture->submit(); + +if($capture->is_success()) { + print "ok 2\n"; +} else { +# warn '***** '. $capture->error_message. " *****\n"; + print "not ok 2\n"; +} + + |