stripe 5.35.0 → 5.39.0

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: f51ef2fd825e626807098544261c034bf55a84cf59852a7ac1c88a213add62ca
4
- data.tar.gz: 6df0829f6b372f47393a5a22cc8aba022c40620188c0e8c3619d41965d84837b
3
+ metadata.gz: f1e54cc2d57c31541003984f4cea2ac0e6523a88974bbe060c1332ecc3b2dd13
4
+ data.tar.gz: 7834d48a4ec62a379ffba64730d81304f66185ba85d07c53c645a2239f44ac89
5
5
  SHA512:
6
- metadata.gz: 1d0c7c97de7a70c94ebd08659f6a0630f3508347772d2ed7a799778f2c08db2e6a1540a9b77b377f31edeadc6d5a874da4e084994c8ce23e4690512db083c987
7
- data.tar.gz: 180af07a05467d75b0a88907bf59a0f837981ab4cd6ca16673ec4f17bedcff33e7efcf80ff482cd14517b9a2efa25095ce018011fc82b70d62a20bddc1cd2525
6
+ metadata.gz: 30661886d59dff20441b18404bf2bfc7a9e2371c68ac20bd48700d54c36ca46f29dceb87a22764ead9fb1a128949200edefa37da12fcc81b74d337d799e1cca7
7
+ data.tar.gz: fac41913db0bcffa10c386c8ecd5cbeb6a1a542b8c73066a8b75b91f2860524adf202ffdbef92a2fd096566f35595e7633970af261858d10199a839096a0f7ba
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.39.0 - 2021-10-11
4
+ * [#1010](https://github.com/stripe/stripe-ruby/pull/1010) API Updates
5
+ * Add support for `list_payment_methods` method on resource `Customer`
6
+
7
+ ## 5.38.0 - 2021-08-10
8
+ * [#993](https://github.com/stripe/stripe-ruby/pull/993) Add `request_id` to RequestEndEvent
9
+ * [#991](https://github.com/stripe/stripe-ruby/pull/991) Codegen more files
10
+ * [#989](https://github.com/stripe/stripe-ruby/pull/989) Remove unused API error types from docs.
11
+
12
+ ## 5.37.0 - 2021-07-14
13
+ * [#988](https://github.com/stripe/stripe-ruby/pull/988) API Updates
14
+ * Add support for `list_computed_upfront_line_items` method on resource `Quote`
15
+
16
+ ## 5.36.0 - 2021-07-09
17
+ * [#987](https://github.com/stripe/stripe-ruby/pull/987) Add support for `Quote` API
18
+
3
19
  ## 5.35.0 - 2021-06-30
4
20
  * [#985](https://github.com/stripe/stripe-ruby/pull/985) Update normalize_opts to use dup instead of clone.
5
21
  * [#982](https://github.com/stripe/stripe-ruby/pull/982) Deprecate travis
data/README.md CHANGED
@@ -252,6 +252,7 @@ a success or error. Receives `RequestEndEvent` with the following properties:
252
252
  - `path`: Request path. (`String`)
253
253
  - `user_data`: A hash on which users may have set arbitrary data in
254
254
  `request_begin`. See above for more information. (`Hash`)
255
+ - `request_id`. HTTP request identifier.
255
256
 
256
257
  #### Example
257
258
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.35.0
1
+ 5.39.0
@@ -69,9 +69,8 @@ module Stripe
69
69
  @values[:source]
70
70
  end
71
71
 
72
- # The type of error returned. One of `api_connection_error`, `api_error`,
73
- # `authentication_error`, `card_error`, `idempotency_error`,
74
- # `invalid_request_error`, or `rate_limit_error`.
72
+ # The type of error returned. One of `api_error`, `card_error`,
73
+ # `idempotency_error`, or `invalid_request_error`.
75
74
  def type
76
75
  @values[:type]
77
76
  end
@@ -32,6 +32,7 @@ module Stripe
32
32
  attr_reader :method
33
33
  attr_reader :num_retries
34
34
  attr_reader :path
35
+ attr_reader :request_id
35
36
 
36
37
  # Arbitrary user-provided data in the form of a Ruby hash that's passed
37
38
  # from subscribers on `request_begin` to subscribers on `request_end`.
@@ -40,12 +41,13 @@ module Stripe
40
41
  attr_reader :user_data
41
42
 
42
43
  def initialize(duration:, http_status:, method:, num_retries:, path:,
43
- user_data: nil)
44
+ request_id:, user_data: nil)
44
45
  @duration = duration
45
46
  @http_status = http_status
46
47
  @method = method
47
48
  @num_retries = num_retries
48
49
  @path = path
50
+ @request_id = request_id
49
51
  @user_data = user_data
50
52
  freeze
51
53
  end
@@ -1,3 +1,4 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  # rubocop:disable Metrics/MethodLength
@@ -65,6 +66,7 @@ module Stripe
65
66
  Price::OBJECT_NAME => Price,
66
67
  Product::OBJECT_NAME => Product,
67
68
  PromotionCode::OBJECT_NAME => PromotionCode,
69
+ Quote::OBJECT_NAME => Quote,
68
70
  Radar::EarlyFraudWarning::OBJECT_NAME => Radar::EarlyFraudWarning,
69
71
  Radar::ValueList::OBJECT_NAME => Radar::ValueList,
70
72
  Radar::ValueListItem::OBJECT_NAME => Radar::ValueListItem,
@@ -75,10 +77,10 @@ module Stripe
75
77
  Reporting::ReportType::OBJECT_NAME => Reporting::ReportType,
76
78
  Reversal::OBJECT_NAME => Reversal,
77
79
  Review::OBJECT_NAME => Review,
78
- SKU::OBJECT_NAME => SKU,
79
80
  SetupAttempt::OBJECT_NAME => SetupAttempt,
80
81
  SetupIntent::OBJECT_NAME => SetupIntent,
81
82
  Sigma::ScheduledQueryRun::OBJECT_NAME => Sigma::ScheduledQueryRun,
83
+ SKU::OBJECT_NAME => SKU,
82
84
  Source::OBJECT_NAME => Source,
83
85
  SourceTransaction::OBJECT_NAME => SourceTransaction,
84
86
  Subscription::OBJECT_NAME => Subscription,
@@ -1,9 +1,10 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Stripe
4
5
  class ApplicationFeeRefund < APIResource
5
- include Stripe::APIOperations::Save
6
6
  extend Stripe::APIOperations::List
7
+ include Stripe::APIOperations::Save
7
8
 
8
9
  OBJECT_NAME = "fee_refund"
9
10
 
@@ -1,9 +1,10 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Stripe
5
+ # Directly retrieving BitcoinTransactions is deprecated. Please use
6
+ # the Sources API instead: https://stripe.com/docs/sources/bitcoin
4
7
  class BitcoinTransaction < APIResource
5
- # Directly retrieving BitcoinTransactions is deprecated. Please use the
6
- # Sources API instead: https://stripe.com/docs/sources/bitcoin
7
8
  extend Stripe::APIOperations::List
8
9
 
9
10
  OBJECT_NAME = "bitcoin_transaction"
@@ -1,3 +1,4 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Stripe
@@ -26,7 +27,7 @@ module Stripe
26
27
  def self.update(_id, _params = nil, _opts = nil)
27
28
  raise NotImplementedError,
28
29
  "Capabilities cannot be updated without an account ID. Update a " \
29
- "capability using Account.update_capability('account_id', " \
30
+ "capability using `Account.update_capability('account_id', " \
30
31
  "'capability_id', update_params)`"
31
32
  end
32
33
  end
@@ -1,3 +1,4 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Stripe
@@ -11,11 +11,22 @@ module Stripe
11
11
 
12
12
  OBJECT_NAME = "customer"
13
13
 
14
+ custom_method :list_payment_methods, http_verb: :get, http_path: "payment_methods"
15
+
14
16
  nested_resource_class_methods :balance_transaction,
15
17
  operations: %i[create retrieve update list]
16
18
  nested_resource_class_methods :tax_id,
17
19
  operations: %i[create retrieve delete list]
18
20
 
21
+ def list_payment_methods(params = {}, opts = {})
22
+ request_stripe_object(
23
+ method: :get,
24
+ path: resource_url + "/payment_methods",
25
+ params: params,
26
+ opts: opts
27
+ )
28
+ end
29
+
19
30
  custom_method :delete_discount, http_verb: :delete, http_path: "discount"
20
31
 
21
32
  save_nested_resource :source
@@ -1,3 +1,4 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Stripe
@@ -18,13 +19,13 @@ module Stripe
18
19
  def self.retrieve(_id, _opts = {})
19
20
  raise NotImplementedError,
20
21
  "Customer Balance Transactions cannot be retrieved without a customer ID. " \
21
- "Retrieve a Customer Balance Transaction using Customer.retrieve_balance_transaction('cus_123', 'cbtxn_123')"
22
+ "Retrieve a Customer Balance Transaction using `Customer.retrieve_balance_transaction('cus_123', 'cbtxn_123')`"
22
23
  end
23
24
 
24
25
  def self.update(_id, _params = nil, _opts = nil)
25
26
  raise NotImplementedError,
26
27
  "Customer Balance Transactions cannot be retrieved without a customer ID. " \
27
- "Update a Customer Balance Transaction using Customer.update_balance_transaction('cus_123', 'cbtxn_123', params)"
28
+ "Update a Customer Balance Transaction using `Customer.update_balance_transaction('cus_123', 'cbtxn_123', params)`"
28
29
  end
29
30
  end
30
31
  end
@@ -1,3 +1,4 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Stripe
@@ -1,3 +1,4 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Stripe
@@ -1,3 +1,4 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Stripe
@@ -1,3 +1,4 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Stripe
@@ -0,0 +1,105 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ class Quote < APIResource
6
+ extend Stripe::APIOperations::Create
7
+ extend Stripe::APIOperations::List
8
+ include Stripe::APIOperations::Save
9
+
10
+ OBJECT_NAME = "quote"
11
+
12
+ custom_method :accept, http_verb: :post
13
+ custom_method :cancel, http_verb: :post
14
+ custom_method :finalize_quote, http_verb: :post, http_path: "finalize"
15
+ custom_method :list_computed_upfront_line_items, http_verb: :get, http_path: "computed_upfront_line_items"
16
+ custom_method :list_line_items, http_verb: :get, http_path: "line_items"
17
+
18
+ def accept(params = {}, opts = {})
19
+ request_stripe_object(
20
+ method: :post,
21
+ path: resource_url + "/accept",
22
+ params: params,
23
+ opts: opts
24
+ )
25
+ end
26
+
27
+ def cancel(params = {}, opts = {})
28
+ request_stripe_object(
29
+ method: :post,
30
+ path: resource_url + "/cancel",
31
+ params: params,
32
+ opts: opts
33
+ )
34
+ end
35
+
36
+ def finalize_quote(params = {}, opts = {})
37
+ request_stripe_object(
38
+ method: :post,
39
+ path: resource_url + "/finalize",
40
+ params: params,
41
+ opts: opts
42
+ )
43
+ end
44
+
45
+ def list_computed_upfront_line_items(params = {}, opts = {})
46
+ request_stripe_object(
47
+ method: :get,
48
+ path: resource_url + "/computed_upfront_line_items",
49
+ params: params,
50
+ opts: opts
51
+ )
52
+ end
53
+
54
+ def list_line_items(params = {}, opts = {})
55
+ request_stripe_object(
56
+ method: :get,
57
+ path: resource_url + "/line_items",
58
+ params: params,
59
+ opts: opts
60
+ )
61
+ end
62
+
63
+ def pdf(params = {}, opts = {}, &read_body_chunk_block)
64
+ unless block_given?
65
+ raise ArgumentError, "A read_body_chunk_block block parameter is required when calling the pdf method."
66
+ end
67
+
68
+ config = opts[:client]&.config || Stripe.config
69
+
70
+ request_stream(
71
+ method: :get,
72
+ path: resource_url + "/pdf",
73
+ params: params,
74
+ opts: {
75
+ api_base: config.uploads_base,
76
+ }.merge(opts),
77
+ &read_body_chunk_block
78
+ )
79
+ end
80
+
81
+ def self.pdf(id, params = {}, opts = {}, &read_body_chunk_block)
82
+ unless id.is_a?(String)
83
+ raise ArgumentError,
84
+ "id should be a string representing the ID of an API resource"
85
+ end
86
+
87
+ unless block_given?
88
+ raise ArgumentError, "A read_body_chunk_block block parameter is required when calling the pdf method."
89
+ end
90
+
91
+ config = opts[:client]&.config || Stripe.config
92
+
93
+ resp = execute_resource_request_stream(
94
+ :get,
95
+ "#{resource_url}/#{CGI.escape(id)}/pdf",
96
+ params,
97
+ {
98
+ api_base: config.uploads_base,
99
+ }.merge(opts),
100
+ &read_body_chunk_block
101
+ )
102
+ resp
103
+ end
104
+ end
105
+ end
@@ -1,3 +1,4 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Stripe
@@ -22,8 +23,8 @@ module Stripe
22
23
  def self.retrieve(_id, _opts = {})
23
24
  raise NotImplementedError,
24
25
  "Reversals cannot be retrieved without a transfer ID. Retrieve " \
25
- "a reversal using `Transfer.retrieve_reversal('transfer_id', " \
26
- "'reversal_id')`"
26
+ "a reversal using `Transfer.retrieve_reversal('transfer_id', " \
27
+ "'reversal_id'`"
27
28
  end
28
29
  end
29
30
  end
@@ -1,3 +1,4 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Stripe
@@ -1,3 +1,4 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Stripe
@@ -1,3 +1,4 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Stripe
@@ -1,3 +1,4 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  require "stripe/resources/account"
@@ -54,6 +55,7 @@ require "stripe/resources/plan"
54
55
  require "stripe/resources/price"
55
56
  require "stripe/resources/product"
56
57
  require "stripe/resources/promotion_code"
58
+ require "stripe/resources/quote"
57
59
  require "stripe/resources/radar/early_fraud_warning"
58
60
  require "stripe/resources/radar/value_list"
59
61
  require "stripe/resources/radar/value_list_item"
@@ -667,6 +667,7 @@ module Stripe
667
667
  method: context.method,
668
668
  num_retries: num_retries,
669
669
  path: context.path,
670
+ request_id: context.request_id,
670
671
  user_data: user_data || {}
671
672
  )
672
673
  Stripe::Instrumentation.notify(:request_end, event)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "5.35.0"
4
+ VERSION = "5.39.0"
5
5
  end
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: 5.35.0
4
+ version: 5.39.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-30 00:00:00.000000000 Z
11
+ date: 2021-10-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Stripe is the easiest way to accept payments online. See https://stripe.com
14
14
  for details.
@@ -100,6 +100,7 @@ files:
100
100
  - lib/stripe/resources/price.rb
101
101
  - lib/stripe/resources/product.rb
102
102
  - lib/stripe/resources/promotion_code.rb
103
+ - lib/stripe/resources/quote.rb
103
104
  - lib/stripe/resources/radar/early_fraud_warning.rb
104
105
  - lib/stripe/resources/radar/value_list.rb
105
106
  - lib/stripe/resources/radar/value_list_item.rb