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 +4 -4
- data/.rubocop_todo.yml +1 -1
- data/CHANGELOG.md +3 -0
- data/VERSION +1 -1
- data/lib/stripe/stripe_client.rb +21 -0
- data/lib/stripe/version.rb +1 -1
- data/test/stripe/invoice_test.rb +5 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c8260e6865f7cede359b5b5ed870afa289df71b22ec9cb54ee2fd4d2ad7180f
|
4
|
+
data.tar.gz: 7e34b13f458beb6da7efe8860733163e097cb7a0b186ef18aacdf558ec25993d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23733735e3c7835e743208ee72aff1c0c71bc9c424feace8995d3691f86efb9ce61773adb349b18060bfdb32893dd157c37bffdf7f83785cbec920d9f1520453
|
7
|
+
data.tar.gz: e63472b1c8a9a16a0c6974c65fae0d5c664a9c7e9ef53c99285641bd95532b5da0de8007946b0490d96f920fa8af7dbd5707505c3af7611f31b8fbd77b80e97a
|
data/.rubocop_todo.yml
CHANGED
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.
|
1
|
+
4.7.1
|
data/lib/stripe/stripe_client.rb
CHANGED
@@ -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
|
data/lib/stripe/version.rb
CHANGED
data/test/stripe/invoice_test.rb
CHANGED
@@ -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
|
-
|
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.
|
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
|
11
|
+
date: 2019-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|