From 8446e3d316a469f22403f8767e48aac04c8ab79a Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Fri, 4 May 2012 15:18:35 -0700 Subject: add Reverse Authorization support, patch from dougforpres --- t/card.t | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 't/card.t') diff --git a/t/card.t b/t/card.t index e68be0d..dc1d38d 100644 --- a/t/card.t +++ b/t/card.t @@ -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 ); -- cgit v1.2.1