diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-05-04 15:18:35 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-05-04 15:18:35 -0700 |
commit | 8446e3d316a469f22403f8767e48aac04c8ab79a (patch) | |
tree | cf4b4f1a626591de67d28f3fc386c9c619cf0b3c /t | |
parent | 3d14e9d827c8fb53193d7534e3d13ef5aa288660 (diff) |
add Reverse Authorization support, patch from dougforpres
Diffstat (limited to 't')
-rw-r--r-- | t/card.t | 30 |
1 files changed, 29 insertions, 1 deletions
@@ -4,7 +4,7 @@ use Test::More; require "t/lib/test_account.pl"; my($login, $password, %opt) = test_account_or_skip('card'); -plan tests => 43; +plan tests => 50; use_ok 'Business::OnlinePayment'; @@ -89,6 +89,34 @@ my $voidable_amount = 0; $postable_amount = $content{amount} if $tx->is_success; } +# authorization void test +{ + my $tx = Business::OnlinePayment->new("IPPay", @opts); + $tx->content(%content, action => 'authorization only', amount => '3.00' ); + $tx->test_transaction(1); + $tx->submit; + + if ($tx->is_success) { + my $void_tx = Business::OnlinePayment->new("IPPay", @opts); + + $tx->content(%content, action => 'reverse authorization', + order_number => $tx->order_number ); + tx_check( + $tx, + desc => "reverse authorization", + is_success => 1, + result_code => '000', + error_message => 'APPROVED', + authorization => qr/TEST\d{2}/, + avs_code => '', # so rather pointless :\ + cvv2_response => '', # ... + ); + } + else { + + } +} + # post authorization test SKIP: { my $tx = new Business::OnlinePayment( "IPPay", %opt ); |