stripe 4.7.0 → 4.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b17c2d9db8be7ccd4a37eb6ad3b17ab7ee1ec20610b390953f0735547c5dc81
4
- data.tar.gz: c38f3a4b02c97cbe2f2f9121e1c50fd2bcbe0abd760f7509fbdd48a19d544b37
3
+ metadata.gz: 7c8260e6865f7cede359b5b5ed870afa289df71b22ec9cb54ee2fd4d2ad7180f
4
+ data.tar.gz: 7e34b13f458beb6da7efe8860733163e097cb7a0b186ef18aacdf558ec25993d
5
5
  SHA512:
6
- metadata.gz: 03b19f6e689b28d628b043fa2afadbcb77a22c762062a41537563cb3abc9b5cb037c7b4ee58ac64bd34bef9fcef1f466abe00a47002b8d10b95643c9c9880ad7
7
- data.tar.gz: d363f4dd535118bf0759e24efd5c7124fd0c633bfcd83deb5b704e5cbeba3ba8c0d910a14ed35c5206b83cec4751daa5decb6c518ed781703539b07562ce840b
6
+ metadata.gz: 23733735e3c7835e743208ee72aff1c0c71bc9c424feace8995d3691f86efb9ce61773adb349b18060bfdb32893dd157c37bffdf7f83785cbec920d9f1520453
7
+ data.tar.gz: e63472b1c8a9a16a0c6974c65fae0d5c664a9c7e9ef53c99285641bd95532b5da0de8007946b0490d96f920fa8af7dbd5707505c3af7611f31b8fbd77b80e97a
data/.rubocop_todo.yml CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  # Offense count: 19
10
10
  Metrics/AbcSize:
11
- Max: 52
11
+ Max: 53.26
12
12
 
13
13
  # Offense count: 27
14
14
  # Configuration parameters: CountComments, ExcludedMethods.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.7.1 - 2019-02-01
4
+ * [#740](https://github.com/stripe/stripe-ruby/pull/740) Fix query encoding for integer-indexed maps
5
+
3
6
  ## 4.7.0 - 2019-01-23
4
7
  * [#735](https://github.com/stripe/stripe-ruby/pull/735) Rename `CheckoutSession` to `Session` and move it under the `Checkout` namespace. This is a breaking change, but we've reached out to affected merchants and all new merchants would use the new approach.
5
8
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.7.0
1
+ 4.7.1
@@ -178,7 +178,10 @@ module Stripe
178
178
  http_resp = execute_request_with_rescues(api_base, context) do
179
179
  conn.run_request(method, url, body, headers) do |req|
180
180
  req.options.open_timeout = Stripe.open_timeout
181
+ req.options.params_encoder = FaradayStripeEncoder
181
182
  req.options.timeout = Stripe.read_timeout
183
+
184
+ # note that these will be passed through `FaradayStripeEncoder`
182
185
  req.params = query_params unless query_params.nil?
183
186
  end
184
187
  end
@@ -196,6 +199,24 @@ module Stripe
196
199
 
197
200
  private
198
201
 
202
+ # Used to workaround buggy behavior in Faraday: the library will try to
203
+ # reshape anything that we pass to `req.params` with one of its default
204
+ # encoders. I don't think this process is supposed to be lossy, but it is
205
+ # -- in particular when we send our integer-indexed maps (i.e. arrays),
206
+ # Faraday ends up stripping out the integer indexes.
207
+ #
208
+ # We work around the problem by implementing our own simplified decoder and
209
+ # telling Faraday to use that.
210
+ class FaradayStripeEncoder
211
+ def self.encode(hash)
212
+ Util.encode_parameters(hash)
213
+ end
214
+
215
+ def self.decode(_str)
216
+ raise NotImplementedError, "#{self.class.name} does not implement #decode"
217
+ end
218
+ end
219
+
199
220
  def api_url(url = "", api_base = nil)
200
221
  (api_base || Stripe.api_base) + url
201
222
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "4.7.0".freeze
4
+ VERSION = "4.7.1".freeze
5
5
  end
@@ -113,10 +113,10 @@ module Stripe
113
113
  end
114
114
 
115
115
  should "retrieve upcoming invoices with items" do
116
- items = [{
117
- plan: "gold",
118
- quantity: 2,
119
- },]
116
+ items = [
117
+ { plan: "gold", quantity: 2 },
118
+ { id: "si_123", deleted: true },
119
+ ]
120
120
 
121
121
  invoice = Stripe::Invoice.upcoming(
122
122
  customer: "cus_123",
@@ -128,6 +128,7 @@ module Stripe
128
128
  customer: "cus_123",
129
129
  subscription_items: [
130
130
  { plan: "gold", quantity: "2" },
131
+ { id: "si_123", deleted: true },
131
132
  ],
132
133
  }
133
134
  assert invoice.is_a?(Stripe::Invoice)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.7.0
4
+ version: 4.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-23 00:00:00.000000000 Z
11
+ date: 2019-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday