NAME

WebService::Eulerian::Analytics::Website::Order - access to the Order service for a given website

DESCRIPTION

This module allow you to access the Order service holding information about all the orders generated by the given website.

SYNOPSIS

use WebService::Eulerian::Analytics::Website::Order;
#
my $api = new WebService::Eulerian::Analytics::Website::Order(
 apikey	=> 'THE KEY PROVIDED BY YOUR ACCOUNT MANAGER FOR API ACCESS',
 host	=> 'THE HOST ON WHICH THE API IS HOSTED'
);

METHODS

replay : replay an order at a given time and inject it in Eulerian Analytics (in direct access channel) with detailled information.

input

  • hash reference with the following parameters :

    o reference : order reference, mandatory and must be unique for the website

    o amount : amount of the order, mandatory and must be a number

    o epoch : date at which the order was made, mandatory and the format muse be epoch time

    o type : type of the order, it's a string describing the type of the order, it's optionnal (retail, holiday, flight, vacation, etc ...)

    o payment : type of the order, it's a string describing the type of the payment, it's optionnal (creditcard, check, wire, etc ...)

output

  • $order_id if everything is fine, otherwise 0 and check fault method

sample

my $order_id = $api->replay( $my_website_id, {
 reference	=> 'ORDER_REFERENCE_TO_REPLAYED',
 amount		=> 'ORDER_AMOUNT',
 epoch		=> 'ORDER_DATE_IN_EPOCH_FORMAT',
 type		=> 'ORDER_TYPE',
 payment	=> 'ORDER_PAYMENT',
});
#
if ( $api->fault ) {
 die $api->faultstring();
}
#
print "Order id following successfull replay : $order_id\n";

METHODS

search : generate a search method on the order database.

input

  • id of the website

  • hash reference with the following parameters :

    o order-from-epoch : from epoch date

    o order-to-epoch : to epoch date

    o order-from : from date (dd/mm/yyyy)

    o order-to : to date (dd/mm/yyyy)

    o order-ref : order reference

output

  • total : total number of orders for given search

  • result : array ref of hash ref for each order

sample

my $rh_order = $api->search( $my_website_id, {
 'order-ref'	=> 'XXXXXXX'
});
#
if ( $api->fault ) {
 die $api->faultstring();
}
#
for ( @{ $rh_order->{result} } ) {
 print "Order ref : ".$_->{order_ref}." at ".localtime($_->{order_date})."\n";
}

METHODS

valid : validate a list of orders

input

  • id of the website

  • array of order references to validate

output

  • totalerror : total number of errors

  • totaltotreat : total number of reference to treat

  • totaltreated : total number of treated references

  • result : array ref of hash ref for each order

sample

my $rh_order = $api->valid( $my_website_id, 'XXXXX', 'YYYYY');
#
if ( $api->fault ) {
 die $api->faultstring();
}
#
for ( @{ $rh_order->{result} } ) {
 print "Order ref : ".$_->{order_ref}." at ".localtime($_->{order_date})."\n";
}

METHODS

cancel : cancel a list of orders

input

  • id of the website

  • array of order references to cancel

output

  • totalerror : total number of errors

  • totaltotreat : total number of reference to treat

  • totaltreated : total number of treated references

  • result : array ref of hash ref for each order

sample

my $rh_order = $api->cancel( $my_website_id, 'XXXXX', 'YYYYY');
#
if ( $api->fault ) {
 die $api->faultstring();
}
#
for ( @{ $rh_order->{result} } ) {
 print "Order ref : ".$_->{order_ref}." at ".localtime($_->{order_date})."\n";
}

SEE ALSO

WebService::Eulerian::Analytics

AUTHOR

Mathieu Jondet <mathieu@eulerian.com>

COPYRIGHT

Copyright (c) 2008 Eulerian Technologies Ltd http://www.eulerian.com

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA