Class: JeraPayment::Api::Iugu::Withdrawal

Inherits:
Base
  • Object
show all
Defined in:
lib/jera_payment/api/iugu/withdrawal.rb

Constant Summary collapse

BASE_ENDPOINT =
'withdraw_requests'

Class Method Summary collapse

Methods inherited from Base

delete, ensure_account_access_token, get, parse_response, post, put, set_headers

Class Method Details

.index(query = nil, access_token = nil) ⇒ Object



13
14
15
# File 'lib/jera_payment/api/iugu/withdrawal.rb', line 13

def self.index(query = nil, access_token = nil)
  response = get(BASE_ENDPOINT, query, access_token)
end

.request_withdrawal(id, body = {}, access_token = nil) ⇒ Object



7
8
9
10
11
# File 'lib/jera_payment/api/iugu/withdrawal.rb', line 7

def self.request_withdrawal(id, body = {}, access_token = nil)
  url = "accounts/#{id}/request_withdraw"

  response = post(url, body, access_token)
end

.show(id, access_token = nil) ⇒ Object



17
18
19
20
21
# File 'lib/jera_payment/api/iugu/withdrawal.rb', line 17

def self.show(id, access_token = nil)
  url = "#{BASE_ENDPOINT}/#{id}"

  response = get(url, nil, access_token)
end