mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-06-01 00:00:30 -04:00
This produces an error when we detect an "array of maps" that cannot be encoded with `application/x-www-form-urlencoded`; that is to say, one that does not have each hash starting with a consistent key that will allow a Rack-compliant server to recognize boundaries. So for example, this is fine: ``` items: [ { :type => 'sku', :parent => 'sku_94ZYSC0wppRTbk' }, { :type => 'discount', :amount => -10000, :currency => 'cad', :description => 'potato' } ], ``` But this is _not_ okay: ``` items: [ { :type => 'sku', :parent => 'sku_94ZYSC0wppRTbk' }, { :amount => -10000, :currency => 'cad', :description => 'potato', :type => 'discount' } ], ``` (`type` should be moved to the beginning of the array.) The purpose of this change is to give users better feedback when they run into an encoding problem like this one. Currently, they just get something confusing from the server, and someone on support usually needs to examine a request log to figure out what happened. CI will fail until the changes in #453 are brought in.