Class: MethodRuby::Resources::Accounts::Payoffs
- Inherits:
-
Object
- Object
- MethodRuby::Resources::Accounts::Payoffs
- Defined in:
- lib/method_ruby/resources/accounts/payoffs.rb
Overview
Payoff data for accounts
Instance Method Summary collapse
-
#create(account_id, method_version:, idempotency_key: nil, request_options: {}) ⇒ MethodRuby::Models::Accounts::PayoffCreateResponse
Some parameter documentations has been truncated, see Models::Accounts::PayoffCreateParams for more details.
-
#initialize(client:) ⇒ Payoffs
constructor
private
A new instance of Payoffs.
-
#list(account_id, method_version:, page: nil, page_cursor: nil, page_limit: nil, request_options: {}) ⇒ MethodRuby::Models::Accounts::PayoffListResponse
Some parameter documentations has been truncated, see Models::Accounts::PayoffListParams for more details.
-
#retrieve(pyf_id, account_id:, method_version:, request_options: {}) ⇒ MethodRuby::Models::Accounts::PayoffRetrieveResponse
Some parameter documentations has been truncated, see Models::Accounts::PayoffRetrieveParams for more details.
Constructor Details
#initialize(client:) ⇒ Payoffs
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 Payoffs.
116 117 118 |
# File 'lib/method_ruby/resources/accounts/payoffs.rb', line 116 def initialize(client:) @client = client end |
Instance Method Details
#create(account_id, method_version:, idempotency_key: nil, request_options: {}) ⇒ MethodRuby::Models::Accounts::PayoffCreateResponse
Some parameter documentations has been truncated, see Models::Accounts::PayoffCreateParams for more details.
Triggers a payoff sync for the specified account and returns the new payoff record.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/method_ruby/resources/accounts/payoffs.rb', line 27 def create(account_id, params) parsed, = MethodRuby::Accounts::PayoffCreateParams.dump_request(params) @client.request( method: :post, path: ["accounts/%1$s/payoffs", account_id], headers: parsed.transform_keys( method_version: "method-version", idempotency_key: "idempotency-key" ), model: MethodRuby::Models::Accounts::PayoffCreateResponse, security: {secret_key: true}, options: ) end |
#list(account_id, method_version:, page: nil, page_cursor: nil, page_limit: nil, request_options: {}) ⇒ MethodRuby::Models::Accounts::PayoffListResponse
Some parameter documentations has been truncated, see Models::Accounts::PayoffListParams for more details.
Returns a list of payoff records for the specified account.
98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/method_ruby/resources/accounts/payoffs.rb', line 98 def list(account_id, params) query_params = [:page, :page_cursor, :page_limit] parsed, = MethodRuby::Accounts::PayoffListParams.dump_request(params) query = MethodRuby::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: ["accounts/%1$s/payoffs", account_id], query: query, headers: parsed.except(*query_params).transform_keys(method_version: "method-version"), model: MethodRuby::Models::Accounts::PayoffListResponse, security: {secret_key: true}, options: ) end |
#retrieve(pyf_id, account_id:, method_version:, request_options: {}) ⇒ MethodRuby::Models::Accounts::PayoffRetrieveResponse
Some parameter documentations has been truncated, see Models::Accounts::PayoffRetrieveParams for more details.
Retrieves an account payoff by its unique identifier.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/method_ruby/resources/accounts/payoffs.rb', line 60 def retrieve(pyf_id, params) parsed, = MethodRuby::Accounts::PayoffRetrieveParams.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/payoffs/%2$s", account_id, pyf_id], headers: parsed.transform_keys(method_version: "method-version"), model: MethodRuby::Models::Accounts::PayoffRetrieveResponse, security: {secret_key: true}, options: ) end |