Class: Cryptopay::Transactions
- Inherits:
-
Object
- Object
- Cryptopay::Transactions
- Defined in:
- lib/cryptopay/api/transactions.rb
Instance Method Summary collapse
-
#initialize(connection) ⇒ Transactions
constructor
A new instance of Transactions.
-
#list(opts = {}) ⇒ TransactionListResult
List transactions.
Constructor Details
#initialize(connection) ⇒ Transactions
Returns a new instance of Transactions.
8 9 10 |
# File 'lib/cryptopay/api/transactions.rb', line 8 def initialize(connection) @connection = connection end |
Instance Method Details
#list(opts = {}) ⇒ TransactionListResult
List transactions
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/cryptopay/api/transactions.rb', line 22 def list(opts = {}) path = '/api/transactions' query_params = {} query_params[:created_at_from] = opts[:created_at_from] unless opts[:created_at_from].nil? query_params[:created_at_to] = opts[:created_at_to] unless opts[:created_at_to].nil? query_params[:reference_type] = opts[:reference_type] unless opts[:reference_type].nil? query_params[:currency] = opts[:currency] unless opts[:currency].nil? query_params[:status] = opts[:status] unless opts[:status].nil? query_params[:risk_level] = opts[:risk_level] unless opts[:risk_level].nil? query_params[:starting_after] = opts[:starting_after] unless opts[:starting_after].nil? req = Request.new( method: :get, path: path, query_params: query_params ) connection.call(req, return_type: TransactionListResult) end |