Move valid order types and status into Ikano.pm
authorlevinse <levinse>
Mon, 29 Nov 2010 17:59:53 +0000 (17:59 +0000)
committerlevinse <levinse>
Mon, 29 Nov 2010 17:59:53 +0000 (17:59 +0000)
lib/Net/Ikano.pm

index 8b8ec76..ab62bf4 100644 (file)
@@ -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 );