diff --git a/lib/stripe/api_operations/request.rb b/lib/stripe/api_operations/request.rb index 0c350b56..d9737955 100644 --- a/lib/stripe/api_operations/request.rb +++ b/lib/stripe/api_operations/request.rb @@ -13,7 +13,16 @@ module Stripe # Assume all remaining opts must be headers response, opts[:api_key] = Stripe.request(method, url, api_key, params, headers, api_base) - [response, opts.select {|k, _| @@opts_to_persist.include?(k)}] + + # Hash#select returns an array before 1.9 + opts_to_persist = {} + opts.each do |k, v| + if @@opts_to_persist.include?(k) + opts_to_persist[k] = v + end + end + + [response, opts_to_persist] end end