stripe 4.9.0 → 4.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +5 -1
- data/VERSION +1 -1
- data/lib/stripe/stripe_object.rb +19 -1
- data/lib/stripe/version.rb +1 -1
- data/test/stripe/account_test.rb +7 -2
- data/test/stripe/api_resource_test.rb +14 -12
- data/test/test_helper.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05b0bfe8d9b4817553b20b94c660d08bdbcf0bec1b8c655636393e9288ac5ee2
|
4
|
+
data.tar.gz: 6a41f5b4709736df4e25c402d2171404b34ea8f6f92e7b1f4c22a8232bfe7b89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04a895d4d2f11ad5d9c74e3d99a2a7b9dddd46629e2df8413fd9370e5cfc8b11592232e0cb5982b01d9fca7ac6b5fb5cfc827646e725c8b9ce3e55a83bc0f9c6
|
7
|
+
data.tar.gz: cabfe746220087d68288f31636fa5eace4d00a36a5add7791fa7676751df4d81175d7a325818a9afe87a99849c7decfbd6e1d39829b967c482379ed2bde3b285
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 4.9.1 - 2019-03-18
|
4
|
+
* [#750](https://github.com/stripe/stripe-ruby/pull/750) Catch error and warn if unable to remove a method
|
5
|
+
|
3
6
|
## 4.9.0 - 2019-02-12
|
4
7
|
* [#739](https://github.com/stripe/stripe-ruby/pull/739) Add support for `SubscriptionSchedule` and `SubscriptionScheduleRevision`
|
5
8
|
|
@@ -208,7 +211,8 @@
|
|
208
211
|
* Handle `invalid_client` OAuth error code
|
209
212
|
* Improve safety of error handling logic safer for unrecognized OAuth error codes
|
210
213
|
|
211
|
-
## 3.0.2 - 2017-07-12
|
214
|
+
## 3.0.2 - 2017-07-12
|
215
|
+
**Important:** This version is non-functional and has been yanked in favor of 3.0.3.
|
212
216
|
* Convert `nil` to empty string when serializing parameters (instead of opaquely dropping it) -- NOTE: this change has since been reverted
|
213
217
|
|
214
218
|
## 3.0.1 - 2017-07-11
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.9.
|
1
|
+
4.9.1
|
data/lib/stripe/stripe_object.rb
CHANGED
@@ -298,7 +298,25 @@ module Stripe
|
|
298
298
|
|
299
299
|
# Remove methods for the accessor's reader and writer.
|
300
300
|
[k, :"#{k}=", :"#{k}?"].each do |method_name|
|
301
|
-
|
301
|
+
next unless method_defined?(method_name)
|
302
|
+
|
303
|
+
begin
|
304
|
+
remove_method(method_name)
|
305
|
+
rescue NameError
|
306
|
+
# In some cases there can be a method that's detected with
|
307
|
+
# `method_defined?`, but which cannot be removed with
|
308
|
+
# `remove_method`, even though it's on the same class. The only
|
309
|
+
# case so far that we've noticed this is when a class is
|
310
|
+
# reopened for monkey patching:
|
311
|
+
#
|
312
|
+
# https://github.com/stripe/stripe-ruby/issues/749
|
313
|
+
#
|
314
|
+
# Here we swallow that error and issue a warning so at least
|
315
|
+
# the program doesn't crash.
|
316
|
+
$stderr.puts("WARNING: Unable to remove method `#{method_name}`; " \
|
317
|
+
"if custom, please consider renaming to a name that doesn't " \
|
318
|
+
"collide with an API property name.")
|
319
|
+
end
|
302
320
|
end
|
303
321
|
end
|
304
322
|
end
|
data/lib/stripe/version.rb
CHANGED
data/test/stripe/account_test.rb
CHANGED
@@ -100,7 +100,12 @@ module Stripe
|
|
100
100
|
|
101
101
|
context "#legal_entity=" do
|
102
102
|
should "disallow direct overrides" do
|
103
|
-
account = Stripe::Account.
|
103
|
+
account = Stripe::Account.construct_from(
|
104
|
+
id: "acct_123",
|
105
|
+
legal_entity: {
|
106
|
+
first_name: "name",
|
107
|
+
}
|
108
|
+
)
|
104
109
|
|
105
110
|
assert_raise NoMethodError do
|
106
111
|
account.legal_entity = { first_name: "Blah" }
|
@@ -111,7 +116,7 @@ module Stripe
|
|
111
116
|
end
|
112
117
|
|
113
118
|
context "#serialize_params" do
|
114
|
-
should "serialize
|
119
|
+
should "serialize a new additional_owners" do
|
115
120
|
obj = Stripe::Util.convert_to_stripe_object({
|
116
121
|
object: "account",
|
117
122
|
legal_entity: Stripe::StripeObject.construct_from({
|
@@ -375,20 +375,22 @@ module Stripe
|
|
375
375
|
end
|
376
376
|
|
377
377
|
should "correctly handle replaced nested objects" do
|
378
|
-
acct = Stripe::Account.construct_from(
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
378
|
+
acct = Stripe::Account.construct_from(
|
379
|
+
id: "acct_123",
|
380
|
+
company: {
|
381
|
+
name: "company_name",
|
382
|
+
address: {
|
383
|
+
line1: "test",
|
384
|
+
city: "San Francisco",
|
385
|
+
},
|
386
|
+
}
|
387
|
+
)
|
388
|
+
|
389
|
+
stub_request(:post, "#{Stripe.api_base}/v1/accounts/acct_123")
|
390
|
+
.with(body: { company: { address: { line1: "Test2", city: "" } } })
|
389
391
|
.to_return(body: JSON.generate("id" => "my_id"))
|
390
392
|
|
391
|
-
acct.
|
393
|
+
acct.company.address = { line1: "Test2" }
|
392
394
|
acct.save
|
393
395
|
end
|
394
396
|
|
data/test/test_helper.rb
CHANGED
@@ -17,7 +17,7 @@ require ::File.expand_path("../test_data", __FILE__)
|
|
17
17
|
require ::File.expand_path("../stripe_mock", __FILE__)
|
18
18
|
|
19
19
|
# If changing this number, please also change it in `.travis.yml`.
|
20
|
-
MOCK_MINIMUM_VERSION = "0.
|
20
|
+
MOCK_MINIMUM_VERSION = "0.47.0".freeze
|
21
21
|
MOCK_PORT = Stripe::StripeMock.start
|
22
22
|
|
23
23
|
# Disable all real network connections except those that are outgoing to
|
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.9.
|
4
|
+
version: 4.9.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-
|
11
|
+
date: 2019-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -253,8 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
253
253
|
- !ruby/object:Gem::Version
|
254
254
|
version: '0'
|
255
255
|
requirements: []
|
256
|
-
|
257
|
-
rubygems_version: 2.7.7
|
256
|
+
rubygems_version: 3.0.3
|
258
257
|
signing_key:
|
259
258
|
specification_version: 4
|
260
259
|
summary: Ruby bindings for the Stripe API
|