fix identifier for Amex, patch from Doug Juhlin / Donor.com, thanks!
[Business-OnlinePayment-IATSPayments.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     action         => "Normal Authorization",                                   
12     type           => "CC",                                                     
13     description    => "Business::OnlinePayment::IATSPayments test",     
14     card_number    => '4111111111111111',
15     cvv2           => '123',
16     expiration     => '12/20',
17     amount         => '1.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( 'IATSPayments' );
27
28 $tx->content( %content );
29
30 $tx->test_transaction(1);
31
32 $tx->submit;
33
34 is( $tx->is_success, 1, 'Test transaction successful')
35   or diag('iATS Payments error: '. $tx->error_message);
36             
37 1;