lib/stripe/util.rb in stripe-8.3.0 vs lib/stripe/util.rb in stripe-8.4.0.pre.beta.1

- old
+ new

@@ -131,10 +131,11 @@ when Array data.map { |i| convert_to_stripe_object(i, opts) } when Hash # Try converting to a known object class. If none available, fall back # to generic StripeObject - obj = object_classes.fetch(data[:object], StripeObject) + object_name = data[:object] || data["object"] + obj = object_classes.fetch(object_name, StripeObject) .construct_from(data, opts) # set filters so that we can fetch the same limit, expansions, and # predicates when accessing the next and previous pages if obj && (obj.is_a?(SearchResultObject) || obj.is_a?(ListObject))