Class: Redex::Request::QueryRequest

Inherits:
BaseRequest show all
Defined in:
lib/redex/request/query_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseRequest

#authorization_params, client, #result, #sanitize

Constructor Details

#initialize(params = {}) ⇒ QueryRequest

Returns a new instance of QueryRequest.



6
7
8
9
# File 'lib/redex/request/query_request.rb', line 6

def initialize(params = {})
				@order_id = params[:order_id]
				@transaction_id = params[:transaction_id]
end

Instance Attribute Details

#order_idObject

Returns the value of attribute order_id.



4
5
6
# File 'lib/redex/request/query_request.rb', line 4

def order_id
  @order_id
end

#transaction_idObject

Returns the value of attribute transaction_id.



4
5
6
# File 'lib/redex/request/query_request.rb', line 4

def transaction_id
  @transaction_id
end

Instance Method Details

#sanitized_fieldsObject



11
12
13
14
15
16
# File 'lib/redex/request/query_request.rb', line 11

def sanitized_fields
	{
       NumPedido: sanitize(:order_id),
       Tid: sanitize(:transaction_id),
	}.merge(authorization_params).sort.to_h.select { |k, v| !v.to_s.empty?  }
end