Class: CyberSourceMergedSpec::RiskV1AuthenticationsPost400Response2Exception
- Inherits:
-
APIException
- Object
- CoreLibrary::ApiException
- APIException
- CyberSourceMergedSpec::RiskV1AuthenticationsPost400Response2Exception
- Defined in:
- lib/cyber_source_merged_spec/exceptions/risk_v1_authentications_post400_response2_exception.rb
Overview
riskV1AuthenticationsPost400Response2 class.
Instance Attribute Summary collapse
-
#details ⇒ Array[Detail]
The message describing the reason of the status.
-
#message ⇒ String
The message describing the reason of the status.
-
#reason ⇒ String
The reason of the status.
-
#status ⇒ String
The status for payerAuthentication 400 enroll and validate calls.
-
#submit_time_utc ⇒ String
Time of request in UTC.
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ RiskV1AuthenticationsPost400Response2Exception
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) ⇒ RiskV1AuthenticationsPost400Response2Exception
The constructor.
48 49 50 51 52 |
# File 'lib/cyber_source_merged_spec/exceptions/risk_v1_authentications_post400_response2_exception.rb', line 48 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#details ⇒ Array[Detail]
The message describing the reason of the status. Value is:
- Encountered a Payer Authentication problem. Payer could not be authenticated.
43 44 45 |
# File 'lib/cyber_source_merged_spec/exceptions/risk_v1_authentications_post400_response2_exception.rb', line 43 def details @details end |
#message ⇒ String
The message describing the reason of the status. Value is:
- Encountered a Payer Authentication problem. Payer could not be authenticated.
37 38 39 |
# File 'lib/cyber_source_merged_spec/exceptions/risk_v1_authentications_post400_response2_exception.rb', line 37 def @message end |
#reason ⇒ String
The reason of the status. Possible Values:
MISSING_FIELDINVALID_DATA
31 32 33 |
# File 'lib/cyber_source_merged_spec/exceptions/risk_v1_authentications_post400_response2_exception.rb', line 31 def reason @reason end |
#status ⇒ String
The status for payerAuthentication 400 enroll and validate calls. Value is:
INVALID_REQUEST
24 25 26 |
# File 'lib/cyber_source_merged_spec/exceptions/risk_v1_authentications_post400_response2_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 Cybersource for all services.
18 19 20 |
# File 'lib/cyber_source_merged_spec/exceptions/risk_v1_authentications_post400_response2_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.
85 86 87 88 89 |
# File 'lib/cyber_source_merged_spec/exceptions/risk_v1_authentications_post400_response2_exception.rb', line 85 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}, details: #{@details.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
78 79 80 81 82 |
# File 'lib/cyber_source_merged_spec/exceptions/risk_v1_authentications_post400_response2_exception.rb', line 78 def to_s class_name = self.class.name.split('::').last "<#{class_name} submit_time_utc: #{@submit_time_utc}, status: #{@status}, reason:"\ " #{@reason}, message: #{@message}, details: #{@details}>" end |
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/cyber_source_merged_spec/exceptions/risk_v1_authentications_post400_response2_exception.rb', line 57 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 # Parameter is an array, so we need to iterate through it @details = nil unless hash['details'].nil? @details = [] hash['details'].each do |structure| @details << (Detail.from_hash(structure) if structure) end end @details = SKIP unless hash.key?('details') end |