lib/amazon_flex_pay/util.rb
def query_string(params, prefix = nil) #:nodoc:
      prefix = "#{prefix}." if prefix
      params.keys.sort { |a, b| a.to_s <=> b.to_s }.collect do |key|
        case val = params[key]
          when Hash
          query_string(val, key)
          else
          "#{prefix}#{key}=#{escape val}"
        end
      end.join('&')
    end
def query_string(params, prefix = nil) #:nodoc:
      prefix = "#{prefix}." if prefix
      params.keys.sort { |a, b| a.to_s <=> b.to_s }.collect do |key|
        case val = params[key]
          when Hash
          query_string(val, key)
          else
          "#{prefix}#{key}=#{escape val}"
        end
      end.join('&')
    end
Flattens a possibly-nested hash into a query string for Amazon.
 With Amazon, nested hashes are flattened with a period, as follows:

   AmazonFlexPay::Util.query_string(:foo => {:hello => 'world'})
   => "foo.hello=world"