X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=IPPay.pm;h=5d976553f5070f29549710e940cfe37835aece7c;hb=1f19e67636476c7119cfb41920c5b176e617c697;hp=3c01f99f91362ab115c3a2d747aa44ce89a3f723;hpb=3522afcdab42daa2351f16e9f17f79d55f0eeb75;p=Business-OnlinePayment-IPPay.git diff --git a/IPPay.pm b/IPPay.pm index 3c01f99..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.05'; +$VERSION = '0.07'; $VERSION = eval $VERSION; # modperlstyle: convert the string into a number $DEBUG = 0; @@ -28,6 +28,7 @@ sub _info { 'Post Authorization', 'Void', 'Credit', + 'Reverse Authorization', ], 'ECHECK' => [ 'Normal Authorization', @@ -45,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 @@ -89,6 +90,7 @@ sub map_fields { ( 'normal authorization' => 'SALE', 'authorization only' => 'AUTHONLY', 'post authorization' => 'CAPT', + 'reverse authorization' => 'REVERSEAUTH', 'void' => 'VOID', 'credit' => 'CREDIT', ); @@ -97,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' ); @@ -189,6 +192,8 @@ sub submit { }elsif ( $action eq 'post authorization' && $type eq 'CC') { push @required_fields, qw( order_number ); + }elsif ( $action eq 'reverse authorization' && $type eq 'CC') { + push @required_fields, qw( order_number card_number expiration amount ); }elsif ( $action eq 'void') { push @required_fields, qw( order_number amount ); @@ -209,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); @@ -221,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); @@ -391,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"); @@ -521,6 +523,7 @@ The following actions are valid normal authorization authorization only + reverse authorization post authorization credit void @@ -588,14 +591,20 @@ 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. See http://www.ippay.com/ for more information. -=head1 AUTHOR +=head1 AUTHORS + +Original author: Jeff Finucane + +Current maintainer: Ivan Kohler -Jeff Finucane, ippay@weasellips.com +Reverse Authorization patch from dougforpres =head1 SEE ALSO