summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlevinse <levinse>2010-11-29 17:59:53 +0000
committerlevinse <levinse>2010-11-29 17:59:53 +0000
commit6997df0c2498bda94deeac4eee480af33135b9dd (patch)
treed2509ace72f00eb94a7fee6c86236a1c0362f4da
parentdc099447caf044996bf6aa9421c8a0ee2ce1dfe4 (diff)
Move valid order types and status into Ikano.pm
-rw-r--r--lib/Net/Ikano.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Net/Ikano.pm b/lib/Net/Ikano.pm
index 8b8ec76..ab62bf4 100644
--- a/lib/Net/Ikano.pm
+++ b/lib/Net/Ikano.pm
@@ -24,6 +24,10 @@ our $SCHEMA_ROOT = 'https://orders.value.net/osiriswebservice/schema/v1';
our $API_VERSION = "1.0";
+our @orderType = qw( NEW CANCEL CHANGE );
+
+our @orderStatus = qw( NEW PENDING CANCELLED COMPLETED ERROR );
+
our $AUTOLOAD;
=head1 SYNOPSIS
@@ -143,12 +147,10 @@ sub new {
sub req_ORDER {
my ($self, $args) = (shift, shift);
- my @validOrderTypes = qw( NEW CHANGE CANCEL );
-
return "invalid order data" unless defined $args->{orderType}
&& defined $args->{ProductCustomId} && defined $args->{DSLPhoneNumber};
return "invalid order type ".$args->{orderType}
- unless grep($_ eq $args->{orderType}, @validOrderTypes);
+ unless grep($_ eq $args->{orderType}, @orderType);
# XXX: rewrite this uglyness?
my @ignoreFields = qw( orderType ProductCustomId );