lib/recurly/schema/json_parser.rb in recurly-3.1.2 vs lib/recurly/schema/json_parser.rb in recurly-3.1.3
- old
+ new
@@ -25,20 +25,20 @@
#
# @param data [Hash] The parsed JSON data
# @return [Error,Resource]
def self.from_json(data)
type = if data.has_key?("error")
- "error"
+ "error_may_have_transaction"
else
data["object"]
end
klazz = self.recurly_class(type)
unless klazz
raise ArgumentError, "Unknown resource for json type #{type}"
end
- data = data["error"] if klazz == Resources::Error
+ data = data["error"] if klazz == Resources::ErrorMayHaveTransaction
klazz.cast(data)
end
# Returns the Recurly ruby class responsible for the Recurly json key.