summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjeff <jeff>2009-06-17 09:15:41 +0000
committerjeff <jeff>2009-06-17 09:15:41 +0000
commit3de34ecd853acb4784dfe5a771a230701e84fd35 (patch)
treeddd260b91f9c3300a737fab591a5b019abb755cb
parent5f0a0938cc0f64c12f8ffcea379fd0b4b7ad39e7 (diff)
conditionally send port, always send TRANTYPE=00 noise, and be case insensitive to the paramater names passed back from the gatewayHEADmaster
-rw-r--r--Interswitchng.pm13
1 files changed, 10 insertions, 3 deletions
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);