diff options
Diffstat (limited to 't')
-rw-r--r-- | t/00-load.t (renamed from t/t_00-load.t) | 0 | ||||
-rw-r--r-- | t/boilerplate.t (renamed from t/t_boilerplate.t) | 0 | ||||
-rw-r--r-- | t/lib/test_account.pl | 9 | ||||
-rw-r--r-- | t/manifest.t (renamed from t/t_manifest.t) | 0 | ||||
-rw-r--r-- | t/pod-coverage.t (renamed from t/t_pod-coverage.t) | 0 | ||||
-rw-r--r-- | t/pod.t (renamed from t/t_pod.t) | 0 | ||||
-rw-r--r-- | t/transaction.t (renamed from t/t_transaction.t) | 12 | ||||
-rw-r--r-- | t/transaction_decline.t (renamed from t/t_transaction_decline.t) | 13 |
8 files changed, 16 insertions, 18 deletions
diff --git a/t/t_00-load.t b/t/00-load.t index a79fa22..a79fa22 100644 --- a/t/t_00-load.t +++ b/t/00-load.t diff --git a/t/t_boilerplate.t b/t/boilerplate.t index 50696af..50696af 100644 --- a/t/t_boilerplate.t +++ b/t/boilerplate.t diff --git a/t/lib/test_account.pl b/t/lib/test_account.pl index 69f8c89..7b10473 100644 --- a/t/lib/test_account.pl +++ b/t/lib/test_account.pl @@ -2,14 +2,11 @@ sub test_account { # fill all these fields in to test out transactions my %opts = ( - server =>'', # be sure to leave out the 'https://' + login => '', #userid + password => '', #gid platform => '', - gid => '', - tid => '', - userid=> 'name@server.com', - port => 443, - env => 'test', appid => '' + #tid => '', ); return %opts; diff --git a/t/t_manifest.t b/t/manifest.t index 45eb83f..45eb83f 100644 --- a/t/t_manifest.t +++ b/t/manifest.t diff --git a/t/t_pod-coverage.t b/t/pod-coverage.t index c021dd4..c021dd4 100644 --- a/t/t_pod-coverage.t +++ b/t/pod-coverage.t diff --git a/t/t_transaction.t b/t/transaction.t index 897e6f7..087bd02 100644 --- a/t/t_transaction.t +++ b/t/transaction.t @@ -9,7 +9,7 @@ require "t/lib/test_account.pl"; my %opts = test_account('card'); -if (!$opts{'gid'} || !$opts{'appid'}) { +if (!$opts{'login'} || !$opts{'password'}) { plan skip_all => "no test credentials provided; fill out t/lib/test_account.pl to test communication with the gateway.", 1; exit(0); @@ -21,7 +21,8 @@ plan tests => 2; # Purchase ### my %content = ( - appid => $opts{'appid'}, + login => delete($opts{'login'}), + password => delete($opts{'password'}), action => 'Normal Authorization', description => 'Business::OnlinePayment visa test', card_number => '4111111111111111', @@ -34,10 +35,9 @@ my %content = ( zip => '84058', ); -my $tx = new Business::OnlinePayment( 'vSecureProcessing', \%opts ); +my $tx = new Business::OnlinePayment( 'vSecureProcessing', %opts ); -$tx->content( %content, - action => 'Normal Authorization' ); +$tx->content( %content ); $tx->test_transaction(1); @@ -50,7 +50,7 @@ is( $tx->is_success, 1, 'purchase' ) # Refund ### my $auth = $tx->authorization; -$tx = new Business::OnlinePayment( 'vSecureProcessing' ); +$tx = new Business::OnlinePayment( 'vSecureProcessing', %opts ); $tx->content( %content, action => 'Credit', authorization => $auth ); diff --git a/t/t_transaction_decline.t b/t/transaction_decline.t index 2e15eb2..5f85874 100644 --- a/t/t_transaction_decline.t +++ b/t/transaction_decline.t @@ -9,15 +9,16 @@ require "t/lib/test_account.pl"; my %opts = test_account('card'); -if (!$opts{'gid'} || !$opts{'appid'}) { +if (!$opts{'login'} || !$opts{'password'}) { plan skip_all => "no test credentials provided; fill out t/lib/test_account.pl to test communication with the gateway.", 1; exit(0); } -plan tests => 2; +plan tests => 1; #2; my %content = ( - appid => $opts{'appid'}, + login => delete $opts{'login'}, + password => delete $opts{'password'}, action => 'Normal Authorization', description => 'Business::OnlinePayment visa test', card_number => '4111111111111112', # trigger failure @@ -30,7 +31,7 @@ my %content = ( zip => '84058', ); -my $tx = new Business::OnlinePayment( 'vSecureProcessing', \%opts ); +my $tx = new Business::OnlinePayment( 'vSecureProcessing', %opts ); $tx->content( %content ); @@ -40,7 +41,7 @@ $tx->submit; is( $tx->is_success, 0, 'declined purchase') or diag('Test transaction should have failed, but succeeded'); -is( $tx->failure_status, 'nsf', 'failure status' ) - or diag('Failure status reported as '.$tx->failure_status); +#is( $tx->failure_status, 'nsf', 'failure status' ) +# or diag('Failure status reported as '.$tx->failure_status); 1; |