Class: Straddle::Resources::Paykeys
- Inherits:
-
Object
- Object
- Straddle::Resources::Paykeys
- Defined in:
- lib/straddle/resources/paykeys.rb,
lib/straddle/resources/paykeys/review.rb,
sig/straddle/resources/paykeys.rbs,
sig/straddle/resources/paykeys/review.rbs
Overview
A paykey links a verified customer to a bank account without exposing bank account details. Use a paykey to create charges and payouts.
Defined Under Namespace
Classes: Review
Instance Attribute Summary collapse
-
#review ⇒ Straddle::Resources::Paykeys::Review
readonly
A paykey links a verified customer to a bank account without exposing bank account details.
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::PaykeyResponse
Some parameter documentations has been truncated, see Models::PaykeyCancelParams for more details.
-
#initialize(client:) ⇒ Paykeys
constructor
private
A new instance of Paykeys.
-
#list(created_from: nil, created_to: nil, customer_id: nil, page_number: nil, page_size: nil, search_text: nil, sort_by: nil, sort_order: nil, source: nil, status: nil, unblock_eligible: nil, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PaykeySummaryList
Some parameter documentations has been truncated, see Models::PaykeyListParams for more details.
-
#list_unmasked(id, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::UnmaskedPaykeyResponse
Returns a paykey by
id, including the full paykey value and unmasked bank account details. -
#refresh_balance(id, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PaykeyResponse
Starts an asynchronous balance refresh for a paykey.
-
#refresh_review(id, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PaykeyResponse
Starts a new verification review for a paykey.
-
#retrieve(id, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PaykeyResponse
Returns a paykey by
id, including the masked paykey value and bank account details. -
#reveal(id, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::RevealedPaykeyResponse
Returns a paykey by
id, including the full paykey value and masked bank account details. -
#unblock(id, message: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PaykeyResponse
Some parameter documentations has been truncated, see Models::PaykeyUnblockParams for more details.
Constructor Details
#initialize(client:) ⇒ Paykeys
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 Paykeys.
350 351 352 353 |
# File 'lib/straddle/resources/paykeys.rb', line 350 def initialize(client:) @client = client @review = Straddle::Resources::Paykeys::Review.new(client: client) end |
Instance Attribute Details
#review ⇒ Straddle::Resources::Paykeys::Review (readonly)
A paykey links a verified customer to a bank account without exposing bank account details. Use a paykey to create charges and payouts.
11 12 13 |
# File 'lib/straddle/resources/paykeys.rb', line 11 def review @review 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::PaykeyResponse
Some parameter documentations has been truncated, see Models::PaykeyCancelParams for more details.
Cancels a paykey so it cannot be used for new payments.
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/straddle/resources/paykeys.rb', line 143 def cancel(id, params = {}) parsed, = Straddle::PaykeyCancelParams.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/paykeys/%1$s/cancel", id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Straddle::PaykeyResponse, options: ) end |
#list(created_from: nil, created_to: nil, customer_id: nil, page_number: nil, page_size: nil, search_text: nil, sort_by: nil, sort_order: nil, source: nil, status: nil, unblock_eligible: nil, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PaykeySummaryList
Some parameter documentations has been truncated, see Models::PaykeyListParams for more details.
Returns a paginated list of paykeys for the account. Optional query parameters filter, search, and sort the results.
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 |
# File 'lib/straddle/resources/paykeys.rb', line 88 def list(params = {}) query_params = %i[ created_from created_to customer_id page_number page_size search_text sort_by sort_order source status unblock_eligible ] parsed, = Straddle::PaykeyListParams.dump_request(params) query = Straddle::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: "v1/paykeys", 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::PaykeySummaryList, options: ) end |
#list_unmasked(id, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::UnmaskedPaykeyResponse
Returns a paykey by id, including the full paykey value and unmasked bank
account details. Straddle must enable this endpoint for your account. Use this
endpoint only when unmasked data is necessary.
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/straddle/resources/paykeys.rb', line 180 def list_unmasked(id, params = {}) parsed, = Straddle::PaykeyListUnmaskedParams.dump_request(params) @client.request( method: :get, path: ["v1/paykeys/%1$s/unmasked", id], headers: parsed.transform_keys( correlation_id: "correlation-id", request_id: "request-id", straddle_account_id: "straddle-account-id" ), model: Straddle::UnmaskedPaykeyResponse, options: ) end |
#refresh_balance(id, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PaykeyResponse
Starts an asynchronous balance refresh for a paykey. The response returns the paykey before the refresh finishes.
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/straddle/resources/paykeys.rb', line 216 def refresh_balance(id, params = {}) parsed, = Straddle::PaykeyRefreshBalanceParams.dump_request(params) @client.request( method: :put, path: ["v1/paykeys/%1$s/refresh_balance", id], headers: parsed.transform_keys( correlation_id: "correlation-id", idempotency_key: "idempotency-key", request_id: "request-id", straddle_account_id: "straddle-account-id" ), model: Straddle::PaykeyResponse, options: ) end |
#refresh_review(id, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PaykeyResponse
Starts a new verification review for a paykey. The review runs asynchronously. Webhooks and the paykey review endpoint return updated results.
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/straddle/resources/paykeys.rb', line 253 def refresh_review(id, params = {}) parsed, = Straddle::PaykeyRefreshReviewParams.dump_request(params) @client.request( method: :put, path: ["v1/paykeys/%1$s/refresh_review", id], headers: parsed.transform_keys( correlation_id: "correlation-id", idempotency_key: "idempotency-key", request_id: "request-id", straddle_account_id: "straddle-account-id" ), model: Straddle::PaykeyResponse, options: ) end |
#retrieve(id, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PaykeyResponse
Returns a paykey by id, including the masked paykey value and bank account
details.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/straddle/resources/paykeys.rb', line 31 def retrieve(id, params = {}) parsed, = Straddle::PaykeyRetrieveParams.dump_request(params) @client.request( method: :get, path: ["v1/paykeys/%1$s", id], headers: parsed.transform_keys( correlation_id: "correlation-id", request_id: "request-id", straddle_account_id: "straddle-account-id" ), model: Straddle::PaykeyResponse, options: ) end |
#reveal(id, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::RevealedPaykeyResponse
Returns a paykey by id, including the full paykey value and masked bank
account details.
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
# File 'lib/straddle/resources/paykeys.rb', line 288 def reveal(id, params = {}) parsed, = Straddle::PaykeyRevealParams.dump_request(params) @client.request( method: :get, path: ["v1/paykeys/%1$s/reveal", id], headers: parsed.transform_keys( correlation_id: "correlation-id", request_id: "request-id", straddle_account_id: "straddle-account-id" ), model: Straddle::RevealedPaykeyResponse, options: ) end |
#unblock(id, message: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PaykeyResponse
Some parameter documentations has been truncated, see Models::PaykeyUnblockParams for more details.
Unblocks a paykey that was blocked by an R29 return. The paykey must not have
been unblocked before.
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 |
# File 'lib/straddle/resources/paykeys.rb', line 329 def unblock(id, params = {}) parsed, = Straddle::PaykeyUnblockParams.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: :patch, path: ["v1/paykeys/%1$s/unblock", id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Straddle::PaykeyResponse, options: ) end |