Class: Hps::HpsCheckResponse
- Inherits:
-
HpsTransaction
- Object
- HpsTransaction
- Hps::HpsCheckResponse
- Defined in:
- lib/hps/entities/hps_check_response.rb
Instance Attribute Summary collapse
-
#authorization_code ⇒ Object
Returns the value of attribute authorization_code.
-
#customer_id ⇒ Object
Returns the value of attribute customer_id.
-
#details ⇒ Object
Returns the value of attribute details.
Attributes inherited from HpsTransaction
#reference_number, #response_code, #response_text, #transaction_header, #transaction_id
Class Method Summary collapse
Methods inherited from HpsTransaction
Constructor Details
This class inherits a constructor from Hps::HpsTransaction
Instance Attribute Details
#authorization_code ⇒ Object
Returns the value of attribute authorization_code.
3 4 5 |
# File 'lib/hps/entities/hps_check_response.rb', line 3 def @authorization_code end |
#customer_id ⇒ Object
Returns the value of attribute customer_id.
3 4 5 |
# File 'lib/hps/entities/hps_check_response.rb', line 3 def customer_id @customer_id end |
#details ⇒ Object
Returns the value of attribute details.
3 4 5 |
# File 'lib/hps/entities/hps_check_response.rb', line 3 def details @details end |
Class Method Details
.from_hash(rsp, txn_type) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/hps/entities/hps_check_response.rb', line 7 def self.from_hash(rsp, txn_type) header = rsp["Header"] data = rsp["Transaction"][txn_type.to_s] result = HpsCheckResponse.new(HpsService.new.hydrate_transaction_header(header)) result.transaction_id = header["GatewayTxnId"] result. = data["AuthCode"] result.reference_number = data["RefNbr"] result.response_code = data["RspCode"] result.response_text = data["RspMessage"] if data["CheckRspInfo"] result.details = [] check_info = data["CheckRspInfo"] if check_info.is_a? Hash result.details = HpsCheckResponse.hydrate_rsp_details(check_info) else check_info.map { |details| result.details.push HpsCheckResponse.hydrate_rsp_details(details) } end end result end |