4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/amazon/mws/authentication/query_string.rb', line 4
def initialize(params = {})
query_params = {
'AWSAccessKeyId' => params[:access_key],
'SignatureMethod' => Signature::METHOD,
'SignatureVersion' => Signature::VERSION,
'Timestamp' => Time.now.iso8601
}
if params[:path].include? 'Orders'
query_params['SellerId'] = params[:merchant_id]
query_params['Version'] = Amazon::MWS::Authentication::ORDERS_VERSION
elsif params[:path].include? 'Products'
query_params['SellerId'] = params[:merchant_id]
query_params['Version'] = Amazon::MWS::Authentication::PRODUCTS_VERSION
else
query_params['Merchant'] = params[:merchant_id]
query_params['Version'] = Amazon::MWS::Authentication::VERSION
end
query_params = query_params.merge(params[:query_params] || {})
query_params['Signature'] = Signature.new(query_params, params)
self << formatted_querystring(query_params)
end
|