Class: Mpayer::Account

Inherits:
Base
  • Object
show all
Defined in:
lib/mpayer/account.rb

Instance Attribute Summary

Attributes inherited from Base

#base_url, #mpayer_token, #user_no

Instance Method Summary collapse

Methods inherited from Base

#auth, #delete, #get, #initialize, #parse_api_response, #post, #put

Constructor Details

This class inherits a constructor from Mpayer::Base

Instance Method Details

#allObject

GET /accounts/all_accounts.json



5
6
7
# File 'lib/mpayer/account.rb', line 5

def all
	get('/accounts/all_accounts.json')
end

#balance(id) ⇒ Object

GET /accounts/:id



23
24
25
# File 'lib/mpayer/account.rb', line 23

def balance(id)
	(id)['balance'].to_f
end

#enroll(account_id, json_body) ⇒ Object

POST /accounts/:account_id/enroll



35
36
37
# File 'lib/mpayer/account.rb', line 35

def enroll(, json_body)
	post("/accounts/#{}/enroll", json_body)
end

#fetch_account(id) ⇒ Object

GET /accounts/:id



17
18
19
# File 'lib/mpayer/account.rb', line 17

def (id)
	get("/accounts/#{id}.json")
end

#fetch_by_ids(*ids) ⇒ Object

GET /accounts/all_accounts?accounts_array=#Mpayer::Account.idsids.join(‘,’)



11
12
13
# File 'lib/mpayer/account.rb', line 11

def fetch_by_ids(*ids)
  get("/accounts/all_accounts?accounts_array=#{ids.join(',')}")
end

#subscribers(account_id) ⇒ Object

GET /accounts/:account_id/members?per_page=100



29
30
31
# File 'lib/mpayer/account.rb', line 29

def subscribers()
	get("/accounts/#{}/members?")
end