Class: MethodRuby::Resources::Accounts
- Inherits:
-
Object
- Object
- MethodRuby::Resources::Accounts
- Defined in:
- lib/method_ruby/resources/accounts.rb,
lib/method_ruby/resources/accounts/consent.rb,
lib/method_ruby/resources/accounts/payoffs.rb,
lib/method_ruby/resources/accounts/updates.rb,
lib/method_ruby/resources/accounts/balances.rb,
lib/method_ruby/resources/accounts/products.rb,
lib/method_ruby/resources/accounts/sensitive.rb,
lib/method_ruby/resources/accounts/attributes.rb,
lib/method_ruby/resources/accounts/card_brands.rb,
lib/method_ruby/resources/accounts/transactions.rb,
lib/method_ruby/resources/accounts/subscriptions.rb,
lib/method_ruby/resources/accounts/payment_instruments.rb,
lib/method_ruby/resources/accounts/verification_sessions.rb,
lib/method_ruby/resources/accounts/verification_sessions/amounts.rb
Overview
Financial accounts (ACH, liability, clearing, debit card)
Defined Under Namespace
Classes: Attributes, Balances, CardBrands, Consent, PaymentInstruments, Payoffs, Products, Sensitive, Subscriptions, Transactions, Updates, VerificationSessions
Instance Attribute Summary collapse
-
#attributes ⇒ MethodRuby::Resources::Accounts::Attributes
readonly
Attribute data for accounts.
-
#balances ⇒ MethodRuby::Resources::Accounts::Balances
readonly
Balance data for accounts.
-
#card_brands ⇒ MethodRuby::Resources::Accounts::CardBrands
readonly
Card brand information for accounts.
-
#consent ⇒ MethodRuby::Resources::Accounts::Consent
readonly
Consent management for accounts.
-
#payment_instruments ⇒ MethodRuby::Resources::Accounts::PaymentInstruments
readonly
Payment instruments for accounts.
-
#payoffs ⇒ MethodRuby::Resources::Accounts::Payoffs
readonly
Payoff data for accounts.
-
#products ⇒ MethodRuby::Resources::Accounts::Products
readonly
Products associated with accounts.
-
#sensitive ⇒ MethodRuby::Resources::Accounts::Sensitive
readonly
Sensitive data for accounts.
-
#subscriptions ⇒ MethodRuby::Resources::Accounts::Subscriptions
readonly
Subscriptions for accounts.
-
#transactions ⇒ MethodRuby::Resources::Accounts::Transactions
readonly
Transactions for accounts.
-
#updates ⇒ MethodRuby::Resources::Accounts::Updates
readonly
Update records for accounts.
-
#verification_sessions ⇒ MethodRuby::Resources::Accounts::VerificationSessions
readonly
Verification sessions for accounts.
Instance Method Summary collapse
-
#create(body:, method_version:, idempotency_key: nil, request_options: {}) ⇒ MethodRuby::Models::AccountCreateResponse
Some parameter documentations has been truncated, see Models::AccountCreateParams for more details.
-
#initialize(client:) ⇒ Accounts
constructor
private
A new instance of Accounts.
-
#list(method_version:, consent_status: nil, expand: nil, from_date: nil, holder_id: nil, holder_ids: nil, include_pending_consent: nil, liability: nil, page: nil, page_cursor: nil, page_limit: nil, status: nil, to_date: nil, type: nil, request_options: {}) ⇒ MethodRuby::Models::AccountListResponse
Some parameter documentations has been truncated, see Models::AccountListParams for more details.
-
#retrieve(account_id, method_version:, expand: nil, request_options: {}) ⇒ MethodRuby::Models::AccountRetrieveResponse
Some parameter documentations has been truncated, see Models::AccountRetrieveParams for more details.
-
#update(account_id, method_version:, liability: nil, metadata: nil, idempotency_key: nil, request_options: {}) ⇒ MethodRuby::Models::AccountUpdateResponse
Some parameter documentations has been truncated, see Models::AccountUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Accounts
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Accounts.
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/method_ruby/resources/accounts.rb', line 234 def initialize(client:) @client = client @verification_sessions = MethodRuby::Resources::Accounts::VerificationSessions.new(client: client) @sensitive = MethodRuby::Resources::Accounts::Sensitive.new(client: client) @consent = MethodRuby::Resources::Accounts::Consent.new(client: client) @payoffs = MethodRuby::Resources::Accounts::Payoffs.new(client: client) @balances = MethodRuby::Resources::Accounts::Balances.new(client: client) @card_brands = MethodRuby::Resources::Accounts::CardBrands.new(client: client) @updates = MethodRuby::Resources::Accounts::Updates.new(client: client) @products = MethodRuby::Resources::Accounts::Products.new(client: client) @subscriptions = MethodRuby::Resources::Accounts::Subscriptions.new(client: client) @attributes = MethodRuby::Resources::Accounts::Attributes.new(client: client) @payment_instruments = MethodRuby::Resources::Accounts::PaymentInstruments.new(client: client) @transactions = MethodRuby::Resources::Accounts::Transactions.new(client: client) end |
Instance Attribute Details
#attributes ⇒ MethodRuby::Resources::Accounts::Attributes (readonly)
Attribute data for accounts
45 46 47 |
# File 'lib/method_ruby/resources/accounts.rb', line 45 def attributes @attributes end |
#balances ⇒ MethodRuby::Resources::Accounts::Balances (readonly)
Balance data for accounts
25 26 27 |
# File 'lib/method_ruby/resources/accounts.rb', line 25 def balances @balances end |
#card_brands ⇒ MethodRuby::Resources::Accounts::CardBrands (readonly)
Card brand information for accounts
29 30 31 |
# File 'lib/method_ruby/resources/accounts.rb', line 29 def card_brands @card_brands end |
#consent ⇒ MethodRuby::Resources::Accounts::Consent (readonly)
Consent management for accounts
17 18 19 |
# File 'lib/method_ruby/resources/accounts.rb', line 17 def @consent end |
#payment_instruments ⇒ MethodRuby::Resources::Accounts::PaymentInstruments (readonly)
Payment instruments for accounts
49 50 51 |
# File 'lib/method_ruby/resources/accounts.rb', line 49 def payment_instruments @payment_instruments end |
#payoffs ⇒ MethodRuby::Resources::Accounts::Payoffs (readonly)
Payoff data for accounts
21 22 23 |
# File 'lib/method_ruby/resources/accounts.rb', line 21 def payoffs @payoffs end |
#products ⇒ MethodRuby::Resources::Accounts::Products (readonly)
Products associated with accounts
37 38 39 |
# File 'lib/method_ruby/resources/accounts.rb', line 37 def products @products end |
#sensitive ⇒ MethodRuby::Resources::Accounts::Sensitive (readonly)
Sensitive data for accounts
13 14 15 |
# File 'lib/method_ruby/resources/accounts.rb', line 13 def sensitive @sensitive end |
#subscriptions ⇒ MethodRuby::Resources::Accounts::Subscriptions (readonly)
Subscriptions for accounts
41 42 43 |
# File 'lib/method_ruby/resources/accounts.rb', line 41 def subscriptions @subscriptions end |
#transactions ⇒ MethodRuby::Resources::Accounts::Transactions (readonly)
Transactions for accounts
53 54 55 |
# File 'lib/method_ruby/resources/accounts.rb', line 53 def transactions @transactions end |
#updates ⇒ MethodRuby::Resources::Accounts::Updates (readonly)
Update records for accounts
33 34 35 |
# File 'lib/method_ruby/resources/accounts.rb', line 33 def updates @updates end |
#verification_sessions ⇒ MethodRuby::Resources::Accounts::VerificationSessions (readonly)
Verification sessions for accounts
9 10 11 |
# File 'lib/method_ruby/resources/accounts.rb', line 9 def verification_sessions @verification_sessions end |
Instance Method Details
#create(body:, method_version:, idempotency_key: nil, request_options: {}) ⇒ MethodRuby::Models::AccountCreateResponse
Some parameter documentations has been truncated, see Models::AccountCreateParams for more details.
Creates a new account for the specified entity. The request body must include exactly one of ‘ach`, `liability`, `clearing`, or `debit_card` to determine the account type.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/method_ruby/resources/accounts.rb', line 75 def create(params) parsed, = MethodRuby::AccountCreateParams.dump_request(params) @client.request( method: :post, path: "accounts", headers: parsed.except(:body).transform_keys( method_version: "method-version", idempotency_key: "idempotency-key" ), body: parsed[:body], model: MethodRuby::Models::AccountCreateResponse, security: {secret_key: true}, options: ) end |
#list(method_version:, consent_status: nil, expand: nil, from_date: nil, holder_id: nil, holder_ids: nil, include_pending_consent: nil, liability: nil, page: nil, page_cursor: nil, page_limit: nil, status: nil, to_date: nil, type: nil, request_options: {}) ⇒ MethodRuby::Models::AccountListResponse
Some parameter documentations has been truncated, see Models::AccountListParams for more details.
Returns a paginated list of accounts. Results can be filtered by status, type, holder, and date range.
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 |
# File 'lib/method_ruby/resources/accounts.rb', line 201 def list(params) query_params = [ :consent_status, :expand, :from_date, :holder_id, :holder_ids, :include_pending_consent, :liability, :page, :page_cursor, :page_limit, :status, :to_date, :type ] parsed, = MethodRuby::AccountListParams.dump_request(params) query = MethodRuby::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: "accounts", query: query, headers: parsed.except(*query_params).transform_keys(method_version: "method-version"), model: MethodRuby::Models::AccountListResponse, security: {secret_key: true}, options: ) end |
#retrieve(account_id, method_version:, expand: nil, request_options: {}) ⇒ MethodRuby::Models::AccountRetrieveResponse
Some parameter documentations has been truncated, see Models::AccountRetrieveParams for more details.
Retrieves an account by its unique identifier.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/method_ruby/resources/accounts.rb', line 109 def retrieve(account_id, params) query_params = [:expand] parsed, = MethodRuby::AccountRetrieveParams.dump_request(params) query = MethodRuby::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: ["accounts/%1$s", account_id], query: query, headers: parsed.except(*query_params).transform_keys(method_version: "method-version"), model: MethodRuby::Models::AccountRetrieveResponse, security: {secret_key: true}, options: ) end |
#update(account_id, method_version:, liability: nil, metadata: nil, idempotency_key: nil, request_options: {}) ⇒ MethodRuby::Models::AccountUpdateResponse
Some parameter documentations has been truncated, see Models::AccountUpdateParams for more details.
Updates an account’s metadata or liability account number.
146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/method_ruby/resources/accounts.rb', line 146 def update(account_id, params) parsed, = MethodRuby::AccountUpdateParams.dump_request(params) header_params = {method_version: "method-version", idempotency_key: "idempotency-key"} @client.request( method: :put, path: ["accounts/%1$s", account_id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: MethodRuby::Models::AccountUpdateResponse, security: {secret_key: true}, options: ) end |