Class: FluvPay::Resources::Transactions
- Inherits:
-
Object
- Object
- FluvPay::Resources::Transactions
- Defined in:
- lib/fluvpay/resources/transactions.rb
Overview
Recurso de extrato financeiro consolidado (entradas e saídas).
Instance Method Summary collapse
-
#initialize(client) ⇒ Transactions
constructor
A new instance of Transactions.
-
#list(page: nil, per_page: nil, sort: nil) ⇒ FluvPay::Resources::PageList
Lista lançamentos do extrato.
-
#retrieve(tx_id) ⇒ Hash
Recupera um lançamento por ID.
Constructor Details
#initialize(client) ⇒ Transactions
Returns a new instance of Transactions.
11 12 13 |
# File 'lib/fluvpay/resources/transactions.rb', line 11 def initialize(client) @client = client end |
Instance Method Details
#list(page: nil, per_page: nil, sort: nil) ⇒ FluvPay::Resources::PageList
Lista lançamentos do extrato.
Escopos exigidos (qualquer um): payments.read, transfers.read ou withdrawals.read. Envelope: page/per_page. Não suportado em sandbox: chaves fluv_test_ recebem 403.
25 26 27 28 29 30 31 32 33 |
# File 'lib/fluvpay/resources/transactions.rb', line 25 def list(page: nil, per_page: nil, sort: nil) params = { "page" => page, "per_page" => per_page, "sort" => sort } payload = @client.request(:get, "/transactions/", params: params) PageList.new(payload) end |
#retrieve(tx_id) ⇒ Hash
Recupera um lançamento por ID.
39 40 41 |
# File 'lib/fluvpay/resources/transactions.rb', line 39 def retrieve(tx_id) @client.request(:get, "/transactions/#{ERB::Util.url_encode(tx_id.to_s)}") end |