stripe 11.4.0.pre.beta.1 → 11.5.0.pre.beta.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c599a29ba600b8be458ab19e8b82eb649cfe290534c0567857bde1901c6c5eae
4
- data.tar.gz: 2816c9bb85b133627353c3295f496b7f4d2d0e4953b2c584fd560bcb2f616ff4
3
+ metadata.gz: 21334378de492ecaccb1a2acf9b3ab13e71ebda9a7efca72350cd5c1fcb52aab
4
+ data.tar.gz: d948c9827f2f2c6ba8e72f2ede30b2278123dc900b81a6b25e826d1f2854a7c9
5
5
  SHA512:
6
- metadata.gz: aa7a558f2c2b2c0c3b5d291ea3e16682b5f36ddcc630edbe3d4e82fd8be0d6fde0f964b176dac9270cc73765b3d55d7f2526d273d7666e8d41d2707e18499a98
7
- data.tar.gz: 1aa4b34c3decc40c8d038554c070a18cbedb026009c7770a11021c9e510a7e25898dbbeb50d0e43e6c761610baf5e4238e3b05698ea4176c27627de57840d2ce
6
+ metadata.gz: cc4cdc3c8612d60ca6fe2b19d2e42e431fda5b0dfb0177009ba25a43b6f46360b09c373c18163fe73ca76b0ee2e6c9fd396d9814e857523c349e60926c8321fa
7
+ data.tar.gz: 5ff9a9f05dde83ce8ce4a4784bd906c7e2916261e9a3e9ceac412ca61108ed9ad5b8c363e13e47f5698df827f4141a56b90523063f9b4a3d2f2ab82b1011c6e7
data/CHANGELOG.md CHANGED
@@ -1,8 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 11.5.0-beta.1 - 2024-05-09
4
+ * [#1395](https://github.com/stripe/stripe-ruby/pull/1395) Update generated code for beta
5
+ * No new beta features. Merging changes from the main branch.
6
+
7
+
3
8
  ## 11.4.0-beta.1 - 2024-05-02
4
9
  * [#1386](https://github.com/stripe/stripe-ruby/pull/1386) Update generated code for beta
5
10
 
11
+ ## 11.3.0 - 2024-05-02
12
+ * [#1387](https://github.com/stripe/stripe-ruby/pull/1387) Update generated code
13
+
14
+ * [#1392](https://github.com/stripe/stripe-ruby/pull/1392) Deprecate Ruby methods based on OpenAPI spec
15
+ - Mark as deprecated the `approve` and `decline` methods in `lib/stripe/resources/issuing/authorization.rb`. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
16
+ * [#1391](https://github.com/stripe/stripe-ruby/pull/1391) Add Ruby 3.3 to CI test matrix
6
17
 
7
18
  ## 11.3.0-beta.1 - 2024-04-18
8
19
  * [#1383](https://github.com/stripe/stripe-ruby/pull/1383) Update generated code for beta
data/Gemfile CHANGED
@@ -27,10 +27,6 @@ group :development do
27
27
  # The latest version of rubocop is only compatible with Ruby 2.7+
28
28
  gem "rubocop", "1.57.2" if RUBY_VERSION >= "2.7"
29
29
 
30
- # jaro_winkler 1.5.5 installation fails for jruby
31
- # don't install on truffleruby
32
- gem "jaro_winkler", "1.5.4" unless RUBY_ENGINE == "truffleruby"
33
-
34
30
  gem "sorbet"
35
31
  gem "tapioca"
36
32
 
data/OPENAPI_VERSION CHANGED
@@ -1 +1 @@
1
- v1005
1
+ v1016
data/VERSION CHANGED
@@ -1 +1 @@
1
- 11.4.0-beta.1
1
+ 11.5.0-beta.1
@@ -35,6 +35,7 @@ module Stripe
35
35
  end
36
36
  end
37
37
 
38
+ # rubocop:disable Metrics/MethodLength
38
39
  private def define_operation(
39
40
  resource,
40
41
  operation,
@@ -53,12 +54,30 @@ module Stripe
53
54
  )
54
55
  end
55
56
  when :retrieve
57
+ # TODO: (Major) Split params_or_opts to params and opts and get rid of the complicated way to add params
56
58
  define_singleton_method(:"retrieve_#{resource}") \
57
- do |id, nested_id, opts = {}|
59
+ do |id, nested_id, params_or_opts = {}, definitely_opts = nil|
60
+ opts = nil
61
+ params = nil
62
+ if definitely_opts.nil?
63
+ unrecognized_key = params_or_opts.keys.find { |k| !Util::OPTS_USER_SPECIFIED.include?(k) }
64
+ if unrecognized_key
65
+ raise ArgumentError,
66
+ "Unrecognized request option: #{unrecognized_key}. Did you mean to specify this as " \
67
+ "retrieve params? " \
68
+ "If so, you must explicitly pass an opts hash as a fourth argument. " \
69
+ "For example: .retrieve(#{id}, #{nested_id}, {#{unrecognized_key}: 'foo'}, {})"
70
+ end
71
+
72
+ opts = params_or_opts
73
+ else
74
+ opts = definitely_opts
75
+ params = params_or_opts
76
+ end
58
77
  request_stripe_object(
59
78
  method: :get,
60
79
  path: send(resource_url_method, id, nested_id),
61
- params: {},
80
+ params: params,
62
81
  opts: opts
63
82
  )
64
83
  end
@@ -96,6 +115,7 @@ module Stripe
96
115
  raise ArgumentError, "Unknown operation: #{operation.inspect}"
97
116
  end
98
117
  end
118
+ # rubocop:enable Metrics/MethodLength
99
119
  end
100
120
  end
101
121
  end
@@ -124,6 +124,26 @@ module Stripe
124
124
  opts: opts
125
125
  )
126
126
  end
127
+
128
+ # Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states.
129
+ def self.update(id, params = {}, opts = {})
130
+ request_stripe_object(
131
+ method: :post,
132
+ path: format("/v1/test_helpers/treasury/outbound_payments/%<id>s", { id: CGI.escape(id) }),
133
+ params: params,
134
+ opts: opts
135
+ )
136
+ end
137
+
138
+ # Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states.
139
+ def update(params = {}, opts = {})
140
+ @resource.request_stripe_object(
141
+ method: :post,
142
+ path: format("/v1/test_helpers/treasury/outbound_payments/%<id>s", { id: CGI.escape(@resource["id"]) }),
143
+ params: params,
144
+ opts: opts
145
+ )
146
+ end
127
147
  end
128
148
  end
129
149
  end
@@ -124,6 +124,26 @@ module Stripe
124
124
  opts: opts
125
125
  )
126
126
  end
127
+
128
+ # Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states.
129
+ def self.update(outbound_transfer, params = {}, opts = {})
130
+ request_stripe_object(
131
+ method: :post,
132
+ path: format("/v1/test_helpers/treasury/outbound_transfers/%<outbound_transfer>s", { outbound_transfer: CGI.escape(outbound_transfer) }),
133
+ params: params,
134
+ opts: opts
135
+ )
136
+ end
137
+
138
+ # Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states.
139
+ def update(params = {}, opts = {})
140
+ @resource.request_stripe_object(
141
+ method: :post,
142
+ path: format("/v1/test_helpers/treasury/outbound_transfers/%<outbound_transfer>s", { outbound_transfer: CGI.escape(@resource["id"]) }),
143
+ params: params,
144
+ opts: opts
145
+ )
146
+ end
127
147
  end
128
148
  end
129
149
  end
@@ -18,6 +18,11 @@ module Stripe
18
18
  @system_profiler = SystemProfiler.new
19
19
  @last_request_metrics = nil
20
20
 
21
+ # The following attribute is only used to log whether or not
22
+ # StripeClient#request has been called. To be removed in a
23
+ # future major version.
24
+ @usage = []
25
+
21
26
  @config = case config_arg
22
27
  when Hash
23
28
  Stripe.config.reverse_duplicate_merge(config_arg)
@@ -186,6 +191,7 @@ module Stripe
186
191
  # charge, resp = client.request { Charge.create }
187
192
  #
188
193
  def request
194
+ @usage = ["stripe_client_request"]
189
195
  old_stripe_client = self.class.current_thread_context.active_client
190
196
  self.class.current_thread_context.active_client = self
191
197
 
@@ -200,6 +206,7 @@ module Stripe
200
206
  res = yield
201
207
  [res, self.class.current_thread_context.last_responses[object_id]]
202
208
  ensure
209
+ @usage = []
203
210
  self.class.current_thread_context.active_client = old_stripe_client
204
211
  self.class.current_thread_context.last_responses.delete(object_id)
205
212
  end
@@ -606,7 +613,7 @@ module Stripe
606
613
  if config.enable_telemetry? && context.request_id
607
614
  request_duration_ms = (request_duration * 1000).to_i
608
615
  @last_request_metrics =
609
- StripeRequestMetrics.new(context.request_id, request_duration_ms, usage: usage)
616
+ StripeRequestMetrics.new(context.request_id, request_duration_ms, usage: usage + @usage)
610
617
  end
611
618
 
612
619
  # We rescue all exceptions from a request so that we have an easy spot to
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "11.4.0-beta.1"
4
+ VERSION = "11.5.0-beta.1"
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: 11.4.0.pre.beta.1
4
+ version: 11.5.0.pre.beta.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-02 00:00:00.000000000 Z
11
+ date: 2024-05-09 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.