lib/stripe/util.rb in stripe-13.1.2 vs lib/stripe/util.rb in stripe-13.2.0.pre.beta.1

- old
+ new

@@ -257,11 +257,11 @@ result = [] value.each_with_index do |elem, i| if elem.is_a?(Hash) result += flatten_params(elem, api_mode, "#{calculated_key}[#{i}]") elsif elem.is_a?(Array) - result += flatten_params_array(elem, api_mode, calculated_key) + result += flatten_params_array(elem, calculated_key, api_mode) else result << if api_mode == :v2 [calculated_key, elem] else ["#{calculated_key}[#{i}]", elem] @@ -298,10 +298,16 @@ def self.normalize_opts(opts) case opts when String { api_key: opts } when Hash - check_api_key!(opts.fetch(:api_key)) if opts.key?(:api_key) + # If the user is using request signing for authentication, + # no need to check the api_key per request. + if !(opts.key?(:client) && + opts.fetch(:client).config.authenticator) && + opts.key?(:api_key) + check_api_key!(opts.fetch(:api_key)) + end # Explicitly use dup here instead of clone to avoid preserving freeze # state on input params. opts.dup else raise TypeError, "normalize_opts expects a string or a hash"