1 use Test::More tests => 4;
3 use Business::OnlinePayment;
8 'gateway_login' => 'TESTMERCHANT',
9 'gateway_password' => '',,
12 my $tx = new Business::OnlinePayment(@opt);
14 $tx->test_transaction(1);
20 action => 'Normal Authorization',
21 description => 'Business::OnlinePayment test',
25 #have to specify both for now... maybe some auto-transforming later
30 address => '123 Anystreet',
34 card_number => '4007000000027',
35 expiration => '09/12',
36 cvv2 => '1234', #optional (not stored)
40 ok($tx->is_success, 'Transaction successful');
41 warn $tx->error_message."\n" unless $tx->is_success;
43 #use Data::Dumper; warn Dumper($tx);
45 my $token = $tx->card_token;
46 ok(length($token), 'Token returned');
50 my $private_key = read_file('t/private_key.txt') or skip 'no private key', 2;
52 like( $private_key, qr/-----BEGIN RSA PRIVATE KEY-----/, 'private key good' );
54 my $rx = new Business::OnlinePayment( @opt,
55 'private_key' => $private_key,
58 $rx->test_transaction(1);
64 action => 'Normal Authorization',
65 description => 'Business::OnlinePayment test',
68 card_number => $token,
72 ok($rx->is_success, 'Token transaction successful');
74 #use Data::Dumper; warn Dumper($rx);