Class: Straddle::Resources::Payouts
- Inherits:
-
Object
- Object
- Straddle::Resources::Payouts
- Defined in:
- lib/straddle/resources/payouts.rb,
sig/straddle/resources/payouts.rbs
Overview
Payouts send money to a customer's bank account through a paykey.
Instance Method Summary collapse
-
#cancel(id, reason: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PayoutResponse
Some parameter documentations has been truncated, see Models::PayoutCancelParams for more details.
-
#create(amount:, currency:, description:, device:, external_id:, paykey:, payment_date:, config: nil, metadata: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PayoutResponse
Some parameter documentations has been truncated, see Models::PayoutCreateParams for more details.
-
#hold(id, reason: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PayoutResponse
Some parameter documentations has been truncated, see Models::PayoutHoldParams for more details.
-
#initialize(client:) ⇒ Payouts
constructor
private
A new instance of Payouts.
-
#list_unmasked(id, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::UnmaskedPayoutResponse
Return a payout with its sensitive fields unmasked.
-
#release(id, reason: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PayoutResponse
Some parameter documentations has been truncated, see Models::PayoutReleaseParams for more details.
-
#resubmit(id, description: nil, external_id: nil, payment_date: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PayoutResponse
Some parameter documentations has been truncated, see Models::PayoutResubmitParams for more details.
-
#retrieve(id, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PayoutResponse
Returns a payout by its unique identifier.
-
#update(id, amount:, description:, payment_date:, metadata: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PayoutResponse
Some parameter documentations has been truncated, see Models::PayoutUpdateParams for more details.
-
#upload_authorization_proof(id, file:, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PayoutResponse
Some parameter documentations has been truncated, see Models::PayoutUploadAuthorizationProofParams for more details.
Constructor Details
#initialize(client:) ⇒ Payouts
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 Payouts.
402 403 404 |
# File 'lib/straddle/resources/payouts.rb', line 402 def initialize(client:) @client = client end |
Instance Method Details
#cancel(id, reason: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PayoutResponse
Some parameter documentations has been truncated, see Models::PayoutCancelParams for more details.
Cancels a payout. The payout must have a status of created, scheduled, or
on_hold.
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/straddle/resources/payouts.rb', line 171 def cancel(id, params = {}) parsed, = Straddle::PayoutCancelParams.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: :put, path: ["v1/payouts/%1$s/cancel", id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Straddle::PayoutResponse, options: ) end |
#create(amount:, currency:, description:, device:, external_id:, paykey:, payment_date:, config: nil, metadata: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PayoutResponse
Some parameter documentations has been truncated, see Models::PayoutCreateParams for more details.
Creates a payout to a customer's bank account. Straddle submits the payout for
processing on payment_date unless the payout is on hold.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/straddle/resources/payouts.rb', line 46 def create(params) parsed, = Straddle::PayoutCreateParams.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/payouts", headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Straddle::PayoutResponse, options: ) end |
#hold(id, reason: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PayoutResponse
Some parameter documentations has been truncated, see Models::PayoutHoldParams for more details.
Places a payout on hold to prevent submission for processing. The payout must
have a status of created or scheduled.
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
# File 'lib/straddle/resources/payouts.rb', line 214 def hold(id, params = {}) parsed, = Straddle::PayoutHoldParams.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: :put, path: ["v1/payouts/%1$s/hold", id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Straddle::PayoutResponse, options: ) end |
#list_unmasked(id, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::UnmaskedPayoutResponse
Return a payout with its sensitive fields unmasked.
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 |
# File 'lib/straddle/resources/payouts.rb', line 249 def list_unmasked(id, params = {}) parsed, = Straddle::PayoutListUnmaskedParams.dump_request(params) @client.request( method: :get, path: ["v1/payouts/%1$s/unmask", id], headers: parsed.transform_keys( correlation_id: "correlation-id", request_id: "request-id", straddle_account_id: "straddle-account-id" ), model: Straddle::UnmaskedPayoutResponse, options: ) end |
#release(id, reason: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PayoutResponse
Some parameter documentations has been truncated, see Models::PayoutReleaseParams for more details.
Releases a payout from on_hold and returns it to created for submission on
payment_date.
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/straddle/resources/payouts.rb', line 290 def release(id, params = {}) parsed, = Straddle::PayoutReleaseParams.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: :put, path: ["v1/payouts/%1$s/release", id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Straddle::PayoutResponse, options: ) end |
#resubmit(id, description: nil, external_id: nil, payment_date: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PayoutResponse
Some parameter documentations has been truncated, see Models::PayoutResubmitParams for more details.
Creates a new payout from a failed, reversed, or cancelled payout. The request
can override description, external_id, and payment_date. Other payment
details come from the original payout.
338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
# File 'lib/straddle/resources/payouts.rb', line 338 def resubmit(id, params = {}) parsed, = Straddle::PayoutResubmitParams.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/payouts/%1$s/resubmit", id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Straddle::PayoutResponse, options: ) end |
#retrieve(id, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PayoutResponse
Returns a payout by its unique identifier.
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/straddle/resources/payouts.rb', line 81 def retrieve(id, params = {}) parsed, = Straddle::PayoutRetrieveParams.dump_request(params) @client.request( method: :get, path: ["v1/payouts/%1$s", id], headers: parsed.transform_keys( correlation_id: "correlation-id", request_id: "request-id", straddle_account_id: "straddle-account-id" ), model: Straddle::PayoutResponse, options: ) end |
#update(id, amount:, description:, payment_date:, metadata: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PayoutResponse
Some parameter documentations has been truncated, see Models::PayoutUpdateParams for more details.
Updates the description, amount, payment_date, or metadata. The payout must
have a status of created or on_hold.
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/straddle/resources/payouts.rb', line 128 def update(id, params) parsed, = Straddle::PayoutUpdateParams.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: :put, path: ["v1/payouts/%1$s", id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Straddle::PayoutResponse, options: ) end |
#upload_authorization_proof(id, file:, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PayoutResponse
Some parameter documentations has been truncated, see Models::PayoutUploadAuthorizationProofParams for more details.
Uploads a proof-of-authorization document for a payout. A later upload adds another document and does not replace an existing one.
381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 |
# File 'lib/straddle/resources/payouts.rb', line 381 def (id, params) parsed, = Straddle::PayoutUploadAuthorizationProofParams.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/payouts/%1$s/authorization", id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Straddle::PayoutResponse, options: ) end |