lib/stripe/util.rb in stripe-4.16.0 vs lib/stripe/util.rb in stripe-4.17.0

- old
+ new

@@ -54,10 +54,11 @@ Balance::OBJECT_NAME => Balance, BalanceTransaction::OBJECT_NAME => BalanceTransaction, BankAccount::OBJECT_NAME => BankAccount, BitcoinReceiver::OBJECT_NAME => BitcoinReceiver, BitcoinTransaction::OBJECT_NAME => BitcoinTransaction, + Capability::OBJECT_NAME => Capability, Card::OBJECT_NAME => Card, Charge::OBJECT_NAME => Charge, Checkout::Session::OBJECT_NAME => Checkout::Session, CountrySpec::OBJECT_NAME => CountrySpec, Coupon::OBJECT_NAME => Coupon, @@ -133,9 +134,11 @@ # # * +data+ - Hash of fields and values to be converted into a StripeObject. # * +opts+ - Options for +StripeObject+ like an API key that will be reused # on subsequent API calls. def self.convert_to_stripe_object(data, opts = {}) + opts = normalize_opts(opts) + case data 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