From: levinse Date: Thu, 9 Dec 2010 20:22:16 +0000 (+0000) Subject: fix Net::Ikano bug causing invalid response type error messages X-Git-Url: http://git.freeside.biz/gitweb/?p=Net-Ikano.git;a=commitdiff_plain;h=bd49a99a7de4fb821643d5cf35aa358247c6f727 fix Net::Ikano bug causing invalid response type error messages --- diff --git a/lib/Net/Ikano.pm b/lib/Net/Ikano.pm index 40eb7d8..cdf7e39 100644 --- a/lib/Net/Ikano.pm +++ b/lib/Net/Ikano.pm @@ -350,18 +350,11 @@ sub AUTOLOAD { . $resphash->{FailureResponse}->{FailureMessage} if $resphash->{type} eq 'FAILURE'; - my $validRespTypes = { - 'PREQUAL' => qw( PREQUAL ), - 'ORDERSTATUS' => qw( ORDERSTATUS ), - 'ORDER' => qw( NEWORDER CHANGEORDER CANCELORDER ), - 'CANCEL' => qw( ORDERCANCEL ), - 'PASSWORDCHANGE' => qw( PASSWORDCHANGE ), - 'ACCOUNTSTATUSCHANGE' => qw( ACCOUNTSTATUSCHANGE ), - 'CUSTOMERLOOKUP' => qw( CUSTOMERLOOKUP ), - }; - return "invalid response type ".$resphash->{type}." for request type $cmd" - unless grep( $_ eq $resphash->{type}, $validRespTypes->{$cmd}); + unless ( $cmd eq $resphash->{type} + || ($cmd eq 'ORDER' && $resphash->{type} =~ /(NEW|CHANGE|CANCEL)ORDER/ ) + || ($cmd eq "CANCEL" && $resphash->{type} eq "ORDERCANCEL") + ); return $self->$respsub($resphash,$reqhash); }