summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/bad_auth.t43
-rw-r--r--t/bop.t5
-rw-r--r--t/credit_card.t42
-rw-r--r--t/load.t5
4 files changed, 95 insertions, 0 deletions
diff --git a/t/bad_auth.t b/t/bad_auth.t
new file mode 100644
index 0000000..e0db291
--- /dev/null
+++ b/t/bad_auth.t
@@ -0,0 +1,43 @@
+BEGIN { $| = 1; print "1..2\n"; }
+
+use Business::OnlinePayment;
+
+my $tx = new Business::OnlinePayment("PayflowPro",
+# 'storename' => '000000',
+# 'keyfile' => '/path/to/cert.pem',
+# 'lbin' => '/path/to/lbin',
+# 'tmp' => '/path/to/secure/tempdir',
+);
+
+$tx->content(
+ type => 'VISA',
+ action => 'Normal Authorization',
+ description => 'Business::OnlinePayment::PayflowPro visa test',
+ amount => '0.01',
+ first_name => 'Tofu',
+ last_name => 'Beast',
+ address => '123 Anystreet',
+ city => 'Anywhere',
+ state => 'UT',
+ zip => '84058',
+ country => 'US',
+ email => 'ivan-payflowpro@420.am',
+ card_number => '4007000000027',
+ expiration => '12/2002',
+# 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/bop.t b/t/bop.t
new file mode 100644
index 0000000..64332c5
--- /dev/null
+++ b/t/bop.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n"; }
+END {print "not ok 1\n" unless $loaded;}
+use Business::OnlinePayment;
+$loaded = 1;
+print "ok 1\n";
diff --git a/t/credit_card.t b/t/credit_card.t
new file mode 100644
index 0000000..e0ce71c
--- /dev/null
+++ b/t/credit_card.t
@@ -0,0 +1,42 @@
+BEGIN { $| = 1; print "1..2\n"; }
+
+use Business::OnlinePayment;
+
+my $tx = new Business::OnlinePayment("PayflowPro",
+# 'storename' => '000000',
+# 'keyfile' => '/path/to/cert.pem',
+# 'lbin' => '/path/to/lbin',
+# 'tmp' => '/path/to/secure/tempdir',
+);
+
+$tx->content(
+ type => 'VISA',
+ action => 'Normal Authorization',
+ description => 'Business::OnlinePayment::PayflowPro visa test',
+ amount => '0.01',
+ first_name => 'Tofu',
+ last_name => 'Beast',
+ address => '123 Anystreet',
+ city => 'Anywhere',
+ state => 'UT',
+ zip => '84058',
+ country => 'US',
+ email => 'ivan-payflowpro@420.am',
+ card_number => '4007000000027',
+ expiration => '12/2003',
+);
+
+$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..d2a7f26
--- /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::PayflowPro;
+$loaded = 1;
+print "ok 1\n";