summaryrefslogtreecommitdiff
path: root/t/bad_auth.t
blob: 40db574801e87a404cea6d4c6f49a938ddea3975 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
BEGIN { $| = 1; print "1..1\n"; }

use Business::OnlinePayment;

die "set environment variables to test: PFPRO_USER, PFPRO_VENDOR, PFPRO_PWD, ".
    "and optionally PFPRO_PARTNER and PFPRO_CERT_PATH\n"
  unless $ENV{'PFPRO_USER'} && $ENV{'PFPRO_VENDOR'} && $ENV{'PFPRO_PWD'};

my $tx = new Business::OnlinePayment("PayflowPro",
    'vendor'    => $ENV{PFPRO_VENDOR} ,
    'partner'   => ( $ENV{PFPRO_PARTNER} || 'verisign' ),
    'cert_path' => ( $ENV{PFPRO_CERT_PATH} || '.' ) ,
);

$tx->content(
    type           => 'VISA',
    login          => $ENV{'PFPRO_USER'},
    password       => $ENV{'PFPRO_PWD'},
    action         => 'Normal Authorization',
    description    => 'Business::OnlinePayment::PayflowPro visa test',
    amount         => '0.01',
    first_name     => 'Tofu',
    last_name      => 'Beast',
    address        => '123 Anystreet',
    city           => 'Anywhere',
    state          => 'UT',
    zip            => '84058',
    country        => 'US',
    email          => 'ivan-payflowpro@420.am',
    #card_number    => '4007000000027',
    #card_number    => '4111111111111111',
    card_number    => '4111111111111112',
    expiration     => '12/2009',
);

$tx->test_transaction(1);

$tx->submit();

if($tx->is_success()) {
    print "not ok 1\n";
    $auth = $tx->authorization;
    warn "********* $auth ***********\n";
} else {
    print "ok 1\n";
    warn '***** '. $tx->error_message. " *****\n";
    exit;
}