Module: Unit::Transaction
- Defined in:
- lib/unit/models/transaction/transaction.rb,
lib/unit/models/transaction/patch_tags_request.rb,
lib/unit/models/transaction/get_transaction_params.rb,
lib/unit/models/transaction/list_transaction_params.rb,
lib/unit/models/transaction/patch_book_transaction_request.rb,
lib/unit/models/transaction/patch_chargeback_transaction_request.rb
Defined Under Namespace
Classes: GetTransactionParams, ListTransactionParams, PatchBookTransactionRequest, PatchChargebackTransactionRequest, PatchTagsRequest
Constant Summary collapse
- TRANSACTION_LIST_LIMIT =
100
- TRANSACTION_LIST_OFFSET =
0
Class Method Summary collapse
-
.get_transaction(transaction_id:, account_id:, customer_id: nil, include: nil) ⇒ Object
Get a transaction by id.
-
.list_transactions(limit: nil, offset: nil, account_id: nil, customer_id: nil, query: nil, tags: nil, since: nil, _until: nil, card_id: nil, type: nil, from_amount: nil, to_amount: nil, direction: nil, exclude_fees: nil, sort: nil, include: nil) ⇒ Object
List transactions.
-
.update_book_transaction(account_id:, transaction_id:, summary:, tags: nil) ⇒ Object
Update a book transaction.
-
.update_chargeback_transaction(account_id:, transaction_id:, summary:, tags: nil) ⇒ Object
Update a chargeback transaction.
-
.update_transaction(account_id:, transaction_id:, tags: nil) ⇒ Object
Update transaction tags.
Class Method Details
.get_transaction(transaction_id:, account_id:, customer_id: nil, include: nil) ⇒ Object
Get a transaction by id
20 21 22 23 |
# File 'lib/unit/models/transaction/transaction.rb', line 20 def get_transaction(transaction_id:, account_id:, customer_id: nil, include: nil) params = GetTransactionParams.new(transaction_id, account_id, customer_id, include) Unit::Resource::TransactionResource.get_transaction(params) end |
.list_transactions(limit: nil, offset: nil, account_id: nil, customer_id: nil, query: nil, tags: nil, since: nil, _until: nil, card_id: nil, type: nil, from_amount: nil, to_amount: nil, direction: nil, exclude_fees: nil, sort: nil, include: nil) ⇒ Object
List transactions
42 43 44 45 46 47 48 49 |
# File 'lib/unit/models/transaction/transaction.rb', line 42 def list_transactions(limit: nil, offset: nil, account_id: nil, customer_id: nil, query: nil, tags: nil, since: nil, _until: nil, card_id: nil, type: nil, from_amount: nil, to_amount: nil, direction: nil, exclude_fees: nil, sort: nil, include: nil) params = ListTransactionParams.new(limit, offset, account_id, customer_id, query, , since, _until, card_id, type, from_amount, to_amount, direction, exclude_fees, sort, include) Unit::Resource::TransactionResource.list_transactions(params) end |
.update_book_transaction(account_id:, transaction_id:, summary:, tags: nil) ⇒ Object
Update a book transaction
67 68 69 70 |
# File 'lib/unit/models/transaction/transaction.rb', line 67 def update_book_transaction(account_id:, transaction_id:, summary:, tags: nil) request = PatchBookTransactionRequest.new(account_id, transaction_id, summary, ) Unit::Resource::TransactionResource.update_transaction(request) end |
.update_chargeback_transaction(account_id:, transaction_id:, summary:, tags: nil) ⇒ Object
Update a chargeback transaction
78 79 80 81 |
# File 'lib/unit/models/transaction/transaction.rb', line 78 def update_chargeback_transaction(account_id:, transaction_id:, summary:, tags: nil) request = PatchChargebackTransactionRequest.new(account_id, transaction_id, summary, ) Unit::Resource::TransactionResource.update_transaction(request) end |
.update_transaction(account_id:, transaction_id:, tags: nil) ⇒ Object
Update transaction tags
56 57 58 59 |
# File 'lib/unit/models/transaction/transaction.rb', line 56 def update_transaction(account_id:, transaction_id:, tags: nil) request = PatchTagsRequest.new(account_id, transaction_id, ) Unit::Resource::TransactionResource.(request) end |