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.",
24 password => $password,
26 description => "Business::OnlinePayment::FirstDataGlobalGateway test",
27 card_number => '4111111111111111',
29 expiration => '12/20',
33 address => '1234 Soybean Ln.',
35 state => 'CA', #where else?
39 my $tx = new Business::OnlinePayment( 'FirstDataGlobalGateway' );
41 $tx->content( %content,
42 action => 'Normal Authorization' );
44 $tx->test_transaction(1);
48 is( $tx->is_success, 1, 'purchase' )
49 or diag('Gateway error: '. $tx->error_message);
54 my $auth = $tx->authorization;
55 $tx = new Business::OnlinePayment( 'FirstDataGlobalGateway' );
56 $tx->content( %content,
58 authorization => $auth );
59 $tx->test_transaction(1);
63 is( $tx->is_success, 1, 'refund' )
64 or diag('Gateway error: '. $tx->error_message);