summaryrefslogtreecommitdiff
path: root/t/crypt_check.t
diff options
context:
space:
mode:
authorivan <ivan>2005-11-07 11:10:08 +0000
committerivan <ivan>2005-11-07 11:10:08 +0000
commit32073e637db2c5c91b726072f891c36ebd8b3d10 (patch)
tree640c38906b1a49f820075b8521ac56fad9b2abd2 /t/crypt_check.t
parent71f81652cd1bd62d0962647ffb19bf49d681f726 (diff)
- Switch from GET to POST, as per old 1.5 prerelease from Michael
Lehmkuhl <michael@electricpulp.com> - Don't check expiration for ECHECK and refunds - For the unsupported "void" action, return is_success 0 and error msg suggesting "credit" action, instead of croaking. This way the "try void first, if it fails, try credit" idiom will work. - tests: enable check.t and add crypt_check.t and {crypt_}bad_check.t - update with new test account
Diffstat (limited to 't/crypt_check.t')
-rw-r--r--t/crypt_check.t43
1 files changed, 43 insertions, 0 deletions
diff --git a/t/crypt_check.t b/t/crypt_check.t
new file mode 100644
index 0000000..7d01a85
--- /dev/null
+++ b/t/crypt_check.t
@@ -0,0 +1,43 @@
+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;
+
+# checks are broken it seems
+my $ctx = new Business::OnlinePayment("OpenECHO");
+$ctx->content(
+ type => 'CHECK',
+ 'login' => '123>4685706',
+ 'password' => '09437869',
+ action => 'Normal Authorization',
+ amount => '49.95',
+ invoice_number => '100100',
+ customer_id => 'jsk',
+ first_name => 'Tofu',
+ last_name => 'Beast',
+ account_number => '12345',
+ routing_code => '026009593',
+ bank_name => 'First National Test Bank',
+ phone => '420-420-5454',
+ payee => 'Tofu Heavy Enterprises, GmbH',
+ check_number => '420',
+);
+$ctx->test_transaction(1); # test, dont really charge
+$ctx->submit();
+
+print $ctx->is_success()."\n";
+
+if($ctx->is_success()) {
+ print "ok 1\n";
+} else {
+ warn $ctx->error_message();
+ print "not ok 1 (".$ctx->error_message().")\n";
+}