NAME

Shipment::Temando

VERSION

version 2.00

SYNOPSIS

use Shipment::Temando;
use Shipment::Address;
use Shipment::Package;

my $shipment = Shipment::Temando->new(
  from_address => Shipment::Address->new( ... ),
  to_address => Shipment::Address->new( ... ),
  packages => [ Shipment::Pacjage->new( ... ), ],
);

foreach my $service ( $shipment->all_services ) {
  print $service->id . " (" . $service->cost . ")\n";
}

$shipment->rate( 'Service Name' );
print $shipment->service->cost . "\n";

$shipment->ship( $service->id );
$shipment->get_package(0)->label->save;

NAME

Shipment::Temando - Interface to Temando Shipping Web Services

ABOUT

This class provides an interface to the Temando Web Services API. You must sign up for an API account with Temando in order to make use of ths module.

http://www.temando.com/affiliateRegistration2.html

It is an extension of Shipment::Base

It makes extensive use of SOAP::WSDL in order to create/decode xml requests and responses. The Shipment::Temando::WSDL interface was created primarily using the wsdl2perl.pl script from SOAP::WSDL.

Class Attributes

user, password, client_id

Credentials required to access the Temando API.

live

This determines whether you will use the Temando training web service (for development) or the production web service (live)

class, subclass

These define the type of shipment.

Currently the default (and only supported) options are class="General Goods" and subclass="Household Goods". This should be sane defaults for most shipments.

Temando supports many other options here including Freight (pallets, containers, etc) and Vehicles.

request_id

The Temando request id

This will be set upon a successful call to "ship"

It can also be set before a call to "cancel"

type: String

comments

Additional comments about the shipment

type: String

credit_card_type, credit_card_expiry, credit_card_number, credit_card_name

Temando accepts payment by credit card

credit_card_type can be one of 'Visa' or 'MasterCard'

credit_card_expiry must be in the format '02-2013'

Shipment::Base type maps

Shipment::Base provides abstract types which need to be mapped to Temando (i.e. package_type of "envelope" maps to Temando "Document Envelope")

custom package types

Temando provides package types in addition to the defaults in Shipment::Base

printer types

Temando does not offer true thermal printing, all labels are provided as documents (pdf, doc, or xls), thermal labels are simply a 4x6 documents.

default currency

The default currency is AUD

Class Methods

_build_services

This calls getQuotesByRequest from the Temando API

Each Quote that is returned is added to services

The following service mapping is used: * ground => cheapest where <usingGeneralRoad> * express => cheapest where <usingExpressRoad> * priority => cheapest where <usingExpressAir>

rate

This method sets $self->service to $self->services{$service_id}

ship

This method calls makeBookingByRequest from the Temando API

All labels are available in $self->documents

The consignment document is available in $self->manifest

cancel

This method calls cancelRequest from the Temando API

It uses $self->request_id to identify the request to be cancelled

returns "Cancelled" if successful,

AUTHOR

Andrew Baerg @ <andrew at pullingshots dot ca>

http://pullingshots.ca/

ACKNOWLEDGEMENTS

SiteSuite Australasia (http://www.sitesuite.com.au/) commissioned and paid for the development of this module

BUGS

Please contact me directly.

COPYRIGHT

Copyright (C) 2012 Andrew J Baerg, All Rights Reserved

NO WARRANTY

Absolutely, positively NO WARRANTY, neither express or implied, is offered with this software. You use this software at your own risk. In case of loss, no person or entity owes you anything whatsoever. You have been warned.

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Andrew Baerg <baergaj@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Andrew Baerg.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.