Class: PayWithAmazon::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/pay_with_amazon/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) ⇒ Request

Returns a new instance of Request.



15
16
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
# File 'lib/pay_with_amazon/request.rb', line 15

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)

  @parameters = parameters
  @optional = optional
  @default_hash = default_hash
  @mws_endpoint = mws_endpoint
  @sandbox_str = sandbox_str
  @secret_key = secret_key
  @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
end

Instance Method Details

#send_postObject

This method sends the post request.



46
47
48
49
# File 'lib/pay_with_amazon/request.rb', line 46

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