5 use POSIX qw(strftime);
7 use Business::OnlinePayment;
9 my $login = $ENV{BOP_TEST_LOGIN};
10 my $password = $ENV{BOP_TEST_PASSWORD};
12 plan skip_all => "no test credentials provided; set BOP_TEST_LOGIN and BOP_TEST_PASSWORD to test communication with the gateway.",
20 password => $password,
21 action => "Normal Authorization",
23 description => "Business::OnlinePayment::FirstDataGlobalGateway test",
24 card_number => '4111111111111111',
26 expiration => '12/20',
27 amount => '5521.00', # trigger error 521
30 address => '1234 Soybean Ln.',
32 state => 'CA', #where else?
36 my $tx = new Business::OnlinePayment( 'FirstDataGlobalGateway' );
38 $tx->content( %content );
40 $tx->test_transaction(1);
44 is( $tx->is_success, 0, 'declined purchase')
45 or diag('Test transaction should have failed, but succeeded');
46 is( $tx->failure_status, 'nsf', 'failure status' )
47 or diag('Failure status reported as '.$tx->failure_status);