Class: CyberSourceMergedSpec::RiskV1AuthenticationsPost400ResponseException

Inherits:
APIException
  • Object
show all
Defined in:
lib/cyber_source_merged_spec/exceptions/risk_v1_authentications_post400_response_exception.rb

Overview

riskV1AuthenticationsPost400Response class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reason, response) ⇒ RiskV1AuthenticationsPost400ResponseException

The constructor.

Parameters:

  • reason (String)

    The reason for raising an exception.

  • response (HttpResponse)

    The HttpReponse of the API call.



42
43
44
45
46
# File 'lib/cyber_source_merged_spec/exceptions/risk_v1_authentications_post400_response_exception.rb', line 42

def initialize(reason, response)
  super(reason, response)
  hash = APIHelper.json_deserialize(@response.raw_body)
  unbox(hash)
end

Instance Attribute Details

#detailsArray[Detail]

The message describing the reason of the status. Value is:

  • Encountered a Payer Authentication problem. Payer could not be setup.

Returns:



37
38
39
# File 'lib/cyber_source_merged_spec/exceptions/risk_v1_authentications_post400_response_exception.rb', line 37

def details
  @details
end

#messageString

The message describing the reason of the status. Value is:

  • Encountered a Payer Authentication problem. Payer could not be setup.

Returns:

  • (String)


32
33
34
# File 'lib/cyber_source_merged_spec/exceptions/risk_v1_authentications_post400_response_exception.rb', line 32

def message
  @message
end

#reasonString

The reason of the status.

Returns:

  • (String)


27
28
29
# File 'lib/cyber_source_merged_spec/exceptions/risk_v1_authentications_post400_response_exception.rb', line 27

def reason
  @reason
end

#statusString

The status for payerAuthentication 400 setup calls. Possible values are:

  • INVALID_REQUEST

Returns:

  • (String)


23
24
25
# File 'lib/cyber_source_merged_spec/exceptions/risk_v1_authentications_post400_response_exception.rb', line 23

def status
  @status
end

#submit_time_utcString

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.

Returns:

  • (String)


18
19
20
# File 'lib/cyber_source_merged_spec/exceptions/risk_v1_authentications_post400_response_exception.rb', line 18

def submit_time_utc
  @submit_time_utc
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



79
80
81
82
83
# File 'lib/cyber_source_merged_spec/exceptions/risk_v1_authentications_post400_response_exception.rb', line 79

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_sObject

Provides a human-readable string representation of the object.



72
73
74
75
76
# File 'lib/cyber_source_merged_spec/exceptions/risk_v1_authentications_post400_response_exception.rb', line 72

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.

Parameters:

  • hash (Hash)

    The deserialized response sent by the server in the



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/cyber_source_merged_spec/exceptions/risk_v1_authentications_post400_response_exception.rb', line 51

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