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