Last active
August 29, 2015 13:57
-
-
Save hakanensari/9463555 to your computer and use it in GitHub Desktop.
Minimal Ruby interface for the Amazon MWS API
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
require 'jeff' | |
module MWS | |
class Request | |
include Jeff | |
HOSTS = { | |
'A2EUQ1WTGCTBG2' => 'mws.amazonservices.ca', | |
'AAHKV2X7AFYLW' => 'mws.amazonservices.com.cn', | |
'A1PA6795UKMFR9' => 'mws-eu.amazonservices.com', | |
'A1RKKUPIHCS9HS' => 'mws-eu.amazonservices.com', | |
'A13V1IB3VIYZZH' => 'mws-eu.amazonservices.com', | |
'A1F83G8C2ARO7P' => 'mws-eu.amazonservices.com', | |
'A21TJRUUN4KGV' => 'mws.amazonservices.in', | |
'APJ6JRA9NG5V4' => 'mws-eu.amazonservices.com', | |
'A1VC38T7YXB528' => 'mws.amazonservices.jp', | |
'ATVPDKIKX0DER' => 'mws.amazonservices.com' | |
} | |
params('SellerId' => -> { merchant_id }) | |
attr_accessor :marketplace_id, :merchant_id | |
def aws_endpoint | |
"https://#{HOSTS.fetch(marketplace_id)}" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment