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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26baa8832b98118a80e495a63c9ac784ebaaf6c05a6f45470e4d2bddfd81679f
4
- data.tar.gz: 06ca6de0b1b8363ebf49df745722f095bb943105dbc22d51c688c39e9e06e4b9
3
+ metadata.gz: 05b0bfe8d9b4817553b20b94c660d08bdbcf0bec1b8c655636393e9288ac5ee2
4
+ data.tar.gz: 6a41f5b4709736df4e25c402d2171404b34ea8f6f92e7b1f4c22a8232bfe7b89
5
5
  SHA512:
6
- metadata.gz: 9c19e6198d482addce7c6a9fd6e469a6c362139ada4926901c3e0d1704283de1b746c94c13ecee944741b8a7ad60f9acd0830bda020a3516b2a485f8e260c2ee
7
- data.tar.gz: 545bd13709cb412e3c6505756eb566566d1658667c19572339811c6fd70d3425ecd0999a4d07fb1dd24bdebd5f4f4739bdf15e5a3286e058fbca1f06da884f7e
6
+ metadata.gz: 04a895d4d2f11ad5d9c74e3d99a2a7b9dddd46629e2df8413fd9370e5cfc8b11592232e0cb5982b01d9fca7ac6b5fb5cfc827646e725c8b9ce3e55a83bc0f9c6
7
+ data.tar.gz: cabfe746220087d68288f31636fa5eace4d00a36a5add7791fa7676751df4d81175d7a325818a9afe87a99849c7decfbd6e1d39829b967c482379ed2bde3b285
@@ -17,7 +17,7 @@ sudo: false
17
17
  env:
18
18
  global:
19
19
  # If changing this number, please also change it in `test/test_helper.rb`.
20
- - STRIPE_MOCK_VERSION=0.44.0
20
+ - STRIPE_MOCK_VERSION=0.47.0
21
21
 
22
22
  cache:
23
23
  directories:
@@ -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 (yanked)
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.0
1
+ 4.9.1
@@ -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
- remove_method(method_name) if method_defined?(method_name)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "4.9.0".freeze
4
+ VERSION = "4.9.1".freeze
5
5
  end
@@ -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.retrieve("acct_123")
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 an a new additional_owners" do
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(id: "myid",
379
- legal_entity: {
380
- last_name: "Smith",
381
- address: {
382
- line1: "test",
383
- city: "San Francisco",
384
- },
385
- })
386
-
387
- stub_request(:post, "#{Stripe.api_base}/v1/accounts/myid")
388
- .with(body: { legal_entity: { address: { line1: "Test2", city: "" } } })
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.legal_entity.address = { line1: "Test2" }
393
+ acct.company.address = { line1: "Test2" }
392
394
  acct.save
393
395
  end
394
396
 
@@ -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.44.0".freeze
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.0
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-02-12 00:00:00.000000000 Z
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
- rubyforge_project:
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