5 use POSIX qw(strftime);
7 use Business::OnlinePayment;
8 require "t/lib/test_account.pl";
10 my %opts = test_account_or_skip('card');
12 if (!$opt{'gid'} || !$opt{'appid'}) {
13 plan skip_all => "no test credentials provided; fill out t/lib/test_account.pl to test communication with the gateway.",
24 appid => $opts{'appid'},
25 action => 'Normal Authorization',
26 description => 'Business::OnlinePayment visa test',
27 card_number => '4111111111111111',
29 expiration => expiration_date(),
32 email => 'fake@acme.com',
33 address => '123 Anystreet',
37 my $tx = new Business::OnlinePayment( 'vSecureProcessing', \%opts );
39 $tx->content( %content,
40 action => 'Normal Authorization' );
42 $tx->test_transaction(1);
46 is( $tx->is_success, 1, 'purchase' )
47 or diag('Gateway error: '. $tx->error_message);
52 my $auth = $tx->authorization;
53 $tx = new Business::OnlinePayment( 'vSecureProcessing' );
54 $tx->content( %content,
56 authorization => $auth );
57 $tx->test_transaction(1);
61 is( $tx->is_success, 1, 'refund' )
62 or diag('Gateway error: '. $tx->error_message);