Class: Inttegro::Resources::FinancialAccounts
- Inherits:
-
Object
- Object
- Inttegro::Resources::FinancialAccounts
- Defined in:
- lib/inttegro/resources/financial_accounts.rb
Instance Method Summary collapse
- #connect(payload) ⇒ Object
- #create(payload) ⇒ Object
- #disable_pull(account_id:) ⇒ Object
- #disable_push(account_id:, unset_as_payout_destination: nil) ⇒ Object
- #disconnect(account_id:, unset_as_payout_destination: nil) ⇒ Object
- #enable_pull(account_id:) ⇒ Object
- #enable_push(account_id:) ⇒ Object
-
#initialize(http) ⇒ FinancialAccounts
constructor
A new instance of FinancialAccounts.
- #lookup(account_id:) ⇒ Object
- #page(payload = {}) ⇒ Object
- #reconnect(account_id:) ⇒ Object
- #update(payload) ⇒ Object
Constructor Details
#initialize(http) ⇒ FinancialAccounts
Returns a new instance of FinancialAccounts.
7 8 9 |
# File 'lib/inttegro/resources/financial_accounts.rb', line 7 def initialize(http) @http = T.let(http, Inttegro::HTTPClient) end |
Instance Method Details
#connect(payload) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/inttegro/resources/financial_accounts.rb', line 27 def connect(payload) @http.post_resource( "/financial_accounts/connect", Inttegro::FinancialAccount, :account, payload ) end |
#create(payload) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/inttegro/resources/financial_accounts.rb', line 11 def create(payload) @http.post_resource( "/financial_accounts/create", Inttegro::FinancialAccount, :account, payload ) end |
#disable_pull(account_id:) ⇒ Object
77 78 79 80 81 82 83 |
# File 'lib/inttegro/resources/financial_accounts.rb', line 77 def disable_pull(account_id:) @http.post_resource( "/financial_accounts/disable_pull", Inttegro::FinancialAccount, :account, { account_id: account_id } ) end |
#disable_push(account_id:, unset_as_payout_destination: nil) ⇒ Object
59 60 61 62 63 64 65 66 67 |
# File 'lib/inttegro/resources/financial_accounts.rb', line 59 def disable_push(account_id:, unset_as_payout_destination: nil) payload = { account_id: account_id } payload[:unset_as_payout_destination] = unset_as_payout_destination unless unset_as_payout_destination.nil? @http.post_resource( "/financial_accounts/disable_push", Inttegro::FinancialAccount, :account, payload ) end |
#disconnect(account_id:, unset_as_payout_destination: nil) ⇒ Object
85 86 87 88 89 90 91 92 93 |
# File 'lib/inttegro/resources/financial_accounts.rb', line 85 def disconnect(account_id:, unset_as_payout_destination: nil) payload = { account_id: account_id } payload[:unset_as_payout_destination] = unset_as_payout_destination unless unset_as_payout_destination.nil? @http.post_resource( "/financial_accounts/disconnect", Inttegro::FinancialAccount, :account, payload ) end |
#enable_pull(account_id:) ⇒ Object
69 70 71 72 73 74 75 |
# File 'lib/inttegro/resources/financial_accounts.rb', line 69 def enable_pull(account_id:) @http.post_resource( "/financial_accounts/enable_pull", Inttegro::FinancialAccount, :account, { account_id: account_id } ) end |
#enable_push(account_id:) ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/inttegro/resources/financial_accounts.rb', line 51 def enable_push(account_id:) @http.post_resource( "/financial_accounts/enable_push", Inttegro::FinancialAccount, :account, { account_id: account_id } ) end |
#lookup(account_id:) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/inttegro/resources/financial_accounts.rb', line 19 def lookup(account_id:) @http.post_resource( "/financial_accounts/lookup", Inttegro::FinancialAccount, :account, { account_id: account_id } ) end |
#page(payload = {}) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/inttegro/resources/financial_accounts.rb', line 35 def page(payload = {}) @http.post_resource( "/financial_accounts/page", Inttegro::FinancialAccountPage, :page, payload || {} ) end |
#reconnect(account_id:) ⇒ Object
95 96 97 98 99 100 101 |
# File 'lib/inttegro/resources/financial_accounts.rb', line 95 def reconnect(account_id:) @http.post_resource( "/financial_accounts/reconnect", Inttegro::FinancialAccount, :account, { account_id: account_id } ) end |
#update(payload) ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/inttegro/resources/financial_accounts.rb', line 43 def update(payload) @http.post_resource( "/financial_accounts/update", Inttegro::FinancialAccount, :account, payload ) end |