Business::PostNL - Calculate Dutch (PostNL) shipping costs
use Business::PostNL; my $tnt = Business::PostNL->new(); $tnt->country('DE'); $tnt->weight('534'); $tnt->large(1); $tnt->tracktrace(1); $tnt->register(1); my $costs = $tnt->calculate or die $Business::PostNL::ERROR;
or
use Business::PostNL; my $tnt = Business::PostNL->new(); my $costs = $tnt->calculate( country =>'DE', weight => 534, large => 1, tracktrace => 1, register => 1, ) or die $Business::PostNL::ERROR;
This module calculates the shipping costs for the Dutch PostNL, based on country, and weight etc.
The shipping cost information is based on 'Posttarieven Per januari 2014'.
It returns the shipping costs in euro or undef (which usually means the parcel is heavier than the maximum allowed weight; check $Business::PostNL::ERROR).
$Business::PostNL::ERROR
The following methods can be used
new creates a new Business::PostNL object. No more, no less.
new
Business::PostNL
Sets the country (ISO 3166, 2-letter country code) and returns the zone number used by PostNL (or 0 for The Netherlands (NL)).
This value is mandatory for the calculations.
Note that the reserved IC has been used for the Canary Islands. This has not been adopted by ISO 3166 yet. The Channel Islands are completely ignored due to a lack of a code.
Method to calculate the actual shipping cost based on the input (see methods above). These options can also be passed straight in to this method (see SYNOPSIS).
Two settings are mandatory: country and weight. The rest are given a default value that will be used unless told otherwise.
Returns the shipping costs in euro, or undef (see $Business::PostNL::ERROR in that case).
Internal method to create the path to walk through the pricing table. Don't call this, use calculate instead.
Blame merlyn for this internal method. It's using List::Util to "grep" the information needed.
Don't call this, use calculate instead.
Sets and/or returns the weight of the parcel in question in grams.
Sets and/or returns the value of this option. Defaults to undef (meaning: the package will fit through the mail slot).
PostNL still requires you to put a priority sticker on your letters and parcels, but this seems to be solely for speed of delivery. I couldn't find any price difference, hence this setting is ignored from now on and only here for backwards compatability.
Sets and/or returns the value of this options. Defaults to undef (meaning: no track & trace feature wanted). When a parcel destined for abroad weighs over 2 kilograms, default is 1, while over 2kg it's not even optional anymore.
Sets and/or returns the value of this options. Defaults to undef (meaning: parcel is not registered (Dutch: aangetekend)).
No longer an option, solely here for backwards compatibility.
Sets and/or returns the value of this options. Defaults to undef (meaning: stamps will be used, not the machine (Dutch: frankeermachine)).
Only interesting for destinies within NL. Note that "Pakketzegel AVP" and "Easystamp" should also use this option.
Please do report bugs/patches to http://rt.cpan.org/Public/Dist/Display.html?Name=Business-PostNL
The Dutch postal agency (PostNL) uses many, many, many various ways for you to ship your parcels. Some of them are included in this module, but a lot of them not (maybe in the future? Feel free to patch ;-)
Menno Blom, <blom@cpan.org>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
http://www.postnl.nl/, http://www.postnl.nl/zakelijk/Images/Tarievenkaart-januari-2014-PostNL_tcm210-681029.PDF, http://www.iso.org/iso/en/prods-services/iso3166ma/index.html
To install Business::PostNL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Business::PostNL
CPAN shell
perl -MCPAN -e shell install Business::PostNL
For more information on module installation, please visit the detailed CPAN module installation guide.