Class: Bankaccounts
Instance Attribute Summary
#api_hook
Instance Method Summary
collapse
#env, #errors?, #get_with_custom_url, #hash2json, #initialize, #json2hash, #post, #put
Instance Method Details
#all(customer_id) ⇒ Object
33
34
35
36
|
# File 'lib/openpay/bankaccounts.rb', line 33
def all(customer_id)
customers=@api_hook.create(:customers)
customers.all_bank_accounts(customer_id)
end
|
#create(bank_account, customer_id) ⇒ Object
5
6
7
8
|
# File 'lib/openpay/bankaccounts.rb', line 5
def create(bank_account,customer_id)
customers=@api_hook.create(:customers)
customers.create_bank_account(customer_id,bank_account)
end
|
#delete(customer_id, bank_account) ⇒ Object
21
22
23
24
|
# File 'lib/openpay/bankaccounts.rb', line 21
def delete(customer_id,bank_account)
customers=@api_hook.create(:customers)
customers.delete_bank_account(customer_id,bank_account)
end
|
#delete_all(customer_id) ⇒ Object
47
48
49
50
51
52
53
54
55
56
|
# File 'lib/openpay/bankaccounts.rb', line 47
def delete_all(customer_id)
if env == :production
raise OpenpayException.new('This method is not supported on PRODUCTION',false)
end
customers=@api_hook.create(:customers)
customers.delete_all_bank_accounts(customer_id)
end
|
#each(customer_id) ⇒ Object
26
27
28
29
30
31
|
# File 'lib/openpay/bankaccounts.rb', line 26
def each(customer_id)
customers=@api_hook.create(:customers)
customers.each_bank_account(customer_id) do |acc|
yield acc
end
end
|
#get(customer_id = '', bank_account = nil) ⇒ Object
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/openpay/bankaccounts.rb', line 10
def get(customer_id='',bank_account=nil)
customers=@api_hook.create(:customers)
if bank_account
customers.get_bank_account(customer_id,bank_account)
else
customers.get_bank_account(customer_id)
end
end
|
#list(search_params, customer_id = nil) ⇒ Object
38
39
40
41
42
43
44
45
|
# File 'lib/openpay/bankaccounts.rb', line 38
def list(search_params,customer_id=nil)
if customer_id
customers=@api_hook.create(:customers)
customers.list_bankaccounts(customer_id,search_params)
else
super search_params
end
end
|