summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlevinse <levinse>2010-12-09 20:22:16 +0000
committerlevinse <levinse>2010-12-09 20:22:16 +0000
commitbd49a99a7de4fb821643d5cf35aa358247c6f727 (patch)
tree049f5fa2773812ff008e7bf45e7ef69cbef55f7f
parent1b3dc909e39664cb33e743d8f3a285edffa41618 (diff)
fix Net::Ikano bug causing invalid response type error messages
-rw-r--r--lib/Net/Ikano.pm15
1 files changed, 4 insertions, 11 deletions
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);
}