Class: Straddle::Resources::FundingEvents
- Inherits:
-
Object
- Object
- Straddle::Resources::FundingEvents
- Defined in:
- lib/straddle/resources/funding_events.rb,
sig/straddle/resources/funding_events.rbs
Overview
Funding events group charge and payout activity into transfers between Straddle and your linked bank account.
Instance Method Summary collapse
-
#initialize(client:) ⇒ FundingEvents
constructor
private
A new instance of FundingEvents.
-
#list(created_from: nil, created_to: nil, direction: nil, event_type: nil, page_number: nil, page_size: nil, search_text: nil, sort_by: nil, sort_order: nil, status: nil, status_reason: nil, status_source: nil, trace_id: nil, trace_number: nil, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::FundingEventSummaryList
Some parameter documentations has been truncated, see Models::FundingEventListParams for more details.
-
#list_payments(id, default_page_size: nil, default_sort: nil, default_sort_order: nil, include_metadata: nil, page_number: nil, page_size: nil, sort_by: nil, sort_order: nil, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::FundingEventPaymentList
Some parameter documentations has been truncated, see Models::FundingEventListPaymentsParams for more details.
-
#retrieve(id, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::FundingEventResponse
Returns a funding event by its unique identifier, including its current status, status history, and linked bank account details when available.
-
#simulate(funding_event_job_type:, sandbox_outcome: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::FundingEventSimulation
Some parameter documentations has been truncated, see Models::FundingEventSimulateParams for more details.
Constructor Details
#initialize(client:) ⇒ FundingEvents
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 FundingEvents.
232 233 234 |
# File 'lib/straddle/resources/funding_events.rb', line 232 def initialize(client:) @client = client end |
Instance Method Details
#list(created_from: nil, created_to: nil, direction: nil, event_type: nil, page_number: nil, page_size: nil, search_text: nil, sort_by: nil, sort_order: nil, status: nil, status_reason: nil, status_source: nil, trace_id: nil, trace_number: nil, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::FundingEventSummaryList
Some parameter documentations has been truncated, see Models::FundingEventListParams for more details.
Returns a paginated list of funding events that match the specified filters.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/straddle/resources/funding_events.rb', line 88 def list(params = {}) query_params = %i[ created_from created_to direction event_type page_number page_size search_text sort_by sort_order status status_reason status_source trace_id trace_number ] parsed, = Straddle::FundingEventListParams.dump_request(params) query = Straddle::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: "v1/funding_events", query: query, headers: parsed.except(*query_params).transform_keys( correlation_id: "correlation-id", request_id: "request-id", straddle_account_id: "straddle-account-id" ), model: Straddle::FundingEventSummaryList, options: ) end |
#list_payments(id, default_page_size: nil, default_sort: nil, default_sort_order: nil, include_metadata: nil, page_number: nil, page_size: nil, sort_by: nil, sort_order: nil, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::FundingEventPaymentList
Some parameter documentations has been truncated, see Models::FundingEventListPaymentsParams for more details.
Returns a paginated list of payments included in the funding event.
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/straddle/resources/funding_events.rb', line 158 def list_payments(id, params = {}) query_params = %i[ default_page_size default_sort default_sort_order include_metadata page_number page_size sort_by sort_order ] parsed, = Straddle::FundingEventListPaymentsParams.dump_request(params) query = Straddle::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: ["v1/funding_event_payments/%1$s", id], query: query, headers: parsed.except(*query_params).transform_keys( correlation_id: "correlation-id", request_id: "request-id", straddle_account_id: "straddle-account-id" ), model: Straddle::FundingEventPaymentList, options: ) end |
#retrieve(id, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::FundingEventResponse
Returns a funding event by its unique identifier, including its current status, status history, and linked bank account details when available.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/straddle/resources/funding_events.rb', line 26 def retrieve(id, params = {}) parsed, = Straddle::FundingEventRetrieveParams.dump_request(params) @client.request( method: :get, path: ["v1/funding_events/%1$s", id], headers: parsed.transform_keys( correlation_id: "correlation-id", request_id: "request-id", straddle_account_id: "straddle-account-id" ), model: Straddle::FundingEventResponse, options: ) end |
#simulate(funding_event_job_type:, sandbox_outcome: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::FundingEventSimulation
Some parameter documentations has been truncated, see Models::FundingEventSimulateParams for more details.
Creates a funding event for unfunded charge or payout activity in the sandbox and returns its ID. This endpoint is unavailable in production.
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
# File 'lib/straddle/resources/funding_events.rb', line 211 def simulate(params) parsed, = Straddle::FundingEventSimulateParams.dump_request(params) header_params = { correlation_id: "correlation-id", idempotency_key: "idempotency-key", request_id: "request-id", straddle_account_id: "straddle-account-id" } @client.request( method: :post, path: "v1/funding_events/simulate", headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Straddle::FundingEventSimulation, options: ) end |