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)


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

def api_key
  @api_key
end

#passwordObject

Your merchant account's password


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

def password
  @password
end

#usernameObject

The username used to log into your merchant account


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

def username
  @username
end

Instance Method Details

#auth_typeObject


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

def auth_type
  :none
end

#bodyObject


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

def body
  { access_token: to_hash }
end

#response_from_hash(hash) ⇒ Object


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

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