Class: Peddler::Client

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Jeff
Defined in:
lib/peddler/client.rb

Overview

An abstract client

Subclass this to implement an MWS API section.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Client

Creates a new client

Parameters:

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :aws_access_key_id (String)
  • :aws_secret_access_key (String)
  • :marketplace (String, Peddler::Marketplace)
  • :merchant_id (String)
  • :auth_token (String)


46
47
48
# File 'lib/peddler/client.rb', line 46

def initialize(opts = {})
  opts.each { |k, v| send("#{k}=", v) }
end

Instance Attribute Details

#auth_tokenString

Note:

You can omit this if you are accessing your own seller account

The MWS Auth Token for a seller’s account

Returns:

  • (String)


53
54
55
# File 'lib/peddler/client.rb', line 53

def auth_token
  @auth_token
end

#bodyString

The body of the HTTP request

Returns:

  • (String)


78
79
80
# File 'lib/peddler/client.rb', line 78

def body
  @body
end

#marketplacePeddler::Marketplace

Note:

You can pass the two-letter country code of the marketplace as shorthand when setting

The marketplace where you signed up as application developer

Returns:

  • (Peddler::Marketplace)


64
65
66
# File 'lib/peddler/client.rb', line 64

def marketplace
  @marketplace
end

#merchant_idString

Note:

Amazon also refers to this as Seller ID or Merchant Token

The seller’s Merchant ID

Returns:

  • (String)


58
59
60
# File 'lib/peddler/client.rb', line 58

def merchant_id
  @merchant_id
end