Class: VisaAcceptanceMergedSpec::PtsV2CapturesVoidsPost502Response1Exception
- Inherits:
-
APIException
- Object
- CoreLibrary::ApiException
- APIException
- VisaAcceptanceMergedSpec::PtsV2CapturesVoidsPost502Response1Exception
- Defined in:
- lib/visa_acceptance_merged_spec/exceptions/pts_v2_captures_voids_post502_response1_exception.rb
Overview
ptsV2CapturesVoidsPost502Response1 class.
Instance Attribute Summary collapse
-
#message ⇒ String
The detail message related to the status and reason listed above.
-
#reason ⇒ String
The reason of the status.
-
#status ⇒ String
The status of the submitted transaction.
-
#submit_time_utc ⇒ String
Time of request in UTC.
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ PtsV2CapturesVoidsPost502Response1Exception
constructor
The constructor.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, response) ⇒ PtsV2CapturesVoidsPost502Response1Exception
The constructor.
41 42 43 44 45 |
# File 'lib/visa_acceptance_merged_spec/exceptions/pts_v2_captures_voids_post502_response1_exception.rb', line 41 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#message ⇒ String
The detail message related to the status and reason listed above.
36 37 38 |
# File 'lib/visa_acceptance_merged_spec/exceptions/pts_v2_captures_voids_post502_response1_exception.rb', line 36 def @message end |
#reason ⇒ String
The reason of the status. Possible values:
- SYSTEM_ERROR
- SERVER_TIMEOUT
- SERVICE_TIMEOUT
32 33 34 |
# File 'lib/visa_acceptance_merged_spec/exceptions/pts_v2_captures_voids_post502_response1_exception.rb', line 32 def reason @reason end |
#status ⇒ String
The status of the submitted transaction. Possible values:
- SERVER_ERROR
24 25 26 |
# File 'lib/visa_acceptance_merged_spec/exceptions/pts_v2_captures_voids_post502_response1_exception.rb', line 24 def status @status end |
#submit_time_utc ⇒ String
Time of request in UTC. Format: YYYY-MM-DDThh:mm:ssZ
Example 2016-08-11T22:47:57Z equals August 11, 2016, at 22:47:57
(10:47:57 p.m.).
The T separates the date and the time. The Z indicates UTC.
Returned by Visa Acceptance for all services.
18 19 20 |
# File 'lib/visa_acceptance_merged_spec/exceptions/pts_v2_captures_voids_post502_response1_exception.rb', line 18 def submit_time_utc @submit_time_utc end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
68 69 70 71 72 |
# File 'lib/visa_acceptance_merged_spec/exceptions/pts_v2_captures_voids_post502_response1_exception.rb', line 68 def inspect class_name = self.class.name.split('::').last "<#{class_name} submit_time_utc: #{@submit_time_utc.inspect}, status: #{@status.inspect},"\ " reason: #{@reason.inspect}, message: #{@message.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
61 62 63 64 65 |
# File 'lib/visa_acceptance_merged_spec/exceptions/pts_v2_captures_voids_post502_response1_exception.rb', line 61 def to_s class_name = self.class.name.split('::').last "<#{class_name} submit_time_utc: #{@submit_time_utc}, status: #{@status}, reason:"\ " #{@reason}, message: #{@message}>" end |
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
50 51 52 53 54 55 56 57 58 |
# File 'lib/visa_acceptance_merged_spec/exceptions/pts_v2_captures_voids_post502_response1_exception.rb', line 50 def unbox(hash) return nil unless hash @submit_time_utc = hash.key?('submitTimeUtc') ? hash['submitTimeUtc'] : SKIP @status = hash.key?('status') ? hash['status'] : SKIP @reason = hash.key?('reason') ? hash['reason'] : SKIP @message = hash.key?('message') ? hash['message'] : SKIP end |