Class: CyberSourceMergedSpec::PullFunds400ResponseException
- Inherits:
-
APIException
- Object
- CoreLibrary::ApiException
- APIException
- CyberSourceMergedSpec::PullFunds400ResponseException
- Defined in:
- lib/cyber_source_merged_spec/exceptions/pull_funds400_response_exception.rb
Overview
pullFunds400Response class.
Instance Attribute Summary collapse
-
#details ⇒ Array[Detail103]
The detail message related to the status and reason listed above.
-
#id ⇒ String
A unique identification number to identify the submitted request.
-
#message ⇒ String
The detail message related to the status and reason listed above.
-
#reason ⇒ String
The reason of the status.
-
#status ⇒ String
Possible values: - INVALID_REQUEST.
-
#submit_time_utc ⇒ String
Time of request in UTC.
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ PullFunds400ResponseException
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) ⇒ PullFunds400ResponseException
The constructor.
63 64 65 66 67 |
# File 'lib/cyber_source_merged_spec/exceptions/pull_funds400_response_exception.rb', line 63 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#details ⇒ Array[Detail103]
The detail message related to the status and reason listed above. Possible values:
- One or more fields in the request contains invalid data.
- The request is missing one or more required fields.
- Declined - There is a problem with your CyberSource merchant configuration.
58 59 60 |
# File 'lib/cyber_source_merged_spec/exceptions/pull_funds400_response_exception.rb', line 58 def details @details end |
#id ⇒ String
A unique identification number to identify the submitted request. It is also appended to the endpoint of the resource.
15 16 17 |
# File 'lib/cyber_source_merged_spec/exceptions/pull_funds400_response_exception.rb', line 15 def id @id end |
#message ⇒ String
The detail message related to the status and reason listed above. Possible values:
- One or more fields in the request contains invalid data.
- The request is missing one or more required fields.
- Declined - There is a problem with your CyberSource merchant configuration.
49 50 51 |
# File 'lib/cyber_source_merged_spec/exceptions/pull_funds400_response_exception.rb', line 49 def @message end |
#reason ⇒ String
The reason of the status. Possible values:
- INVALID_DATA
- MISSING_FIELD
- INVALID_MERCHANT_CONFIGURATION
- INVALID_REQUEST
- INVALID_PAYMENT_ID
40 41 42 |
# File 'lib/cyber_source_merged_spec/exceptions/pull_funds400_response_exception.rb', line 40 def reason @reason end |
#status ⇒ String
Possible values:
- INVALID_REQUEST
30 31 32 |
# File 'lib/cyber_source_merged_spec/exceptions/pull_funds400_response_exception.rb', line 30 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.
25 26 27 |
# File 'lib/cyber_source_merged_spec/exceptions/pull_funds400_response_exception.rb', line 25 def submit_time_utc @submit_time_utc end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
101 102 103 104 105 106 |
# File 'lib/cyber_source_merged_spec/exceptions/pull_funds400_response_exception.rb', line 101 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, 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.
94 95 96 97 98 |
# File 'lib/cyber_source_merged_spec/exceptions/pull_funds400_response_exception.rb', line 94 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, 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.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/cyber_source_merged_spec/exceptions/pull_funds400_response_exception.rb', line 72 def unbox(hash) return nil unless hash @id = hash.key?('id') ? hash['id'] : SKIP @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 << (Detail103.from_hash(structure) if structure) end end @details = SKIP unless hash.key?('details') end |