Class: Increase::Resources::PendingTransactions
- Inherits:
-
Object
- Object
- Increase::Resources::PendingTransactions
- Defined in:
- lib/increase/resources/pending_transactions.rb
Instance Method Summary collapse
-
#create(account_id: , amount: , description: nil, request_options: {}) ⇒ Increase::Models::PendingTransaction
Some parameter documentations has been truncated, see Models::PendingTransactionCreateParams for more details.
-
#initialize(client:) ⇒ PendingTransactions
constructor
private
A new instance of PendingTransactions.
-
#list(account_id: nil, category: nil, created_at: nil, cursor: nil, limit: nil, route_id: nil, status: nil, request_options: {}) ⇒ Increase::Internal::Page<Increase::Models::PendingTransaction>
Some parameter documentations has been truncated, see Models::PendingTransactionListParams for more details.
-
#release(pending_transaction_id, request_options: {}) ⇒ Increase::Models::PendingTransaction
Release a Pending Transaction you had previously created.
-
#retrieve(pending_transaction_id, request_options: {}) ⇒ Increase::Models::PendingTransaction
Retrieve a Pending Transaction.
Constructor Details
#initialize(client:) ⇒ PendingTransactions
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 PendingTransactions.
122 123 124 |
# File 'lib/increase/resources/pending_transactions.rb', line 122 def initialize(client:) @client = client end |
Instance Method Details
#create(account_id: , amount: , description: nil, request_options: {}) ⇒ Increase::Models::PendingTransaction
Some parameter documentations has been truncated, see Models::PendingTransactionCreateParams for more details.
Creates a pending transaction on an account. This can be useful to hold funds for an external payment or known future transaction outside of Increase. The resulting Pending Transaction will have a ‘category` of `user_initiated_hold` and can be released via the API to unlock the held funds.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/increase/resources/pending_transactions.rb', line 27 def create(params) parsed, = Increase::PendingTransactionCreateParams.dump_request(params) @client.request( method: :post, path: "pending_transactions", body: parsed, model: Increase::PendingTransaction, options: ) end |
#list(account_id: nil, category: nil, created_at: nil, cursor: nil, limit: nil, route_id: nil, status: nil, request_options: {}) ⇒ Increase::Internal::Page<Increase::Models::PendingTransaction>
Some parameter documentations has been truncated, see Models::PendingTransactionListParams for more details.
List Pending Transactions
84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/increase/resources/pending_transactions.rb', line 84 def list(params = {}) parsed, = Increase::PendingTransactionListParams.dump_request(params) @client.request( method: :get, path: "pending_transactions", query: parsed, page: Increase::Internal::Page, model: Increase::PendingTransaction, options: ) end |
#release(pending_transaction_id, request_options: {}) ⇒ Increase::Models::PendingTransaction
Release a Pending Transaction you had previously created. The Pending Transaction must have a ‘category` of `user_initiated_hold` and a `status` of `pending`. This will unlock the held funds and mark the Pending Transaction as complete.
110 111 112 113 114 115 116 117 |
# File 'lib/increase/resources/pending_transactions.rb', line 110 def release(pending_transaction_id, params = {}) @client.request( method: :post, path: ["pending_transactions/%1$s/release", pending_transaction_id], model: Increase::PendingTransaction, options: params[:request_options] ) end |
#retrieve(pending_transaction_id, request_options: {}) ⇒ Increase::Models::PendingTransaction
Retrieve a Pending Transaction
49 50 51 52 53 54 55 56 |
# File 'lib/increase/resources/pending_transactions.rb', line 49 def retrieve(pending_transaction_id, params = {}) @client.request( method: :get, path: ["pending_transactions/%1$s", pending_transaction_id], model: Increase::PendingTransaction, options: params[:request_options] ) end |