From f471ec6ca2456ddabfeaf42949a077fc0b326ff0 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 30 Mar 2021 10:35:55 -0700 Subject: [PATCH] Update tests for new test server --- Changes | 1 + IPPay.pm | 1 + README | 3 ++- t/card.t | 43 +++++++++++++++++++++---------------------- 4 files changed, 25 insertions(+), 23 deletions(-) diff --git a/Changes b/Changes index 0a104a7..f297a16 100644 --- a/Changes +++ b/Changes @@ -4,6 +4,7 @@ Revision history for Perl extension Business::OnlinePayment::IPPay. - ACH SEC code: Allow setting, default to CCD for business accounts, PPD otherwise (was: always PPD) - doc: Update copyright and maintainer information + - Update tests for new test server 0.10 unreleased (2015) - UserIPAddr is now UserIPAddress diff --git a/IPPay.pm b/IPPay.pm index 7f15fcc..1fca678 100644 --- a/IPPay.pm +++ b/IPPay.pm @@ -217,6 +217,7 @@ sub submit { } if ($self->test_transaction()) { $content{'login'} = 'TESTTERMINAL'; + $self->server('testgtwy.ippay.com') if $self->server eq 'gtwy.ippay.com'; } $self->content(%content); diff --git a/README b/README index b8aeb7c..e82c2d7 100644 --- a/README +++ b/README @@ -9,7 +9,8 @@ This is Business::OnlinePayment::IPPay, a Business::OnlinePayment backend module for IPPay. It is only useful if you have a merchant account with IPPay Merchant Services: http://www.ippay.com -This module implements the IPPay XML Product Specification Revision 1.1.2 +This module implemented the IPPay XML Product Specification Revision 1.1.2 +(historically), updated in 2021 using revision 1-1-9.1 (September 2018). Jeff Finucane is the original author. Mr. Kohles and Mr. Kohler provided material for cribbing. diff --git a/t/card.t b/t/card.t index 8564fcb..f00ce4e 100644 --- a/t/card.t +++ b/t/card.t @@ -66,6 +66,7 @@ my $voidable_amount = 0; authorization => qr/^$/, avs_code => '', # so rather pointless :\ cvv2_response => '', # ... + order_number => qr/^$/, ); } @@ -90,10 +91,7 @@ my $voidable_amount = 0; } # authorization void test -SKIP: { - #XXX void is returning "The transaction type is not a valid transaction type." - # with current IPPay. did something change about the API, is this broken? - skip 'Reverse Authorization not currently working (against test account?)', 7; +{ my $tx = Business::OnlinePayment->new("IPPay", %opt); $tx->content(%content, action => 'authorization only', amount => '3.00' ); @@ -110,10 +108,10 @@ SKIP: { desc => "reverse authorization", is_success => 1, result_code => '000', - error_message => 'APPROVED', + error_message => 'VOID SUCCESSFUL', authorization => qr/TEST\d{2}/, avs_code => '', # so rather pointless :\ - cvv2_response => '', # ... + cvv2_response => 'P', # ... ); } else { @@ -122,7 +120,7 @@ SKIP: { } # post authorization test -SKIP: { +{ my $tx = new Business::OnlinePayment( "IPPay", %opt ); $tx->content( %content, 'action' => "post authorization", 'amount' => $postable_amount, # not required @@ -141,7 +139,7 @@ SKIP: { } # void test -SKIP: { +{ my $tx = new Business::OnlinePayment( "IPPay", %opt ); $tx->content( %content, 'action' => "Void", 'order_number' => $voidable, @@ -152,15 +150,15 @@ SKIP: { desc => "void", is_success => 1, result_code => '000', - error_message => 'VOID PROCESSED', - authorization => qr/^$voidable_auth$/, + error_message => 'VOID SUCCESSFUL', + authorization => qr/TEST\d{2}/, avs_code => '', - cvv2_response => '', + cvv2_response => 'P', ); } # credit test -SKIP: { +{ my $tx = new Business::OnlinePayment( "IPPay", %opt ); $tx->content( %content, 'action' => "credit"); tx_check( @@ -168,10 +166,10 @@ SKIP: { desc => "credit", is_success => 1, result_code => '000', - error_message => 'RETURN ACCEPTED', - authorization => qr/\d{6}/, + error_message => 'APPROVED', + authorization => qr/TEST\d{2}/, avs_code => '', - cvv2_response => '', + cvv2_response => 'P', ); } @@ -183,13 +181,14 @@ sub tx_check { $tx->test_transaction(1); $tx->submit; - is( $tx->is_success, $o{is_success}, "$o{desc}: " . tx_info($tx) ); - is( $tx->result_code, $o{result_code}, "result_code(): RESULT" ); - is( $tx->error_message, $o{error_message}, "error_message() / RESPMSG" ); - like( $tx->authorization, $o{authorization}, "authorization() / AUTHCODE" ); - is( $tx->avs_code, $o{avs_code}, "avs_code() / AVSADDR and AVSZIP" ); - is( $tx->cvv2_response, $o{cvv2_response}, "cvv2_response() / CVV2MATCH" ); - like( $tx->order_number, qr/^\w{18}/, "order_number() / PNREF" ); + is( $tx->is_success, $o{is_success}, "$o{desc}: ". tx_info($tx) ); + is( $tx->result_code, $o{result_code}, "$o{desc}: result_code()" ); + is( $tx->error_message, $o{error_message}, "$o{desc}: error_message()" ); + like( $tx->authorization, $o{authorization}, "$o{desc}: authorization()" ); + is( $tx->avs_code, $o{avs_code}, "$o{desc}: avs_code()" ); + is( $tx->cvv2_response, $o{cvv2_response}, "$o{desc}: cvv2_response()" ); + like( $tx->order_number, $o{order_number} + || qr/^\w{18}/, "$o{desc}: order_number()" ); } sub tx_info { -- 2.11.0