Class: JeraPayment::Api::Iugu::SubAccount

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

Constant Summary collapse

BASE_ENDPOINT =
'accounts'

Class Method Summary collapse

Methods inherited from Base

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

Class Method Details

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



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

def self.create(body = {}, access_token = nil)
  url = 'marketplace/create_account'

  response = post(url, body, access_token)
end

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



31
32
33
34
35
# File 'lib/jera_payment/api/iugu/sub_account.rb', line 31

def self.list_accounts(query = nil, access_token = nil)
  url = 'marketplace'

  response = get(url, query, access_token)
end

.show(id, access_token = nil) ⇒ Object



25
26
27
28
29
# File 'lib/jera_payment/api/iugu/sub_account.rb', line 25

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

  response = get(url, nil, access_token)
end

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



13
14
15
16
17
# File 'lib/jera_payment/api/iugu/sub_account.rb', line 13

def self.update(body = {}, access_token = nil)
  url = "#{BASE_ENDPOINT}/configuration"

  response = post(url, body, access_token)
end

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



19
20
21
22
23
# File 'lib/jera_payment/api/iugu/sub_account.rb', line 19

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

  response = post(url, body, access_token)
end