Class: Redex::Response::QueryResponse
- Inherits:
-
BaseResponse
- Object
- BaseResponse
- Redex::Response::QueryResponse
- Defined in:
- lib/redex/response/query_response.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#canceled_at ⇒ Object
readonly
Returns the value of attribute canceled_at.
-
#card_expiration_month ⇒ Object
readonly
Returns the value of attribute card_expiration_month.
-
#card_holder_name ⇒ Object
readonly
Returns the value of attribute card_holder_name.
-
#card_number ⇒ Object
readonly
Returns the value of attribute card_number.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#credit_card_authorization_id ⇒ Object
readonly
Returns the value of attribute credit_card_authorization_id.
-
#installments ⇒ Object
readonly
Returns the value of attribute installments.
-
#invoice_note ⇒ Object
readonly
Returns the value of attribute invoice_note.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#order_id ⇒ Object
readonly
Returns the value of attribute order_id.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#transaction_created_at ⇒ Object
readonly
Returns the value of attribute transaction_created_at.
-
#transaction_id ⇒ Object
readonly
Returns the value of attribute transaction_id.
-
#transaction_type ⇒ Object
readonly
Returns the value of attribute transaction_type.
Attributes inherited from BaseResponse
Instance Method Summary collapse
- #clear(httpi_result) ⇒ Object
-
#initialize(httpi_response) ⇒ QueryResponse
constructor
A new instance of QueryResponse.
- #sequential_id ⇒ Object
- #transaction_canceled_at ⇒ Object
Methods inherited from BaseResponse
Constructor Details
#initialize(httpi_response) ⇒ QueryResponse
Returns a new instance of QueryResponse.
8 9 10 |
# File 'lib/redex/response/query_response.rb', line 8 def initialize(httpi_response) super(httpi_response["REGISTRO"]) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
4 5 6 |
# File 'lib/redex/response/query_response.rb', line 4 def amount @amount end |
#canceled_at ⇒ Object (readonly)
Returns the value of attribute canceled_at.
4 5 6 |
# File 'lib/redex/response/query_response.rb', line 4 def canceled_at @canceled_at end |
#card_expiration_month ⇒ Object (readonly)
Returns the value of attribute card_expiration_month.
4 5 6 |
# File 'lib/redex/response/query_response.rb', line 4 def card_expiration_month @card_expiration_month end |
#card_holder_name ⇒ Object (readonly)
Returns the value of attribute card_holder_name.
4 5 6 |
# File 'lib/redex/response/query_response.rb', line 4 def card_holder_name @card_holder_name end |
#card_number ⇒ Object (readonly)
Returns the value of attribute card_number.
4 5 6 |
# File 'lib/redex/response/query_response.rb', line 4 def card_number @card_number end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/redex/response/query_response.rb', line 4 def code @code end |
#credit_card_authorization_id ⇒ Object (readonly)
Returns the value of attribute credit_card_authorization_id.
4 5 6 |
# File 'lib/redex/response/query_response.rb', line 4 def @credit_card_authorization_id end |
#installments ⇒ Object (readonly)
Returns the value of attribute installments.
4 5 6 |
# File 'lib/redex/response/query_response.rb', line 4 def installments @installments end |
#invoice_note ⇒ Object (readonly)
Returns the value of attribute invoice_note.
4 5 6 |
# File 'lib/redex/response/query_response.rb', line 4 def invoice_note @invoice_note end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
4 5 6 |
# File 'lib/redex/response/query_response.rb', line 4 def @message end |
#order_id ⇒ Object (readonly)
Returns the value of attribute order_id.
4 5 6 |
# File 'lib/redex/response/query_response.rb', line 4 def order_id @order_id end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
4 5 6 |
# File 'lib/redex/response/query_response.rb', line 4 def origin @origin end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/redex/response/query_response.rb', line 4 def status @status end |
#transaction_created_at ⇒ Object (readonly)
Returns the value of attribute transaction_created_at.
4 5 6 |
# File 'lib/redex/response/query_response.rb', line 4 def transaction_created_at @transaction_created_at end |
#transaction_id ⇒ Object (readonly)
Returns the value of attribute transaction_id.
4 5 6 |
# File 'lib/redex/response/query_response.rb', line 4 def transaction_id @transaction_id end |
#transaction_type ⇒ Object (readonly)
Returns the value of attribute transaction_type.
4 5 6 |
# File 'lib/redex/response/query_response.rb', line 4 def transaction_type @transaction_type end |
Instance Method Details
#clear(httpi_result) ⇒ Object
77 78 79 80 81 82 83 |
# File 'lib/redex/response/query_response.rb', line 77 def clear(httpi_result) httpi_result = httpi_result.first httpi_result.delete("AVS") httpi_result = Hash[httpi_result.map { |k, v| [k.to_sym, v] }] httpi_result.select! {|k,v| v != [{}] && v!= [{"i:nil"=>"true"}]} httpi_result.each { |k, v| httpi_result[k] = v.first } end |
#sequential_id ⇒ Object
32 33 34 |
# File 'lib/redex/response/query_response.rb', line 32 def sequential_id @sequential_id ||= @raw[:NUMSQN].to_i end |
#transaction_canceled_at ⇒ Object
72 73 74 |
# File 'lib/redex/response/query_response.rb', line 72 def transaction_canceled_at @transaction_canceled_at ||= datetime_sanitize(@raw[:DATA], "00:00:00") end |