Class: IletimerkeziSdk::Services::AccountService

Inherits:
Object
  • Object
show all
Defined in:
lib/iletimerkezi_sdk/services/account_service.rb

Instance Method Summary collapse

Constructor Details

#initialize(http_client, api_key, api_hash) ⇒ AccountService

Returns a new instance of AccountService.



4
5
6
7
8
# File 'lib/iletimerkezi_sdk/services/account_service.rb', line 4

def initialize(http_client, api_key, api_hash)
  @http_client = http_client
  @api_key = api_key
  @api_hash = api_hash
end

Instance Method Details

#balanceObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/iletimerkezi_sdk/services/account_service.rb', line 10

def balance
  payload = {
    request: {
      authentication: {
        key: @api_key,
        hash: @api_hash
      }
    }
  }
  
  response = @http_client.post('get-balance/json', json: payload)

  Responses::AccountResponse.new(response[:body], response[:status])
end