From 1f19e67636476c7119cfb41920c5b176e617c697 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sun, 28 Oct 2012 23:27:17 -0700 Subject: [PATCH] gateway URL change --- Changes | 4 +++- IPPay.pm | 40 ++++++++++++++++++++-------------------- Makefile.PL | 2 +- t/card.t | 6 +++--- t/lib/test_account.pl | 2 +- 5 files changed, 28 insertions(+), 26 deletions(-) diff --git a/Changes b/Changes index 586eb89..4d440c0 100644 --- a/Changes +++ b/Changes @@ -1,7 +1,9 @@ Revision history for Perl extension Business::OnlinePayment::IPPay. -0.07 unreleased +0.07 Sun Oct 28 23:24:21 PDT 2012 - add Reverse Authorization support, patch from dougforpres + - gateway URL change -- note this version will be the minimum required + once IPPay turns off the old URL 0.06 Wed Jan 26 13:15:21 PST 2011 - fix january bug in tests diff --git a/IPPay.pm b/IPPay.pm index 963ba5b..5d97655 100644 --- a/IPPay.pm +++ b/IPPay.pm @@ -11,7 +11,7 @@ use Business::OnlinePayment::HTTPS; use vars qw($VERSION $DEBUG @ISA $me); @ISA = qw(Business::OnlinePayment::HTTPS); -$VERSION = '0.07_01'; +$VERSION = '0.07'; $VERSION = eval $VERSION; # modperlstyle: convert the string into a number $DEBUG = 0; @@ -46,9 +46,9 @@ sub set_defaults { my %opts = @_; # standard B::OP methods/data - $self->server('gateway17.jetpay.com') unless $self->server; + $self->server('gtwy.ippay.com') unless $self->server; $self->port('443') unless $self->port; - $self->path('/jetpay') unless $self->path; + $self->path('/ippay') unless $self->path; $self->build_subs(qw( order_number avs_code cvv2_response response_page response_code response_headers @@ -99,20 +99,21 @@ sub map_fields { 'void' => 'VOIDACH', 'credit' => 'REVERSAL', ); + if ($self->transaction_type eq 'CC') { $content{'TransactionType'} = $actions{$action} || $action; - }elsif ($self->transaction_type eq 'ECHECK') { - $content{'TransactionType'} = $check_actions{$action} || $action; - } + } elsif ($self->transaction_type eq 'ECHECK') { + $content{'TransactionType'} = $check_actions{$action} || $action; - # ACCOUNT TYPE MAP - my %account_types = ('personal checking' => 'Checking', - 'personal savings' => 'Savings', - 'business checking' => 'BusinessCk', - ); - $content{'account_type'} = $account_types{lc($content{'account_type'})} - || $content{'account_type'}; + # ACCOUNT TYPE MAP + my %account_types = ('personal checking' => 'Checking', + 'personal savings' => 'Savings', + 'business checking' => 'BusinessCk', + ); + $content{'account_type'} = $account_types{lc($content{'account_type'})} + || $content{'account_type'}; + } $content{Origin} = 'RECURRING' if ($content{recurring_billing} &&$content{recurring_billing} eq 'YES' ); @@ -213,6 +214,9 @@ sub submit { foreach ( keys ( %{($self->{_defaults})} ) ) { $content{$_} = $self->{_defaults}->{$_} unless exists($content{$_}); } + if ($self->test_transaction()) { + $content{'login'} = 'TESTTERMINAL'; + } $self->content(%content); $self->required_fields(@required_fields); @@ -225,12 +229,6 @@ sub submit { } } - if ($self->test_transaction()) { - $self->server('test1.jetpay.com'); - $self->port('443'); - $self->path('/jetpay'); - } - my $transaction_id = $content{'order_number'}; unless ($transaction_id) { my ($page, $server_response, %headers) = $self->https_get('dummy' => 1); @@ -395,7 +393,7 @@ sub submit { if ( exists($response->{ActionCode}) && !exists($response->{ErrMsg})) { $self->error_message($response->{ResponseText}); }else{ - $self->error_message($response->{Errmsg}); + $self->error_message($response->{ErrMsg}); } # }else{ # $self->error_message("Server Failed"); @@ -593,6 +591,8 @@ from content(%content): =head1 COMPATIBILITY +Version 0.07 changes the server name and path for IPPay's late 2012 update. + Business::OnlinePayment::IPPay uses IPPay XML Product Specifications version 1.1.2. diff --git a/Makefile.PL b/Makefile.PL index 079fdf5..e1e71e4 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -2,7 +2,7 @@ use ExtUtils::MakeMaker; WriteMakefile( 'NAME' => 'Business::OnlinePayment::IPPay', 'VERSION_FROM' => 'IPPay.pm', # finds $VERSION - 'AUTHOR' => 'Jeff Finucane ', + 'AUTHOR' => 'Ivan Kohler ', 'PREREQ_PM' => { 'Business::OnlinePayment' => 3, 'Business::OnlinePayment::HTTPS' => 0.09, 'Locale::Country' => 2, diff --git a/t/card.t b/t/card.t index 5a227ae..9c021d6 100644 --- a/t/card.t +++ b/t/card.t @@ -61,8 +61,8 @@ my $voidable_amount = 0; $tx, desc => "invalid card_number", is_success => 0, - result_code => '912', - error_message => 'INVALID CARD NUMBER', + result_code => '900', #'912' with old jetpay gw + error_message => 'Invalid card number. ', #'INVALID CARD NUMBER' w/old gw authorization => qr/^$/, avs_code => '', # so rather pointless :\ cvv2_response => '', # ... @@ -91,7 +91,7 @@ my $voidable_amount = 0; # authorization void test { - my $tx = Business::OnlinePayment->new("IPPay", @opts); + my $tx = Business::OnlinePayment->new("IPPay", %opt); $tx->content(%content, action => 'authorization only', amount => '3.00' ); $tx->test_transaction(1); $tx->submit; diff --git a/t/lib/test_account.pl b/t/lib/test_account.pl index 06a2428..1133ea0 100644 --- a/t/lib/test_account.pl +++ b/t/lib/test_account.pl @@ -12,7 +12,7 @@ sub test_account_or_skip { sub test_account { my $suffix = shift || 'card'; - my($login, $password) = ('TESTMERCHANT', ''); + my($login, $password) = ('TESTTERMINAL', ''); my %opt; if ( $suffix eq 'check ' ) { -- 2.11.0