Class: AmazonPay::AmazonInStoreClient

Inherits:
AmazonPayClient show all
Defined in:
lib/amazon_pay/amazon_in_store_client.rb

Overview

Class for Amazon Web Store

Instance Method Summary collapse

Methods inherited from AmazonPayClient

#api_call, #delivery_trackers, #generate_button_signature, #get_authorization_token, #get_signed_headers

Constructor Details

#initialize(config_args) ⇒ AmazonInStoreClient

Returns a new instance of AmazonInStoreClient.



4
5
6
# File 'lib/amazon_pay/amazon_in_store_client.rb', line 4

def initialize(config_args)
  super(config_args)
end

Instance Method Details

#charge(payload: nil, headers: nil) ⇒ Object

API to create Charge to the buyer

- Creates a charge to the buyer with the requested amount.

Parameters:

  • payload (Hash) (defaults to: nil)
    • The payload for the request

  • [headers=nil] (Hash)
    • The headers for the request

See Also:

  • Update Live URL


29
30
31
32
33
34
35
36
# File 'lib/amazon_pay/amazon_in_store_client.rb', line 29

def charge(payload: nil, headers: nil)
  api_call(options: {
             method: 'POST',
             url_fragment: 'in-store/charge',
             payload: payload,
             headers: headers
           })
end

#merchant_scan(payload: nil, headers: nil) ⇒ Object

API to initiate a purchase with a merchant

- Initiates a purchase with a merchant.

Parameters:

  • payload (Hash) (defaults to: nil)
    • The payload for the request

  • [headers=nil] (Hash)
    • The headers for the request

See Also:

  • Update Live URL


14
15
16
17
18
19
20
21
# File 'lib/amazon_pay/amazon_in_store_client.rb', line 14

def merchant_scan(payload: nil, headers: nil)
  api_call(options: {
             method: 'POST',
             url_fragment: 'in-store/merchantScan',
             payload: payload,
             headers: headers
           })
end

#refund(payload: nil, headers: nil) ⇒ Object

API to create a Refund to the buyer

- Refunds an amount that was previously charged to the buyer.

Parameters:

  • payload (Hash) (defaults to: nil)
    • The payload for the request

  • [headers=nil] (Hash)
    • The headers for the request

See Also:

  • Update Live URL


44
45
46
47
48
49
50
51
# File 'lib/amazon_pay/amazon_in_store_client.rb', line 44

def refund(payload: nil, headers: nil)
  api_call(options: {
             method: 'POST',
             url_fragment: 'in-store/refund',
             payload: payload,
             headers: headers
           })
end