Class: MpApi::PaymentError
- Inherits:
-
Object
- Object
- MpApi::PaymentError
- Defined in:
- lib/mp_api/payment_error.rb
Instance Attribute Summary collapse
-
#json_response ⇒ Object
readonly
Returns the value of attribute json_response.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(json_response:) ⇒ PaymentError
constructor
A new instance of PaymentError.
Constructor Details
#initialize(json_response:) ⇒ PaymentError
Returns a new instance of PaymentError.
5 6 7 |
# File 'lib/mp_api/payment_error.rb', line 5 def initialize(json_response:) @json_response = json_response end |
Instance Attribute Details
#json_response ⇒ Object (readonly)
Returns the value of attribute json_response.
4 5 6 |
# File 'lib/mp_api/payment_error.rb', line 4 def json_response @json_response end |
Instance Method Details
#errors ⇒ Object
9 10 11 12 |
# File 'lib/mp_api/payment_error.rb', line 9 def errors return nil unless json_response['error'] json_response['cause'].map {|cause| (cause['code']) || cause['description']} end |