Class: Worldline::Connect::SDK::V1::Domain::PaymentErrorResponse
- Inherits:
-
Domain::DataObject
- Object
- Domain::DataObject
- Worldline::Connect::SDK::V1::Domain::PaymentErrorResponse
- Defined in:
- lib/worldline/connect/sdk/v1/domain/payment_error_response.rb
Instance Attribute Summary collapse
-
#error_id ⇒ String
The current value of error_id.
-
#errors ⇒ Array<Worldline::Connect::SDK::V1::Domain::APIError>
The current value of errors.
-
#payment_result ⇒ Worldline::Connect::SDK::V1::Domain::CreatePaymentResult
The current value of payment_result.
Instance Method Summary collapse
Methods inherited from Domain::DataObject
Instance Attribute Details
#error_id ⇒ String
Returns the current value of error_id.
17 18 19 |
# File 'lib/worldline/connect/sdk/v1/domain/payment_error_response.rb', line 17 def error_id @error_id end |
#errors ⇒ Array<Worldline::Connect::SDK::V1::Domain::APIError>
Returns the current value of errors.
17 18 19 |
# File 'lib/worldline/connect/sdk/v1/domain/payment_error_response.rb', line 17 def errors @errors end |
#payment_result ⇒ Worldline::Connect::SDK::V1::Domain::CreatePaymentResult
Returns the current value of payment_result.
17 18 19 |
# File 'lib/worldline/connect/sdk/v1/domain/payment_error_response.rb', line 17 def payment_result @payment_result end |
Instance Method Details
#from_hash(hash) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/worldline/connect/sdk/v1/domain/payment_error_response.rb', line 34 def from_hash(hash) super if hash.has_key? 'errorId' @error_id = hash['errorId'] end if hash.has_key? 'errors' raise TypeError, "value '%s' is not an Array" % [hash['errors']] unless hash['errors'].is_a? Array @errors = [] hash['errors'].each do |e| @errors << Worldline::Connect::SDK::V1::Domain::APIError.new_from_hash(e) end end if hash.has_key? 'paymentResult' raise TypeError, "value '%s' is not a Hash" % [hash['paymentResult']] unless hash['paymentResult'].is_a? Hash @payment_result = Worldline::Connect::SDK::V1::Domain::CreatePaymentResult.new_from_hash(hash['paymentResult']) end end |
#to_h ⇒ Hash
26 27 28 29 30 31 32 |
# File 'lib/worldline/connect/sdk/v1/domain/payment_error_response.rb', line 26 def to_h hash = super hash['errorId'] = @error_id unless @error_id.nil? hash['errors'] = @errors.collect{|val| val.to_h} unless @errors.nil? hash['paymentResult'] = @payment_result.to_h unless @payment_result.nil? hash end |