initial try at a module
[Business-OnlinePayment-FirstDataGlobalGateway.git] / t / transaction_decline.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5 use POSIX qw(strftime);
6 use Test::More tests => 3;
7
8 use Business::OnlinePayment;
9
10 my %content = (                                                                 
11     action         => "Normal Authorization",                                   
12     type           => "CC",                                                     
13     description    => "Business::OnlinePayment::FirstDataGlobalGateway test",     
14     card_number    => '4111111111111111',
15     cvv2           => '123',
16     expiration     => '12/20',
17     amount         => '2.00',
18     first_name     => 'Tofu',
19     last_name      => 'Beast',
20     address        => '1234 Soybean Ln.',
21     city           => 'Soyville',
22     state          => 'CA', #where else?
23     zip            => '54545',
24 );                                                                              
25
26 my $tx = new Business::OnlinePayment( 'FirstDataGlobalGateway' );
27
28 $tx->content( %content );
29
30 $tx->test_transaction(1);
31
32 $tx->submit;
33
34 unlike( $tx->error_message, qr/^Agent code has not been set up/, 'Test decline not a login error');
35 is( $tx->is_success, 0, 'Test decline transaction successful');
36 is( $tx->failure_status, 'decline', 'Test decline failure_status set');
37
38 1;