Class: Tappay::Transaction::Query
- Inherits:
-
Object
- Object
- Tappay::Transaction::Query
- Defined in:
- lib/tappay/transaction/query.rb
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.
6 7 8 9 10 11 12 13 |
# File 'lib/tappay/transaction/query.rb', line 6 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
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/tappay/transaction/query.rb', line 15 def execute client = Tappay::Client.new response = client.post(Endpoints::Transaction.query_url, request_params) { status: response['status'], msg: response['msg'], records_per_page: response['records_per_page'], page: response['page'], total_page_count: response['total_page_count'], number_of_transactions: response['number_of_transactions'], trade_records: parse_trade_records(response['trade_records']) } end |