Class: AmazonPay::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/amazon_pay/request.rb

Overview

This class creates the request to send to the specified MWS endpoint.

Constant Summary collapse

MAX_RETRIES =
3

Instance Method Summary collapse

Constructor Details

#initialize(parameters, optional, default_hash, mws_endpoint, sandbox_str, secret_key, proxy_addr, proxy_port, proxy_user, proxy_pass, throttle, application_name, application_version, log_enabled, log_file_name, log_level) ⇒ Request

Returns a new instance of Request.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/amazon_pay/request.rb', line 17

def initialize(
  parameters,
  optional,
  default_hash,
  mws_endpoint,
  sandbox_str,
  secret_key,
  proxy_addr,
  proxy_port,
  proxy_user,
  proxy_pass,
  throttle,
  application_name,
  application_version,
  log_enabled,
  log_file_name,
  log_level
)

  @parameters = parameters
  @optional = optional
  @default_hash = default_hash
  @mws_endpoint = mws_endpoint
  @sandbox_str = sandbox_str
  @secret_key = secret_key
  @log_enabled = log_enabled
  @proxy_addr = proxy_addr
  @proxy_port = proxy_port
  @proxy_user = proxy_user
  @proxy_pass = proxy_pass
  @throttle = throttle
  @application_name = application_name
  @application_version = application_version

  @logger = AmazonPay::LogInitializer.new(log_file_name, log_level).create_logger if @log_enabled
end

Instance Method Details

#send_postObject

This method sends the post request.



55
56
57
58
# File 'lib/amazon_pay/request.rb', line 55

def send_post
  post_url = build_post_url
  post(@mws_endpoint, @sandbox_str, post_url)
end