Class: Adyen::AccountHoldersApi
- Defined in:
- lib/adyen/services/balancePlatform/account_holders_api.rb
Instance Attribute Summary collapse
-
#service ⇒ Object
Returns the value of attribute service.
-
#version ⇒ Object
Returns the value of attribute version.
Attributes inherited from Service
Instance Method Summary collapse
- #create_account_holder(request, headers: {}) ⇒ Object
- #get_account_holder(id, headers: {}) ⇒ Object
- #get_all_balance_accounts_of_account_holder(id, headers: {}, queryParams: {}) ⇒ Object
-
#initialize(client, version = DEFAULT_VERSION) ⇒ AccountHoldersApi
constructor
A new instance of AccountHoldersApi.
- #update_account_holder(request, id, headers: {}) ⇒ Object
Methods inherited from Service
Constructor Details
#initialize(client, version = DEFAULT_VERSION) ⇒ AccountHoldersApi
Returns a new instance of AccountHoldersApi.
8 9 10 11 12 |
# File 'lib/adyen/services/balancePlatform/account_holders_api.rb', line 8 def initialize(client, version = DEFAULT_VERSION) @service = "BalancePlatform" @client = client @version = version end |
Instance Attribute Details
#service ⇒ Object
Returns the value of attribute service.
6 7 8 |
# File 'lib/adyen/services/balancePlatform/account_holders_api.rb', line 6 def service @service end |
#version ⇒ Object
Returns the value of attribute version.
6 7 8 |
# File 'lib/adyen/services/balancePlatform/account_holders_api.rb', line 6 def version @version end |
Instance Method Details
#create_account_holder(request, headers: {}) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/adyen/services/balancePlatform/account_holders_api.rb', line 50 def create_account_holder(request, headers: {} ) """ Create an account holder """ endpoint = "/accountHolders".gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(/^\//, "") endpoint = endpoint % [] action = { method: "post", url: endpoint} @client.call_adyen_api(@service, action, request, headers, @version) end |
#get_account_holder(id, headers: {}) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/adyen/services/balancePlatform/account_holders_api.rb', line 14 def get_account_holder(id, headers: {} ) """ Get an account holder """ endpoint = "/accountHolders/{id}".gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(/^\//, "") endpoint = endpoint % [id] action = { method: "get", url: endpoint} @client.call_adyen_api(@service, action, {}, headers, @version) end |
#get_all_balance_accounts_of_account_holder(id, headers: {}, queryParams: {}) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/adyen/services/balancePlatform/account_holders_api.rb', line 26 def get_all_balance_accounts_of_account_holder(id, headers: {} , queryParams: {}) """ Get all balance accounts of an account holder """ endpoint = "/accountHolders/{id}/balanceAccounts".gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(/^\//, "") endpoint = endpoint % [id] endpoint = endpoint + create_query_string(queryParams) action = { method: "get", url: endpoint} @client.call_adyen_api(@service, action, {}, headers, @version) end |
#update_account_holder(request, id, headers: {}) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/adyen/services/balancePlatform/account_holders_api.rb', line 38 def update_account_holder(request, id, headers: {} ) """ Update an account holder """ endpoint = "/accountHolders/{id}".gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(/^\//, "") endpoint = endpoint % [id] action = { method: "patch", url: endpoint} @client.call_adyen_api(@service, action, request, headers, @version) end |