diff options
Diffstat (limited to 't')
-rw-r--r-- | t/bad_auth.t | 42 | ||||
-rw-r--r-- | t/credit_card.t | 41 | ||||
-rw-r--r-- | t/echeck.t | 50 | ||||
-rw-r--r-- | t/load.t | 5 |
4 files changed, 138 insertions, 0 deletions
diff --git a/t/bad_auth.t b/t/bad_auth.t new file mode 100644 index 0000000..8369a9f --- /dev/null +++ b/t/bad_auth.t @@ -0,0 +1,42 @@ +BEGIN { $| = 1; print "1..1\n"; } + +use Business::OnlinePayment; + +my $tx = new Business::OnlinePayment("LinkPoint", + 'storename' => '1909796604', + 'keyfile' => './test.pem', + 'server' => 'staging.linkpt.net', +); + +$tx->content( + type => 'VISA', + action => 'Normal Authorization', + description => 'Business::OnlinePayment::LinkPoint visa test', + amount => '0.01', + first_name => 'Tofu', + last_name => 'Beast', + address => '123 Anystreet', + city => 'Anywhere', + state => 'UT', + zip => '84058', + country => 'US', + email => 'ivan-linkpoint@420.am', + card_number => '4007000000027', + expiration => '12/2008', + result => 'DECLINE', +); + +$tx->test_transaction(1); + +$tx->submit(); + +if($tx->is_success()) { + print "not ok 1\n"; + $auth = $tx->authorization; + warn "********* $auth ***********\n"; +} else { + print "ok 1\n"; + #warn '***** '. $tx->error_message. " *****\n"; + exit; +} + diff --git a/t/credit_card.t b/t/credit_card.t new file mode 100644 index 0000000..1aaf3ea --- /dev/null +++ b/t/credit_card.t @@ -0,0 +1,41 @@ +BEGIN { $| = 1; print "1..1\n"; } + +use Business::OnlinePayment; + +my $tx = new Business::OnlinePayment("LinkPoint", + 'storename' => '1909796604', + 'keyfile' => './test.pem', + 'server' => 'staging.linkpt.net', +); + +$tx->content( + type => 'VISA', + action => 'Normal Authorization', + description => 'Business::OnlinePayment::LinkPoint visa test', + amount => '0.01', + first_name => 'Tofu', + last_name => 'Beast', + address => '123 Anystreet', + city => 'Anywhere', + state => 'UT', + zip => '84058', + country => 'US', + email => 'ivan-linkpoint@420.am', + card_number => '4007000000027', + expiration => '12/2008', +); + +$tx->test_transaction(1); + +$tx->submit(); + +if($tx->is_success()) { + print "ok 1\n"; + #$auth = $tx->authorization; + #warn "********* $auth ***********\n"; +} else { + print "not ok 1\n"; + warn '***** '. $tx->error_message. " *****\n"; + exit; +} + diff --git a/t/echeck.t b/t/echeck.t new file mode 100644 index 0000000..7a52c25 --- /dev/null +++ b/t/echeck.t @@ -0,0 +1,50 @@ +BEGIN { $| = 1; print "1..1\n"; } + +$no_echeck_tests = + "Skipped: Linkpoint doesn't provide a way to test echecks\n"; +warn $no_echeck_tests; +print "ok 1 # $no_echeck_tests"; +exit; + +use Business::OnlinePayment; + +my $tx = new Business::OnlinePayment("LinkPoint", + 'storename' => '1909796604', + 'keyfile' => './test.pem', + 'server' => 'staging.linkpt.net', +); + +$tx->content( + type => 'ECHECK', + action => 'Normal Authorization', + description => 'Business::OnlinePayment::LinkPoint echeck test', + amount => '0.01', + first_name => 'Tofu', + last_name => 'Beast', + address => '123 Anystreet', + city => 'Anywhere', + state => 'UT', + zip => '84058', + country => 'US', + email => 'ivan-linkpoint@420.am', + account_number => '0027', + account_type => 'Personal Checking', + routing_code => '400700000', + bank_name => 'SomeBank', + bank_state => 'UT', +); + +$tx->test_transaction(1); + +$tx->submit(); + +if($tx->is_success()) { + print "ok 1\n"; + #$auth = $tx->authorization; + #warn "********* $auth ***********\n"; +} else { + print "not ok 1\n"; + warn '***** '. $tx->error_message. " *****\n"; + exit; +} + diff --git a/t/load.t b/t/load.t new file mode 100644 index 0000000..ac1adbd --- /dev/null +++ b/t/load.t @@ -0,0 +1,5 @@ +BEGIN { $| = 1; print "1..1\n"; } +END {print "not ok 1\n" unless $loaded;} +use Business::OnlinePayment::LinkPoint; +$loaded = 1; +print "ok 1\n"; |