Class: Tappay::Transaction::Query
- Inherits:
-
Object
- Object
- Tappay::Transaction::Query
- Defined in:
- lib/tappay/transaction/query.rb
Constant Summary collapse
- MILLIS_FLOOR =
TapPay's time filter is in milliseconds. Values at the wrong scale are accepted by the API but match nothing (seconds land in 1970, microseconds in the year 50000), so reject them loudly rather than returning an empty list. ponytail: magnitude heuristic, only valid for 1973-03-03 .. 5138-11-16
100_000_000_000- MILLIS_CEILING =
100_000_000_000_000
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(time:, order_number: nil, bank_transaction_id: nil, records_per_page: 50, page: 0, order_by: nil) ⇒ Query
constructor
A new instance of Query.
Constructor Details
#initialize(time:, order_number: nil, bank_transaction_id: nil, records_per_page: 50, page: 0, order_by: nil) ⇒ Query
Returns a new instance of Query.
14 15 16 17 18 19 20 21 |
# File 'lib/tappay/transaction/query.rb', line 14 def initialize(time:, order_number: nil, bank_transaction_id: nil, records_per_page: 50, page: 0, order_by: nil) @time = validate_time!(time) @order_number = order_number @bank_transaction_id = bank_transaction_id @records_per_page = records_per_page @page = page @order_by = order_by end |
Instance Method Details
#execute ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/tappay/transaction/query.rb', line 23 def execute client = Tappay::Client.new response = client.post(Endpoints::Transaction.query_url, request_params) result = symbolize_keys(response.parsed_response) result[:trade_records] ||= [] result end |