5 use POSIX qw(strftime);
7 use Business::OnlinePayment;
8 require "t/lib/test_account.pl";
10 my %opts = test_account('card');
12 if (!$opts{'login'} || !$opts{'password'}) {
13 plan skip_all => "no test credentials provided; fill out t/lib/test_account.pl to test communication with the gateway.",
20 login => delete $opts{'login'},
21 password => delete $opts{'password'},
22 action => 'Normal Authorization',
23 description => 'Business::OnlinePayment visa test',
24 card_number => '4111111111111112', # trigger failure
26 expiration => expiration_date(),
29 email => 'fake@acme.com',
30 address => '123 Anystreet',
34 my $tx = new Business::OnlinePayment( 'vSecureProcessing', %opts );
36 $tx->content( %content );
38 $tx->test_transaction(1);
42 is( $tx->is_success, 0, 'declined purchase')
43 or diag('Test transaction should have failed, but succeeded');
44 #is( $tx->failure_status, 'nsf', 'failure status' )
45 # or diag('Failure status reported as '.$tx->failure_status);