summaryrefslogtreecommitdiff
path: root/t/transaction_decline.t
diff options
context:
space:
mode:
Diffstat (limited to 't/transaction_decline.t')
-rw-r--r--t/transaction_decline.t38
1 files changed, 38 insertions, 0 deletions
diff --git a/t/transaction_decline.t b/t/transaction_decline.t
new file mode 100644
index 0000000..47a4cd1
--- /dev/null
+++ b/t/transaction_decline.t
@@ -0,0 +1,38 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use POSIX qw(strftime);
+use Test::More tests => 3;
+
+use Business::OnlinePayment;
+
+my %content = (
+ action => "Normal Authorization",
+ type => "CC",
+ description => "Business::OnlinePayment::FirstDataGlobalGateway test",
+ card_number => '4111111111111111',
+ cvv2 => '123',
+ expiration => '12/20',
+ amount => '2.00',
+ first_name => 'Tofu',
+ last_name => 'Beast',
+ address => '1234 Soybean Ln.',
+ city => 'Soyville',
+ state => 'CA', #where else?
+ zip => '54545',
+);
+
+my $tx = new Business::OnlinePayment( 'FirstDataGlobalGateway' );
+
+$tx->content( %content );
+
+$tx->test_transaction(1);
+
+$tx->submit;
+
+unlike( $tx->error_message, qr/^Agent code has not been set up/, 'Test decline not a login error');
+is( $tx->is_success, 0, 'Test decline transaction successful');
+is( $tx->failure_status, 'decline', 'Test decline failure_status set');
+
+1;