Class: MethodRuby::Resources::Accounts::Transactions
- Inherits:
-
Object
- Object
- MethodRuby::Resources::Accounts::Transactions
- Defined in:
- lib/method_ruby/resources/accounts/transactions.rb
Overview
Transactions for accounts
Instance Method Summary collapse
-
#initialize(client:) ⇒ Transactions
constructor
private
A new instance of Transactions.
-
#list(account_id, method_version:, from_date: nil, page: nil, page_cursor: nil, page_limit: nil, to_date: nil, request_options: {}) ⇒ MethodRuby::Models::Accounts::TransactionListResponse
Some parameter documentations has been truncated, see Models::Accounts::TransactionListParams for more details.
-
#retrieve(acc_txn_id, account_id:, method_version:, request_options: {}) ⇒ MethodRuby::Models::Accounts::TransactionRetrieveResponse
Some parameter documentations has been truncated, see Models::Accounts::TransactionRetrieveParams for more details.
Constructor Details
#initialize(client:) ⇒ Transactions
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 Transactions.
87 88 89 |
# File 'lib/method_ruby/resources/accounts/transactions.rb', line 87 def initialize(client:) @client = client end |
Instance Method Details
#list(account_id, method_version:, from_date: nil, page: nil, page_cursor: nil, page_limit: nil, to_date: nil, request_options: {}) ⇒ MethodRuby::Models::Accounts::TransactionListResponse
Some parameter documentations has been truncated, see Models::Accounts::TransactionListParams for more details.
Returns a paginated list of transactions for the specified account. Results can be filtered by status and date range.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/method_ruby/resources/accounts/transactions.rb', line 69 def list(account_id, params) query_params = [:from_date, :page, :page_cursor, :page_limit, :to_date] parsed, = MethodRuby::Accounts::TransactionListParams.dump_request(params) query = MethodRuby::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: ["accounts/%1$s/transactions", account_id], query: query, headers: parsed.except(*query_params).transform_keys(method_version: "method-version"), model: MethodRuby::Models::Accounts::TransactionListResponse, security: {secret_key: true}, options: ) end |
#retrieve(acc_txn_id, account_id:, method_version:, request_options: {}) ⇒ MethodRuby::Models::Accounts::TransactionRetrieveResponse
Some parameter documentations has been truncated, see Models::Accounts::TransactionRetrieveParams for more details.
Retrieves an account transaction by its unique identifier.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/method_ruby/resources/accounts/transactions.rb', line 26 def retrieve(acc_txn_id, params) parsed, = MethodRuby::Accounts::TransactionRetrieveParams.dump_request(params) account_id = parsed.delete(:account_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["accounts/%1$s/transactions/%2$s", account_id, acc_txn_id], headers: parsed.transform_keys(method_version: "method-version"), model: MethodRuby::Models::Accounts::TransactionRetrieveResponse, security: {secret_key: true}, options: ) end |