projects
/
Net-Ikano.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1b3dc90
)
fix Net::Ikano bug causing invalid response type error messages
author
levinse
<levinse>
Thu, 9 Dec 2010 20:22:16 +0000
(20:22 +0000)
committer
levinse
<levinse>
Thu, 9 Dec 2010 20:22:16 +0000
(20:22 +0000)
lib/Net/Ikano.pm
patch
|
blob
|
history
diff --git
a/lib/Net/Ikano.pm
b/lib/Net/Ikano.pm
index
40eb7d8
..
cdf7e39
100644
(file)
--- a/
lib/Net/Ikano.pm
+++ b/
lib/Net/Ikano.pm
@@
-350,18
+350,11
@@
sub AUTOLOAD {
. $resphash->{FailureResponse}->{FailureMessage}
if $resphash->{type} eq 'FAILURE';
. $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"
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);
}
return $self->$respsub($resphash,$reqhash);
}