lib/stripe/util.rb in stripe-1.50.0 vs lib/stripe/util.rb in stripe-1.50.1
- old
+ new
@@ -133,10 +133,10 @@
def self.flatten_params(params, parent_key=nil)
result = []
# do not sort the final output because arrays (and arrays of hashes
# especially) can be order sensitive, but do sort incoming parameters
- params.sort_by { |(k, _)| k.to_s }.each do |key, value|
+ params.each do |key, value|
calculated_key = parent_key ? "#{parent_key}[#{key}]" : "#{key}"
if value.is_a?(Hash)
result += flatten_params(value, calculated_key)
elsif value.is_a?(Array)
result += flatten_params_array(value, calculated_key)