Class: Levelup::Requests::AuthenticateMerchant

Inherits:
Base show all
Defined in:
lib/levelup/requests/authenticate_merchant.rb

Overview

Represents a request to generate a merchant access token.

Constant Summary

Constants inherited from Base

Base::ALLOWED_REQUEST_METHODS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#headers, instance_variables_excluded_from_hash, #send_to_api

Methods inherited from Templates::DataParcel

excluded?, #initialize, instance_variables_excluded_from_hash

Constructor Details

This class inherits a constructor from Levelup::Templates::DataParcel

Instance Attribute Details

#api_keyObject

Your merchant’s API key (accepts app API key as well)



7
8
9
# File 'lib/levelup/requests/authenticate_merchant.rb', line 7

def api_key
  @api_key
end

#passwordObject

Your merchant account’s password



11
12
13
# File 'lib/levelup/requests/authenticate_merchant.rb', line 11

def password
  @password
end

#usernameObject

The username used to log into your merchant account



9
10
11
# File 'lib/levelup/requests/authenticate_merchant.rb', line 9

def username
  @username
end

Instance Method Details

#auth_typeObject



13
14
15
# File 'lib/levelup/requests/authenticate_merchant.rb', line 13

def auth_type
  :none
end

#bodyObject



17
18
19
# File 'lib/levelup/requests/authenticate_merchant.rb', line 17

def body
  { access_token: to_hash }
end

#response_from_hash(hash) ⇒ Object



21
22
23
# File 'lib/levelup/requests/authenticate_merchant.rb', line 21

def response_from_hash(hash)
  Responses::Success.new(hash['access_token'])
end