-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
197 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,8 @@ | ||
version 0.0400 - October 25, 2012 | ||
* Now an interface to the Box Calc web service. | ||
|
||
version 0.0301 - October 18, 2012 | ||
* Optimizations adding up to over 500% faster performance. | ||
|
||
version 0.0300 - October 18, 2012 | ||
* Removed extraneous file. | ||
* Renamed packing_list to packing_instructions | ||
* Added new packing_list function that produces a more useful, smaller, and faster dataset. | ||
* Added category filtering of box types. | ||
|
||
version 0.0201 - October 14, 2012 | ||
* Decided not to keep it as a public module for now. | ||
* Add max item size to "no box fits" exception. | ||
* Sorting for max item sizes was backwards. | ||
version 0.0500 - October 27, 2012 | ||
* NOT backwards compatible. | ||
* Now works asynchronously. | ||
* Add SSL to web service. | ||
* Add shipping_options method which returns USPS postage rate calculations. | ||
|
||
version 0.0200 - October 11, 2012 | ||
* Add the weight of each box to the packing_list output. | ||
|
||
version 0.0101 - October 10, 2012 (10 minutes later) | ||
* Remove test diags and replace them with notes. | ||
* Added a description of how the algorithm works. | ||
|
||
version 0.0100 - October 10, 2012 | ||
|
||
* Initial release. | ||
version 0.0400 - October 25, 2012 | ||
* First public release to web service. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
use strict; | ||
use Test::More; | ||
use lib '../lib'; | ||
use_ok 'Box::Calc'; | ||
|
||
note "API Key: $ENV{BOX_CALC_API_KEY}"; | ||
my $calc = Box::Calc->new(api_key => $ENV{BOX_CALC_API_KEY}); | ||
|
||
isa_ok $calc, 'Box::Calc'; | ||
$calc->add_box_type( | ||
name => 'A', | ||
weight => 20, | ||
x => 5, | ||
y => 10, | ||
z => 8, | ||
compatible_services => ['USPS First-Class', 'USPS Parcel Post', 'USPS Priority Medium Flat Rate Box'], | ||
); | ||
$calc->add_box_type( | ||
name => 'B', | ||
weight => 7, | ||
x => 4, | ||
y => 6, | ||
z => 2, | ||
compatible_services => ['USPS Priority Medium Flat Rate Box', 'USPS Priority'], | ||
); | ||
$calc->add_item( | ||
quantity => 5, | ||
name => 'Banana', | ||
weight => 5, | ||
x => 3, | ||
y => 1, | ||
z => 4.5, | ||
); | ||
|
||
my $options = $calc->shipping_options(from => 53716, to => 90210)->recv; | ||
|
||
is ref $options, 'HASH', 'got a list back'; | ||
is $options->{'USPS Parcel Post'}{parcels}[0]{name}, 'A', 'box A as it should be'; | ||
ok ! exists $options->{'USPS First-Class'} , 'too big for first class'; | ||
|
||
|
||
done_testing(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters