Module: MangoApi::BankAccounts
- Extended by:
- UriProvider
- Defined in:
- lib/mangopay/api/service/bank_accounts.rb
Overview
Provides API method delegates concerning the BankAccount
entity
Class Method Summary collapse
-
.all(user_id) {|filter_request = FilterRequest.new| ... } ⇒ Array
Retrieves pages of a user’s bank accounts.
-
.create(account, id_key = nil) ⇒ BankAccount
Creates a new bank account entity.
-
.deactivate(user_id, account_id) ⇒ BankAccount
Deactivates a bank account entity.
-
.get(user_id, account_id) ⇒ BankAccount
Retrieves a bank account for a user.
Methods included from UriProvider
Class Method Details
.all(user_id) {|filter_request = FilterRequest.new| ... } ⇒ Array
Retrieves pages of a user’s bank accounts. Allows configuration of paging and sorting parameters by yielding a filtering object to a provided block. When no filters are specified, will retrieve the first page of 10 newest results.
Allowed FilterRequest
params:
-
page
-
per_page
-
sort_field and sort_direction
95 96 97 98 99 100 101 |
# File 'lib/mangopay/api/service/bank_accounts.rb', line 95 def all(user_id) uri = provide_uri(:get_accounts, user_id) filter_request = nil yield filter_request = FilterRequest.new if block_given? results = HttpClient.get(uri, filter_request) parse_results results end |
.create(account, id_key = nil) ⇒ BankAccount
Creates a new bank account entity.
BankAccount
properties:
-
+IbanBankAccount
-
tag
- optional -
owner_address
- required -
owner_name
- required -
iban
- required -
bic
- optional
-
-
UsBankAccount
-
tag
- optional -
owner_address
- required -
owner_name
- required -
account_number
- required -
aba
- required -
deposit_account_type
- optional
-
-
CaBankAccount
-
tag
- optional -
owner_address
- required -
owner_name
- required -
branch_code
- required -
institution_number
- required -
account_number
- required -
bank_name
- required
-
-
GbBankAccount
-
tag
- optional -
owner_address
- required -
owner_name
- required -
sort_code
- required -
account_number
- required
-
-
OtherBankAccount
-
tag
optional -
owner_address
- required -
owner_name
- required -
country
- required -
bic
- required -
account_number
- required
-
53 54 55 56 57 |
# File 'lib/mangopay/api/service/bank_accounts.rb', line 53 def create(account, id_key = nil) uri = provide_uri(:create_account, account) response = HttpClient.post(uri, account, id_key) parse response end |
.deactivate(user_id, account_id) ⇒ BankAccount
Deactivates a bank account entity.
being deactivated
65 66 67 68 69 |
# File 'lib/mangopay/api/service/bank_accounts.rb', line 65 def deactivate(user_id, account_id) uri = provide_uri(:deactivate_account, user_id, account_id) response = HttpClient.put(uri, DeactivationRequest.new) parse response end |
.get(user_id, account_id) ⇒ BankAccount
Retrieves a bank account for a user.
76 77 78 79 80 |
# File 'lib/mangopay/api/service/bank_accounts.rb', line 76 def get(user_id, account_id) uri = provide_uri(:get_account, user_id, account_id) response = HttpClient.get(uri) parse response end |