mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-04 00:00:47 -04:00
If specifying both query parameters in a path/URL down to Faraday (e.g., `/v1/invoices/upcoming?coupon=25OFF`) _and_ query parameters in a hash (e.g., `{ customer: "cus_123" }`), it will silently overwrite the ones in the path with the ones in the hash. This can cause problems where some critical parameters are discarded and causes an error, as seen in issue #646. This patch modifies `#execute_request` so that before going out to Faraday we check whether the incoming path has query parameters. If it does, we decode them and add them to our `query_params` hash so that all parameters from either place are preserved. Fixes #646.