From: jeff Date: Wed, 17 Jun 2009 09:15:41 +0000 (+0000) Subject: conditionally send port, always send TRANTYPE=00 noise, and be case insensitive to... X-Git-Url: http://git.freeside.biz/gitweb/?p=Business-OnlineThirdPartyPayment-Interswitchng.git;a=commitdiff_plain;h=3de34ecd853acb4784dfe5a771a230701e84fd35 conditionally send port, always send TRANTYPE=00 noise, and be case insensitive to the paramater names passed back from the gateway --- diff --git a/Interswitchng.pm b/Interswitchng.pm index c1c7fec..c484c0f 100644 --- a/Interswitchng.pm +++ b/Interswitchng.pm @@ -22,7 +22,10 @@ sub set_defaults { sub reference { my ($self, $data) = @_; - $data->{TXNREF} || ''; + #$data->{TXNREF} || ''; + my @refkey = grep { /txnref/i } keys %{$data}; # @#$%#@%! + my $refkey = $refkey[0] || ''; # please don't give me 2 + $data->{$refkey} || ''; } sub submit { @@ -48,10 +51,14 @@ sub submit { ); %content = $self->content; $content{AMT} = $content{amount} * 100; + $content{TRANTYPE} = '00'; my $url = - "https://". $self->server(). ':'. $self->port(). $self->path(). '?'. - join( '&', map { "$_=$content{$_}" } qw( CADPID MERTID TXNREF AMT ) ); + "https://". $self->server(). + ($self->port != 443 ? ':'. $self->port() : ''). $self->path(). '?'. + join( '&', map { "$_=$content{$_}" } + qw( CADPID MERTID TXNREF AMT TRANTYPE ) + ); $self->popup_url( $url ); $self->is_success(1);