diff --git a/CHANGELOG.md b/CHANGELOG.md index 99471907d..2d9c7a2c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,12 @@ # Changelog +## 13.2.0 - 2024-11-20 +* [#1486](https://github.com/stripe/stripe-ruby/pull/1486) This release changes the pinned API version to `2024-11-20.acacia`. + * Add support for `respond` test helper method on resource `Issuing.Authorization` + ## 13.2.0-beta.3 - 2024-11-14 * [#1484](https://github.com/stripe/stripe-ruby/pull/1484) Update generated code for beta - ## 13.2.0-beta.2 - 2024-11-07 * [#1480](https://github.com/stripe/stripe-ruby/pull/1480) Update generated code for beta * Add support for new resources `Issuing.FraudLiabilityDebit`, `PaymentAttemptRecord`, and `PaymentRecord` @@ -14,9 +17,11 @@ * [#1477](https://github.com/stripe/stripe-ruby/pull/1477) Update generated code for beta * Add support for `trigger_action` method on resource `PaymentIntent` +## 13.1.2 - 2024-11-15 +* [#1488](https://github.com/stripe/stripe-ruby/pull/1488) Fix incorrect key in param encoding + ## 13.1.1 - 2024-11-06 * [#1483](https://github.com/stripe/stripe-ruby/pull/1483) Fix APIResource#retrieve not sending `stripe_version` -* [#1478](https://github.com/stripe/stripe-ruby/pull/1478) Update changelog with a note on 2024-10-28.acacia API version ## 13.1.0 - 2024-10-29 * [#1472](https://github.com/stripe/stripe-ruby/pull/1472) This release changes the pinned API version to `2024-10-28.acacia`. diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 71fc9b78c..038066775 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1345 \ No newline at end of file +v1370 \ No newline at end of file diff --git a/lib/stripe/util.rb b/lib/stripe/util.rb index 8ddd948c2..af672a7d9 100644 --- a/lib/stripe/util.rb +++ b/lib/stripe/util.rb @@ -259,7 +259,7 @@ def self.flatten_params_array(value, api_mode, calculated_key) if elem.is_a?(Hash) result += flatten_params(elem, api_mode, "#{calculated_key}[#{i}]") elsif elem.is_a?(Array) - result += flatten_params_array(elem, calculated_key, api_mode) + result += flatten_params_array(elem, api_mode, calculated_key) else result << if api_mode == :v2 [calculated_key, elem] diff --git a/test/stripe/util_test.rb b/test/stripe/util_test.rb index 900c37fb3..8e5f56082 100644 --- a/test/stripe/util_test.rb +++ b/test/stripe/util_test.rb @@ -16,6 +16,7 @@ class UtilTest < Test::Unit::TestCase # NOTE: the empty hash won't even show up in the request g: [], + } assert_equal( "a=3&b=%2Bfoo%3F&c=bar%26baz&d[a]=a&d[b]=b&e[0]=0&e[1]=1&f=", @@ -23,6 +24,16 @@ class UtilTest < Test::Unit::TestCase ) end + should "correctly represent nested arrays" do + params = { + a: [[foo: "bar", baz: "qux"]], + } + assert_equal( + "a[0][foo]=bar&a[0][baz]=qux", + Stripe::Util.encode_parameters(params, :v1) + ) + end + should "use correct array expansion for v2 query params" do params = { d: { a: "a", b: "b" },