stripe 4.19.0 → 4.20.0
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/CHANGELOG.md +3 -0
- data/README.md +62 -25
- data/VERSION +1 -1
- data/lib/stripe.rb +1 -1
- data/lib/stripe/version.rb +1 -1
- 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: 410f62f787eb7bf6284fdc2b3b2e722b5d804b58ac24594d4001f89a5e8f915c
|
4
|
+
data.tar.gz: ae1f9e13178bb81ada414ef131e57fc6a34e3592d6163d70175d5b7c655f8d6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd074e764a3dc6ca94873982b25c3427319ad1d58842d846dc8888383e2bad2eb22b31f6bbce370ecb6c20d643091cd79b355aff83e0c25affb46c00dbf2e8a3
|
7
|
+
data.tar.gz: c16a7d1aeb72497f1abc2a89b70509fc94b2d8581b3a7cad3ce317ff6021c4b80514342a395f711a527cc45ccc2ed65f309de45e69dad32ce1feae4c2dad11d7
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 4.20.0 - 2019-06-24
|
4
|
+
* [#800](https://github.com/stripe/stripe-ruby/pull/800) Enable request latency telemetry by default
|
5
|
+
|
3
6
|
## 4.19.0 - 2019-06-17
|
4
7
|
* [#770](https://github.com/stripe/stripe-ruby/pull/770) Add support for `CustomerBalanceTransaction` resource and APIs
|
5
8
|
|
data/README.md
CHANGED
@@ -11,11 +11,11 @@ API.
|
|
11
11
|
|
12
12
|
The library also provides other features. For example:
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
- Easy configuration path for fast setup and use.
|
15
|
+
- Helpers for pagination.
|
16
|
+
- Tracking of "fresh" values in API resources so that partial updates can be
|
17
17
|
executed.
|
18
|
-
|
18
|
+
- Built-in mechanisms for the serialization of parameters according to the
|
19
19
|
expectations of Stripe's API.
|
20
20
|
|
21
21
|
## Documentation
|
@@ -27,15 +27,19 @@ See the [Ruby API docs](https://stripe.com/docs/api/ruby#intro).
|
|
27
27
|
You don't need this source code unless you want to modify the gem. If you just
|
28
28
|
want to use the package, just run:
|
29
29
|
|
30
|
-
|
30
|
+
```sh
|
31
|
+
gem install stripe
|
32
|
+
```
|
31
33
|
|
32
34
|
If you want to build the gem from source:
|
33
35
|
|
34
|
-
|
36
|
+
```sh
|
37
|
+
gem build stripe.gemspec
|
38
|
+
```
|
35
39
|
|
36
40
|
### Requirements
|
37
41
|
|
38
|
-
|
42
|
+
- Ruby 2.1+.
|
39
43
|
|
40
44
|
### Bundler
|
41
45
|
|
@@ -43,7 +47,7 @@ If you are installing via bundler, you should be sure to use the https rubygems
|
|
43
47
|
source in your Gemfile, as any gems fetched over http could potentially be
|
44
48
|
compromised in transit and alter the code of gems fetched securely over https:
|
45
49
|
|
46
|
-
```
|
50
|
+
```ruby
|
47
51
|
source 'https://rubygems.org'
|
48
52
|
|
49
53
|
gem 'rails'
|
@@ -56,7 +60,7 @@ The library needs to be configured with your account's secret key which is
|
|
56
60
|
available in your [Stripe Dashboard][api-keys]. Set `Stripe.api_key` to its
|
57
61
|
value:
|
58
62
|
|
59
|
-
```
|
63
|
+
```ruby
|
60
64
|
require "stripe"
|
61
65
|
Stripe.api_key = "sk_test_..."
|
62
66
|
|
@@ -75,7 +79,7 @@ For apps that need to use multiple keys during the lifetime of a process, like
|
|
75
79
|
one that uses [Stripe Connect][connect], it's also possible to set a
|
76
80
|
per-request key and/or account:
|
77
81
|
|
78
|
-
```
|
82
|
+
```ruby
|
79
83
|
require "stripe"
|
80
84
|
|
81
85
|
Stripe::Charge.list(
|
@@ -114,7 +118,7 @@ While a default HTTP client is used by default, it's also possible to have the
|
|
114
118
|
library use any client supported by [Faraday][faraday] by initializing a
|
115
119
|
`Stripe::StripeClient` object and giving it a connection:
|
116
120
|
|
117
|
-
```
|
121
|
+
```ruby
|
118
122
|
conn = Faraday.new
|
119
123
|
client = Stripe::StripeClient.new(conn)
|
120
124
|
charge, resp = client.request do
|
@@ -138,7 +142,9 @@ Stripe.proxy = "https://user:pass@example.com:1234"
|
|
138
142
|
By default, the library will use the API version pinned to the account making
|
139
143
|
a request. This can be overridden with this global option:
|
140
144
|
|
141
|
-
|
145
|
+
```ruby
|
146
|
+
Stripe.api_version = "2018-02-28"
|
147
|
+
```
|
142
148
|
|
143
149
|
See [versioning in the API reference][versioning] for more information.
|
144
150
|
|
@@ -147,14 +153,18 @@ See [versioning in the API reference][versioning] for more information.
|
|
147
153
|
By default, the library will use its own internal bundle of known CA
|
148
154
|
certificates, but it's possible to configure your own:
|
149
155
|
|
150
|
-
|
156
|
+
```ruby
|
157
|
+
Stripe.ca_bundle_path = "path/to/ca/bundle"
|
158
|
+
```
|
151
159
|
|
152
160
|
### Configuring Automatic Retries
|
153
161
|
|
154
162
|
The library can be configured to automatically retry requests that fail due to
|
155
163
|
an intermittent network problem:
|
156
164
|
|
157
|
-
|
165
|
+
```ruby
|
166
|
+
Stripe.max_network_retries = 2
|
167
|
+
```
|
158
168
|
|
159
169
|
[Idempotency keys][idempotency-keys] are added to requests to guarantee that
|
160
170
|
retries are safe.
|
@@ -163,7 +173,7 @@ retries are safe.
|
|
163
173
|
|
164
174
|
Open and read timeouts are configurable:
|
165
175
|
|
166
|
-
```
|
176
|
+
```ruby
|
167
177
|
Stripe.open_timeout = 30 // in seconds
|
168
178
|
Stripe.read_timeout = 80
|
169
179
|
```
|
@@ -181,12 +191,14 @@ production use, but `debug` is also available for more verbosity.
|
|
181
191
|
There are a few options for enabling it:
|
182
192
|
|
183
193
|
1. Set the environment variable `STRIPE_LOG` to the value `debug` or `info`:
|
184
|
-
|
194
|
+
|
195
|
+
```sh
|
185
196
|
$ export STRIPE_LOG=info
|
186
197
|
```
|
187
198
|
|
188
199
|
2. Set `Stripe.log_level`:
|
189
|
-
|
200
|
+
|
201
|
+
```ruby
|
190
202
|
Stripe.log_level = Stripe::LEVEL_INFO
|
191
203
|
```
|
192
204
|
|
@@ -195,39 +207,64 @@ There are a few options for enabling it:
|
|
195
207
|
If you're writing a plugin that uses the library, we'd appreciate it if you
|
196
208
|
identified using `#set_app_info`:
|
197
209
|
|
198
|
-
|
210
|
+
```ruby
|
211
|
+
Stripe.set_app_info("MyAwesomePlugin", version: "1.2.34", url: "https://myawesomeplugin.info");
|
212
|
+
```
|
199
213
|
|
200
214
|
This information is passed along when the library makes calls to the Stripe
|
201
215
|
API.
|
202
216
|
|
217
|
+
### Request latency telemetry
|
218
|
+
|
219
|
+
By default, the library sends request latency telemetry to Stripe. These
|
220
|
+
numbers help Stripe improve the overall latency of its API for all users.
|
221
|
+
|
222
|
+
You can disable this behavior if you prefer:
|
223
|
+
|
224
|
+
```ruby
|
225
|
+
Stripe.enable_telemetry = false
|
226
|
+
```
|
227
|
+
|
203
228
|
## Development
|
204
229
|
|
205
230
|
The test suite depends on [stripe-mock], so make sure to fetch and run it from a
|
206
231
|
background terminal ([stripe-mock's README][stripe-mock] also contains
|
207
232
|
instructions for installing via Homebrew and other methods):
|
208
233
|
|
209
|
-
|
210
|
-
|
234
|
+
```sh
|
235
|
+
go get -u github.com/stripe/stripe-mock
|
236
|
+
stripe-mock
|
237
|
+
```
|
211
238
|
|
212
239
|
Run all tests:
|
213
240
|
|
214
|
-
|
241
|
+
```sh
|
242
|
+
bundle exec rake test
|
243
|
+
```
|
215
244
|
|
216
245
|
Run a single test suite:
|
217
246
|
|
218
|
-
|
247
|
+
```sh
|
248
|
+
bundle exec ruby -Ilib/ test/stripe/util_test.rb
|
249
|
+
```
|
219
250
|
|
220
251
|
Run a single test:
|
221
252
|
|
222
|
-
|
253
|
+
```sh
|
254
|
+
bundle exec ruby -Ilib/ test/stripe/util_test.rb -n /should.convert.names.to.symbols/
|
255
|
+
```
|
223
256
|
|
224
257
|
Run the linter:
|
225
258
|
|
226
|
-
|
259
|
+
```sh
|
260
|
+
bundle exec rake rubocop
|
261
|
+
```
|
227
262
|
|
228
263
|
Update bundled CA certificates from the [Mozilla cURL release][curl]:
|
229
264
|
|
230
|
-
|
265
|
+
```sh
|
266
|
+
bundle exec rake update_certs
|
267
|
+
```
|
231
268
|
|
232
269
|
Update the bundled [stripe-mock] by editing the version number found in
|
233
270
|
`.travis.yml`.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.
|
1
|
+
4.20.0
|
data/lib/stripe.rb
CHANGED
data/lib/stripe/version.rb
CHANGED
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.
|
4
|
+
version: 4.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|