Class: VisaAcceptanceMergedSpec::ErrorInformation
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- VisaAcceptanceMergedSpec::ErrorInformation
- Defined in:
- lib/visa_acceptance_merged_spec/models/error_information.rb
Overview
ErrorInformation Model.
Instance Attribute Summary collapse
-
#details ⇒ Array[Detail]
The detail message related to the status and reason listed above.
-
#message ⇒ String
The detail message related to the status and reason listed above.
-
#reason ⇒ String
The reason of the status.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(reason: SKIP, message: SKIP, details: SKIP, additional_properties: nil) ⇒ ErrorInformation
constructor
A new instance of ErrorInformation.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(reason: SKIP, message: SKIP, details: SKIP, additional_properties: nil) ⇒ ErrorInformation
Returns a new instance of ErrorInformation.
82 83 84 85 86 87 88 89 90 91 |
# File 'lib/visa_acceptance_merged_spec/models/error_information.rb', line 82 def initialize(reason: SKIP, message: SKIP, details: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @reason = reason unless reason == SKIP @message = unless == SKIP @details = details unless details == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#details ⇒ Array[Detail]
The detail message related to the status and reason listed above.
57 58 59 |
# File 'lib/visa_acceptance_merged_spec/models/error_information.rb', line 57 def details @details end |
#message ⇒ String
The detail message related to the status and reason listed above.
53 54 55 |
# File 'lib/visa_acceptance_merged_spec/models/error_information.rb', line 53 def @message end |
#reason ⇒ String
The reason of the status. Possible values:
- AVS_FAILED
- CONTACT_PROCESSOR
- EXPIRED_CARD
- PROCESSOR_DECLINED
- INSUFFICIENT_FUND
- STOLEN_LOST_CARD
- ISSUER_UNAVAILABLE
- UNAUTHORIZED_CARD
- CVN_NOT_MATCH
- EXCEEDS_CREDIT_LIMIT
- INVALID_CVN
- BLOCKED_BY_CARDHOLDER
- DECLINED_CHECK
- BLACKLISTED_CUSTOMER
- SUSPENDED_ACCOUNT
- PAYMENT_REFUSED
- CV_FAILED
- INVALID_ACCOUNT
- GENERAL_DECLINE
- INVALID_MERCHANT_CONFIGURATION
- DECISION_PROFILE_REJECT
- SCORE_EXCEEDS_THRESHOLD
- PENDING_AUTHENTICATION
- ACH_VERIFICATION_FAILED
- DECISION_PROFILE_REVIEW
- CONSUMER_AUTHENTICATION_REQUIRED
- CONSUMER_AUTHENTICATION_FAILED
- ALLOWABLE_PIN_RETRIES_EXCEEDED
- PROCESSOR_ERROR
- CUSTOMER_WATCHLIST_MATCH
- ADDRESS_COUNTRY_WATCHLIST_MATCH
- EMAIL_COUNTRY_WATCHLIST_MATCH
- IP_COUNTRY_WATCHLIST_MATCH
- INVALID_MERCHANT_CONFIGURATION
49 50 51 |
# File 'lib/visa_acceptance_merged_spec/models/error_information.rb', line 49 def reason @reason end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/visa_acceptance_merged_spec/models/error_information.rb', line 94 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. reason = hash.key?('reason') ? hash['reason'] : SKIP = 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') # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. ErrorInformation.new(reason: reason, message: , details: details, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
60 61 62 63 64 65 66 |
# File 'lib/visa_acceptance_merged_spec/models/error_information.rb', line 60 def self.names @_hash = {} if @_hash.nil? @_hash['reason'] = 'reason' @_hash['message'] = 'message' @_hash['details'] = 'details' @_hash end |
.nullables ⇒ Object
An array for nullable fields
78 79 80 |
# File 'lib/visa_acceptance_merged_spec/models/error_information.rb', line 78 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
69 70 71 72 73 74 75 |
# File 'lib/visa_acceptance_merged_spec/models/error_information.rb', line 69 def self.optionals %w[ reason message details ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
133 134 135 136 137 |
# File 'lib/visa_acceptance_merged_spec/models/error_information.rb', line 133 def inspect class_name = self.class.name.split('::').last "<#{class_name} reason: #{@reason.inspect}, message: #{@message.inspect}, details:"\ " #{@details.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
126 127 128 129 130 |
# File 'lib/visa_acceptance_merged_spec/models/error_information.rb', line 126 def to_s class_name = self.class.name.split('::').last "<#{class_name} reason: #{@reason}, message: #{@message}, details: #{@details},"\ " additional_properties: #{@additional_properties}>" end |