Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated for modern times #6

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
95d6cff
Signature, tracing, endpoint fix
amaltsev Nov 6, 2012
2b6aa49
Bug fix for ManageReportSchedule
amaltsev Nov 6, 2012
ebbcc49
Version bump for require
amaltsev Nov 6, 2012
b6fbc92
Changed report ID to a string
amaltsev Nov 7, 2012
f9926a7
Primitive auto-throttling
amaltsev Nov 7, 2012
555f189
Added payment settlement report types
amaltsev Nov 7, 2012
15801ca
cleaned up some perl packaging and git ignores.
Nov 21, 2012
80f4929
Merge remote-tracking branch 'amaltsev/master' into amaltsev
Nov 21, 2012
c29cd1c
add ItemCondition enumeration. change Merchant to SellerId. update AP…
Nov 23, 2012
c3cb679
add eclipse files to gitignore.
Nov 25, 2012
66b4758
bump version 0.3.
Nov 25, 2012
0383d0e
add example code to request lowest Product offers.
Nov 25, 2012
d40e744
add proper throttling for GetLowestOfferListingsForSKU. force arrays for
Nov 28, 2012
9ac35dc
Add IdType enumeration, GetMatchingProductForId Products API call (not
Nov 28, 2012
6e756eb
Updated to work with modern MWS API; added methods
Aug 16, 2013
98f3b48
Added method, added param to another.
Aug 20, 2013
b2ea244
merged with bpuklich fork
Aug 20, 2013
04fc8e3
Left a couple of merge artifacts in. oops.
Aug 20, 2013
502cb9b
MarketplaceId is now required for all methods
Aug 20, 2013
e7d4bd7
Fixed ListOrders
Aug 20, 2013
c9bfb0d
Added CONTRIBUTORS section to pod
Aug 20, 2013
3cd1cc5
ListOrders handles single order correctly
Aug 21, 2013
4fa51f7
Revert "ListOrders handles single order correctly"
Aug 21, 2013
155daf3
ListOrders correctly handles single order
Aug 21, 2013
02a954b
fixed typo
Aug 21, 2013
d5542d5
Now correctly handles the case of no orders
Aug 22, 2013
3546a18
Fixed ListOrderItems return
Sep 3, 2013
6a76ee9
Changed version to just 0.5
Sep 3, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/.idea
/_build
META.*
MYMETA.*
Build
*.bak
*.tar.gz
MANIFEST
blib/
/.project
/.includepath
/.settings
2 changes: 1 addition & 1 deletion Build.PL
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ my $build = Module::Build->new(

'MIME::Base64' => 0,
'Digest::MD5' => 0,
'Digest::HMAC_SHA1' => 0,
'Digest::SHA' => 0,
},
);

Expand Down
Empty file added INSTALL
Empty file.
20 changes: 20 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Build.PL
examples/download-FBA-fulfillment-report.pl
examples/get-lowest-offer.pl
examples/request-FBA-fulfillment-report.pl
INSTALL
lib/Amazon/MWS/Client.pm
lib/Amazon/MWS/Enumeration.pm
lib/Amazon/MWS/Enumeration/FeedProcessingStatus.pm
lib/Amazon/MWS/Enumeration/FeedType.pm
lib/Amazon/MWS/Enumeration/IdType.pm
lib/Amazon/MWS/Enumeration/ItemCondition.pm
lib/Amazon/MWS/Enumeration/ReportProcessingStatus.pm
lib/Amazon/MWS/Enumeration/ReportType.pm
lib/Amazon/MWS/Enumeration/Schedule.pm
lib/Amazon/MWS/TypeMap.pm
MANIFEST This list of files
MANIFEST.SKIP
README
t/enumeration.t
t/SubmitFeed.t
10 changes: 10 additions & 0 deletions MANIFEST.SKIP
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,20 @@
\.#
\.rej$

# Avoid IDE files/dirs
\B\.idea
\B\.includepath
\B\.project
\B\.settings

# Avoid OS-specific files/dirs
# Mac OSX metadata
\B\.DS_Store
# Mac OSX SMB mount metadata files
\B\._
# Avoid archives of this distribution
\bAmazon-MWS-[\d\.\_]+
^MYMETA\.yml$
^MYMETA\.json$
^META\.yml$
^META\.json$
Empty file added README
Empty file.
42 changes: 42 additions & 0 deletions examples/get-lowest-offer.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

use strict;

use Amazon::MWS::Enumeration::ItemCondition qw(:all);
use Amazon::MWS::Client;
use DateTime;
use Data::Dumper;

my $mws = Amazon::MWS::Client->new(access_key_id=>"XXX",
secret_key => "YYY",
seller_id => "ZZZ",
marketplace_id => "VVV");

my @skus = qw(1234 2345 3456 4567 5678);

my $req;

eval {
$req = $mws->GetLowestOfferListingsForSKU(SellerSKUList => \@skus, ItemCondition => New, ExcludeMe => 1);
};

if(my $e = Exception::Class->caught('Amazon::MWS::Client::Exception')) {
die $e->error . "\n" . $e->trace->as_string . "\n";
}
elsif($@) {
die $@;
}

sub process_product {
my $product = shift;
my $lowest;
foreach my $offer (@{$product->{Product}->{LowestOfferListings}->{LowestOfferListing}}) {
if (!defined($lowest) || $offer->{Price}->{LandedPrice}->{Amount} > 0 && $offer->{Price}->{LandedPrice}->{Amount} < $lowest) {
$lowest = $offer->{Price}->{LandedPrice}->{Amount} ;
}
}
print $product->{SellerSKU}." lowest price ".$lowest."\n";
}

foreach my $product (@$req) {
process_product($product);
}
15 changes: 13 additions & 2 deletions examples/request-FBA-fulfillment-report.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use strict;

use Amazon::MWS::Enumeration::ReportType qw(:all);
use Amazon::MWS::Client;
use DateTime;

Expand All @@ -10,12 +11,22 @@
merchant_id => "ZZZ",
marketplace_id => "VVV");

my $req = $mws->RequestReport(ReportType => '_GET_AMAZON_FULFILLED_SHIPMENTS_DATA_',
my $req;

eval {
$req = $mws->RequestReport(ReportType => (_GET_AMAZON_FULFILLED_SHIPMENTS_DATA_),
StartDate => DateTime->now->add(weeks => -1),
EndDate => DateTime->now);
};

if(my $e = Exception::Class->caught('Amazon::MWS::Client::Exception')) {
die $e->error . "\n" . $e->trace->as_string . "\n";
}
elsif($@) {
die $@;
}

if (my $req_id = $req->{ReportRequestInfo}->[0]->{ReportRequestId}) {
open my $req, "> request.${req_id}";
close $req;
}

Loading