class Pin::Error
Attributes
Possible Responses
200 - (OK) Successful request 422 - (invalid_resource) One or more parameters were missing or invalid 400 - (card_declined) The card was declined 400 - (insufficient_funds) Bad api_key or not authorized to access a resource. 400 - (suspected_fraud) The resource requested doesn’t exist. 400 - (expired_card) Clever screwed up. 404 - (resource_not_found) No resource was found at this URL. 500 - Server errors
Possible Responses
200 - (OK) Successful request 422 - (invalid_resource) One or more parameters were missing or invalid 400 - (card_declined) The card was declined 400 - (insufficient_funds) Bad api_key or not authorized to access a resource. 400 - (suspected_fraud) The resource requested doesn’t exist. 400 - (expired_card) Clever screwed up. 404 - (resource_not_found) No resource was found at this URL. 500 - Server errors
Public Class Methods
# File lib/pin/error.rb, line 18 def initialize(status, json_body) @status = status @json_body = JSON.parse(json_body) end
Public Instance Methods
# File lib/pin/error.rb, line 31 def details @json_body end
# File lib/pin/error.rb, line 23 def error @json_body['error'] end
# File lib/pin/error.rb, line 27 def error_description @json_body['error_description'] end
# File lib/pin/error.rb, line 35 def to_s "HTTP Error #{@status}: #{error}" end