5 use POSIX qw(strftime);
8 use Business::OnlinePayment;
11 "to test set environment variables:"
12 . " (required) PFPRO_VENDOR PFPRO_USER PFPRO_PWD;"
13 . " (optional) PFPRO_PARTNER PFPRO_CERT_PATH";
16 ( $ENV{"PFPRO_USER"} && $ENV{"PFPRO_VENDOR"} && $ENV{"PFPRO_PWD"} )
18 : ( skip_all => $runinfo )
22 "vendor" => $ENV{PFPRO_VENDOR},
23 "partner" => $ENV{PFPRO_PARTNER} || "verisign",
24 "cert_path" => $ENV{PFPRO_CERT_PATH} || ".",
29 login => $ENV{"PFPRO_USER"},
30 password => $ENV{"PFPRO_PWD"},
31 action => "Normal Authorization",
32 description => "Business::OnlinePayment::PayflowPro test",
36 address => "123 Anystreet",
41 email => 'ivan-payflowpro@420.am',
42 expiration => "12/" . strftime( "%y", localtime ),
45 #card_number specified in test case
48 { # valid card number test
49 my $tx = new Business::OnlinePayment( "PayflowPro", %opts );
50 $tx->content( %content, card_number => "4111111111111111" );
51 $tx->test_transaction(1);
53 is( $tx->is_success, 1, "valid card num: " . tx_info($tx) );
56 { # invalid card number test
57 my $tx = new Business::OnlinePayment( "PayflowPro", %opts );
58 $tx->content( %content, card_number => "4111111111111112" );
59 $tx->test_transaction(1);
61 is( $tx->is_success, 0, "invalid card num: " . tx_info($tx) );
67 no warnings 'uninitialized';
71 "order_number(", $tx->order_number, ")",
72 " error_message(", $tx->error_message, ")",
73 " result_code(", $tx->result_code, ")",
74 " auth_info(", $tx->authorization, ")",
75 " avs_code(", $tx->avs_code, ")",
76 " cvv2_code(", $tx->cvv2_code, ")",