summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorivan <ivan>2005-03-16 10:37:56 +0000
committerivan <ivan>2005-03-16 10:37:56 +0000
commite9a8450242559f58aa2535a489d7a7acc85790e2 (patch)
tree8976a111a389153de569b73157cc5f07dfa5a5a6 /t
initial import
Diffstat (limited to 't')
-rw-r--r--t/bad_card.t35
-rw-r--r--t/bop.t5
-rw-r--r--t/credit_card.t36
-rw-r--r--t/crypt_bad_card.t35
-rw-r--r--t/crypt_credit_card.t34
-rw-r--r--t/crypt_load.t13
-rw-r--r--t/load.t12
7 files changed, 170 insertions, 0 deletions
diff --git a/t/bad_card.t b/t/bad_card.t
new file mode 100644
index 0000000..afd324b
--- /dev/null
+++ b/t/bad_card.t
@@ -0,0 +1,35 @@
+BEGIN {$| = 1; print "1..1\n"; }
+
+eval "use Net::SSLeay;";
+if ( $@ ) {
+ print "ok 1 # Skipped: Net::SSLeay is not installed\n"; exit;
+}
+
+use Business::OnlinePayment;
+
+my $tx = new Business::OnlinePayment("eSelectPlus");
+
+#$Business::OnlinePayment::HTTPS::DEBUG = 1;
+#$Business::OnlinePayment::HTTPS::DEBUG = 1;
+#$Business::OnlinePayment::eSelectPlus::DEBUG = 1;
+#$Business::OnlinePayment::eSelectPlus::DEBUG = 1;
+
+$tx->content(
+ type => 'VISA',
+ login => 'store1',
+ password => 'yesguy',
+ action => 'Normal Authorization',
+ amount => '32.32',
+ card_number => '4242424242424242',
+ expiration => '08/06',
+);
+$tx->test_transaction(1); # test, dont really charge
+$tx->submit();
+
+if($tx->is_success()) {
+ print "not ok 1\n";
+} else {
+ #warn $tx->server_response."\n";
+ #warn $tx->error_message. "\n";
+ print "ok 1\n";
+}
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..7cc40ac
--- /dev/null
+++ b/t/credit_card.t
@@ -0,0 +1,36 @@
+BEGIN { $| = 1; print "1..1\n"; }
+
+eval "use Net::SSLeay;";
+if ( $@ ) {
+ print "ok 1 # Skipped: Net::SSLeay is not installed\n"; exit;
+}
+
+use Business::OnlinePayment;
+
+my $tx = new Business::OnlinePayment("eSelectPlus");
+
+#$Business::OnlinePayment::HTTPS::DEBUG = 1;
+#$Business::OnlinePayment::HTTPS::DEBUG = 1;
+#$Business::OnlinePayment::eSelectPlus::DEBUG = 1;
+#$Business::OnlinePayment::eSelectPlus::DEBUG = 1;
+
+$tx->content(
+ type => 'VISA',
+ login => 'store1',
+ password => 'yesguy',
+ action => 'Normal Authorization',
+ amount => '54.01',
+ card_number => '4242424242424242',
+ expiration => '01/06',
+);
+$tx->test_transaction(1); # test, dont really charge
+$tx->submit();
+
+if($tx->is_success()) {
+ print "ok 1\n";
+} else {
+ #warn $tx->server_response."\n";
+ warn $tx->error_message. "\n";
+ print "not ok 1\n";
+}
+
diff --git a/t/crypt_bad_card.t b/t/crypt_bad_card.t
new file mode 100644
index 0000000..7089078
--- /dev/null
+++ b/t/crypt_bad_card.t
@@ -0,0 +1,35 @@
+BEGIN {
+ $| = 1; print "1..1\n";
+ $Business::OnlinePayment::HTTPS::skip_NetSSLeay=1;
+ $Business::OnlinePayment::HTTPS::skip_NetSSLeay=1;
+}
+
+eval "use Crypt::SSLeay;";
+if ( $@ ) {
+ print "ok 1 # Skipped: Crypt::SSLeay is not installed\n"; exit;
+}
+
+use Business::OnlinePayment;
+
+my $tx = new Business::OnlinePayment("eSelectPlus");
+
+$tx->content(
+ type => 'VISA',
+ login => 'store1',
+ password => 'yesguy',
+ action => 'Normal Authorization',
+ amount => '32.32',
+ card_number => '4242424242424242',
+ expiration => '08/06',
+);
+$tx->test_transaction(1); # test, dont really charge
+$tx->submit();
+
+if($tx->is_success()) {
+ print "not ok 1\n";
+} else {
+ #warn $tx->server_response."\n";
+ #warn $tx->error_message. "\n";
+ print "ok 1\n";
+}
+
diff --git a/t/crypt_credit_card.t b/t/crypt_credit_card.t
new file mode 100644
index 0000000..ad458c3
--- /dev/null
+++ b/t/crypt_credit_card.t
@@ -0,0 +1,34 @@
+BEGIN {
+ $| = 1; print "1..1\n";
+ $Business::OnlinePayment::HTTPS::skip_NetSSLeay=1;
+ $Business::OnlinePayment::HTTPS::skip_NetSSLeay=1;
+}
+
+eval "use Crypt::SSLeay;";
+if ( $@ ) {
+ print "ok 1 # Skipped: Crypt::SSLeay is not installed\n"; exit;
+}
+
+use Business::OnlinePayment;
+
+my $tx = new Business::OnlinePayment("eSelectPlus");
+$tx->content(
+ type => 'VISA',
+ login => 'store1',
+ password => 'yesguy',
+ action => 'Normal Authorization',
+ amount => '54.01',
+ card_number => '4242424242424242',
+ expiration => '08/06',
+);
+$tx->test_transaction(1); # test, dont really charge
+$tx->submit();
+
+if($tx->is_success()) {
+ print "ok 1\n";
+} else {
+ #warn $tx->server_response."\n";
+ warn $tx->error_message. "\n";
+ print "not ok 1\n";
+}
+
diff --git a/t/crypt_load.t b/t/crypt_load.t
new file mode 100644
index 0000000..721cbcf
--- /dev/null
+++ b/t/crypt_load.t
@@ -0,0 +1,13 @@
+BEGIN {
+ $| = 1; print "1..1\n";
+ eval "use Crypt::SSLeay;";
+ if ( $@ ) {
+ print "ok 1 # Skipped: Crypt::SSLeay is not installed\n"; exit;
+ }
+ $Business::OnlinePayment::HTTPS::skip_NetSSLeay=1;
+ $Business::OnlinePayment::HTTPS::skip_NetSSLeay=1;
+}
+END {print "not ok 1\n" unless $loaded;}
+use Business::OnlinePayment::eSelectPlus;
+$loaded = 1;
+print "ok 1\n";
diff --git a/t/load.t b/t/load.t
new file mode 100644
index 0000000..ad30c8f
--- /dev/null
+++ b/t/load.t
@@ -0,0 +1,12 @@
+BEGIN {
+ $| = 1; print "1..1\n";
+ eval "use Net::SSLeay;";
+ if ( $@ ) {
+ print "ok 1 # Skipped: Net::SSLeay is not installed\n"; exit;
+ }
+
+}
+END {print "not ok 1\n" unless $loaded;}
+use Business::OnlinePayment::eSelectPlus;
+$loaded = 1;
+print "ok 1\n";