Class: InterApi::PaymentError
- Inherits:
-
Object
- Object
- InterApi::PaymentError
- Defined in:
- lib/inter_api/payment_error.rb
Constant Summary collapse
- STATUS_ERROR =
[400, 403, 404, 503]
Instance Attribute Summary collapse
-
#json_response ⇒ Object
Returns the value of attribute json_response.
Instance Method Summary collapse
-
#initialize(json_response) ⇒ PaymentError
constructor
A new instance of PaymentError.
- #internal_error ⇒ Object
Constructor Details
#initialize(json_response) ⇒ PaymentError
Returns a new instance of PaymentError.
5 6 7 |
# File 'lib/inter_api/payment_error.rb', line 5 def initialize json_response @json_response = json_response end |
Instance Attribute Details
#json_response ⇒ Object
Returns the value of attribute json_response.
4 5 6 |
# File 'lib/inter_api/payment_error.rb', line 4 def json_response @json_response end |
Instance Method Details
#internal_error ⇒ Object
9 10 11 12 |
# File 'lib/inter_api/payment_error.rb', line 9 def internal_error return nil unless json_response["violacoes"] || STATUS_ERROR.include?(json_response["status"]) || || "Pagamento recusado." end |