stripe 13.1.0.pre.beta.3 → 13.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +663 -1371
  3. data/OPENAPI_VERSION +1 -1
  4. data/README.md +1 -1
  5. data/VERSION +1 -1
  6. data/lib/stripe/api_resource.rb +8 -2
  7. data/lib/stripe/api_version.rb +1 -1
  8. data/lib/stripe/object_types.rb +1 -19
  9. data/lib/stripe/request_options.rb +1 -1
  10. data/lib/stripe/resources/financial_connections/account.rb +0 -3
  11. data/lib/stripe/resources/invoice.rb +0 -81
  12. data/lib/stripe/resources/payment_intent.rb +0 -50
  13. data/lib/stripe/resources/quote.rb +0 -104
  14. data/lib/stripe/resources/subscription_schedule.rb +0 -20
  15. data/lib/stripe/resources/terminal/reader.rb +0 -60
  16. data/lib/stripe/resources/v2/event_destination.rb +13 -0
  17. data/lib/stripe/resources.rb +1 -18
  18. data/lib/stripe/services/account_login_link_service.rb +1 -1
  19. data/lib/stripe/services/financial_connections/account_service.rb +1 -3
  20. data/lib/stripe/services/financial_connections_service.rb +1 -2
  21. data/lib/stripe/services/invoice_service.rb +1 -44
  22. data/lib/stripe/services/issuing_service.rb +1 -4
  23. data/lib/stripe/services/payment_intent_service.rb +0 -26
  24. data/lib/stripe/services/quote_service.rb +1 -49
  25. data/lib/stripe/services/subscription_schedule_service.rb +0 -11
  26. data/lib/stripe/services/tax_service.rb +1 -3
  27. data/lib/stripe/services/terminal/reader_service.rb +0 -33
  28. data/lib/stripe/services/terminal_service.rb +1 -2
  29. data/lib/stripe/services/v1_services.rb +1 -6
  30. data/lib/stripe/services/v2/core/event_destination_service.rb +98 -0
  31. data/lib/stripe/services/v2/core_service.rb +2 -1
  32. data/lib/stripe/services.rb +1 -22
  33. data/lib/stripe/stripe_configuration.rb +1 -3
  34. data/lib/stripe/util.rb +1 -7
  35. data/lib/stripe/version.rb +1 -1
  36. data/lib/stripe.rb +0 -45
  37. metadata +6 -45
  38. data/lib/stripe/request_signing_authenticator.rb +0 -79
  39. data/lib/stripe/resources/account_notice.rb +0 -32
  40. data/lib/stripe/resources/capital/financing_offer.rb +0 -49
  41. data/lib/stripe/resources/capital/financing_summary.rb +0 -15
  42. data/lib/stripe/resources/capital/financing_transaction.rb +0 -27
  43. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +0 -14
  44. data/lib/stripe/resources/financial_connections/institution.rb +0 -26
  45. data/lib/stripe/resources/gift_cards/card.rb +0 -59
  46. data/lib/stripe/resources/gift_cards/transaction.rb +0 -93
  47. data/lib/stripe/resources/invoice_payment.rb +0 -12
  48. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +0 -88
  49. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +0 -26
  50. data/lib/stripe/resources/margin.rb +0 -37
  51. data/lib/stripe/resources/order.rb +0 -120
  52. data/lib/stripe/resources/quote_preview_invoice.rb +0 -43
  53. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +0 -11
  54. data/lib/stripe/resources/tax/association.rb +0 -24
  55. data/lib/stripe/resources/tax/form.rb +0 -49
  56. data/lib/stripe/resources/terminal/reader_collected_data.rb +0 -14
  57. data/lib/stripe/services/account_notice_service.rb +0 -39
  58. data/lib/stripe/services/capital/financing_offer_service.rb +0 -42
  59. data/lib/stripe/services/capital/financing_summary_service.rb +0 -19
  60. data/lib/stripe/services/capital/financing_transaction_service.rb +0 -31
  61. data/lib/stripe/services/capital_service.rb +0 -15
  62. data/lib/stripe/services/financial_connections/account_inferred_balance_service.rb +0 -19
  63. data/lib/stripe/services/financial_connections/institution_service.rb +0 -30
  64. data/lib/stripe/services/gift_cards/card_service.rb +0 -63
  65. data/lib/stripe/services/gift_cards/transaction_service.rb +0 -74
  66. data/lib/stripe/services/gift_cards_service.rb +0 -14
  67. data/lib/stripe/services/invoice_payment_service.rb +0 -28
  68. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +0 -74
  69. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +0 -30
  70. data/lib/stripe/services/margin_service.rb +0 -50
  71. data/lib/stripe/services/order_line_item_service.rb +0 -17
  72. data/lib/stripe/services/order_service.rb +0 -78
  73. data/lib/stripe/services/quote_line_service.rb +0 -17
  74. data/lib/stripe/services/quote_preview_invoice_service.rb +0 -17
  75. data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +0 -17
  76. data/lib/stripe/services/tax/association_service.rb +0 -19
  77. data/lib/stripe/services/tax/form_service.rb +0 -37
  78. data/lib/stripe/services/terminal/reader_collected_data_service.rb +0 -19
data/lib/stripe.rb CHANGED
@@ -13,7 +13,6 @@ require "set"
13
13
  require "socket"
14
14
  require "uri"
15
15
  require "forwardable"
16
- require "base64"
17
16
 
18
17
  # Version
19
18
  require "stripe/api_version"
@@ -51,7 +50,6 @@ require "stripe/api_resource_test_helpers"
51
50
  require "stripe/singleton_api_resource"
52
51
  require "stripe/webhook"
53
52
  require "stripe/stripe_configuration"
54
- require "stripe/request_signing_authenticator"
55
53
  require "stripe/thin_event"
56
54
 
57
55
  # Named API resources
@@ -87,7 +85,6 @@ module Stripe
87
85
 
88
86
  # User configurable options
89
87
  def_delegators :@config, :api_key, :api_key=
90
- def_delegators :@config, :authenticator, :authenticator=
91
88
  def_delegators :@config, :api_version, :api_version=
92
89
  def_delegators :@config, :stripe_account, :stripe_account=
93
90
  def_delegators :@config, :api_base, :api_base=
@@ -135,48 +132,6 @@ module Stripe
135
132
  version: version,
136
133
  }
137
134
  end
138
-
139
- def self.add_beta_version(beta_name, version)
140
- if api_version.include?("; #{beta_name}=")
141
- raise "Stripe version header #{api_version} already contains entry for beta #{beta_name}"
142
- end
143
-
144
- self.api_version = "#{api_version}; #{beta_name}=#{version}"
145
- end
146
-
147
- class RawRequest
148
- def initialize
149
- @opts = {}
150
- end
151
-
152
- def execute(method, url, base_address: :api, params: {}, opts: {}, usage: [])
153
- opts = Util.normalize_opts(opts)
154
- req_opts = RequestOptions.extract_opts_from_hash(opts)
155
-
156
- requestor = APIRequestor.active_requestor
157
- resp, = requestor.send(:execute_request_internal, method, url, base_address, params, req_opts,
158
- usage)
159
-
160
- requestor.interpret_response(resp)
161
- end
162
- end
163
-
164
- # Sends a request to Stripe REST API
165
- def self.raw_request(method, url, params = {}, opts = {}, base_address: :api)
166
- req = RawRequest.new
167
- req.execute(method, url, base_address: base_address, params: params, opts: opts,
168
- usage: ["raw_request"])
169
- end
170
-
171
- def self.deserialize(data, api_mode: :v1)
172
- data = JSON.parse(data) if data.is_a?(String)
173
- Util.convert_to_stripe_object(data, {}, api_mode: api_mode)
174
- end
175
- class << self
176
- extend Gem::Deprecate
177
- deprecate :raw_request, "StripeClient#raw_request", 2024, 9
178
- deprecate :deserialize, "StripeClient#deserialize", 2024, 9
179
- end
180
135
  end
181
136
 
182
137
  Stripe.log_level = ENV["STRIPE_LOG"] unless ENV["STRIPE_LOG"].nil?
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: 13.1.0.pre.beta.3
4
+ version: 13.1.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-10-18 00:00:00.000000000 Z
11
+ date: 2024-11-06 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.
@@ -60,11 +60,9 @@ files:
60
60
  - lib/stripe/oauth.rb
61
61
  - lib/stripe/object_types.rb
62
62
  - lib/stripe/request_options.rb
63
- - lib/stripe/request_signing_authenticator.rb
64
63
  - lib/stripe/resources.rb
65
64
  - lib/stripe/resources/account.rb
66
65
  - lib/stripe/resources/account_link.rb
67
- - lib/stripe/resources/account_notice.rb
68
66
  - lib/stripe/resources/account_session.rb
69
67
  - lib/stripe/resources/alipay_account.rb
70
68
  - lib/stripe/resources/apple_pay_domain.rb
@@ -85,9 +83,6 @@ files:
85
83
  - lib/stripe/resources/billing_portal/configuration.rb
86
84
  - lib/stripe/resources/billing_portal/session.rb
87
85
  - lib/stripe/resources/capability.rb
88
- - lib/stripe/resources/capital/financing_offer.rb
89
- - lib/stripe/resources/capital/financing_summary.rb
90
- - lib/stripe/resources/capital/financing_transaction.rb
91
86
  - lib/stripe/resources/card.rb
92
87
  - lib/stripe/resources/cash_balance.rb
93
88
  - lib/stripe/resources/charge.rb
@@ -114,29 +109,22 @@ files:
114
109
  - lib/stripe/resources/file.rb
115
110
  - lib/stripe/resources/file_link.rb
116
111
  - lib/stripe/resources/financial_connections/account.rb
117
- - lib/stripe/resources/financial_connections/account_inferred_balance.rb
118
112
  - lib/stripe/resources/financial_connections/account_owner.rb
119
113
  - lib/stripe/resources/financial_connections/account_ownership.rb
120
- - lib/stripe/resources/financial_connections/institution.rb
121
114
  - lib/stripe/resources/financial_connections/session.rb
122
115
  - lib/stripe/resources/financial_connections/transaction.rb
123
116
  - lib/stripe/resources/forwarding/request.rb
124
117
  - lib/stripe/resources/funding_instructions.rb
125
- - lib/stripe/resources/gift_cards/card.rb
126
- - lib/stripe/resources/gift_cards/transaction.rb
127
118
  - lib/stripe/resources/identity/verification_report.rb
128
119
  - lib/stripe/resources/identity/verification_session.rb
129
120
  - lib/stripe/resources/invoice.rb
130
121
  - lib/stripe/resources/invoice_item.rb
131
122
  - lib/stripe/resources/invoice_line_item.rb
132
- - lib/stripe/resources/invoice_payment.rb
133
123
  - lib/stripe/resources/invoice_rendering_template.rb
134
124
  - lib/stripe/resources/issuing/authorization.rb
135
125
  - lib/stripe/resources/issuing/card.rb
136
126
  - lib/stripe/resources/issuing/cardholder.rb
137
- - lib/stripe/resources/issuing/credit_underwriting_record.rb
138
127
  - lib/stripe/resources/issuing/dispute.rb
139
- - lib/stripe/resources/issuing/dispute_settlement_detail.rb
140
128
  - lib/stripe/resources/issuing/personalization_design.rb
141
129
  - lib/stripe/resources/issuing/physical_bundle.rb
142
130
  - lib/stripe/resources/issuing/token.rb
@@ -144,8 +132,6 @@ files:
144
132
  - lib/stripe/resources/line_item.rb
145
133
  - lib/stripe/resources/login_link.rb
146
134
  - lib/stripe/resources/mandate.rb
147
- - lib/stripe/resources/margin.rb
148
- - lib/stripe/resources/order.rb
149
135
  - lib/stripe/resources/payment_intent.rb
150
136
  - lib/stripe/resources/payment_link.rb
151
137
  - lib/stripe/resources/payment_method.rb
@@ -159,8 +145,6 @@ files:
159
145
  - lib/stripe/resources/product_feature.rb
160
146
  - lib/stripe/resources/promotion_code.rb
161
147
  - lib/stripe/resources/quote.rb
162
- - lib/stripe/resources/quote_preview_invoice.rb
163
- - lib/stripe/resources/quote_preview_subscription_schedule.rb
164
148
  - lib/stripe/resources/radar/early_fraud_warning.rb
165
149
  - lib/stripe/resources/radar/value_list.rb
166
150
  - lib/stripe/resources/radar/value_list_item.rb
@@ -179,10 +163,8 @@ files:
179
163
  - lib/stripe/resources/subscription.rb
180
164
  - lib/stripe/resources/subscription_item.rb
181
165
  - lib/stripe/resources/subscription_schedule.rb
182
- - lib/stripe/resources/tax/association.rb
183
166
  - lib/stripe/resources/tax/calculation.rb
184
167
  - lib/stripe/resources/tax/calculation_line_item.rb
185
- - lib/stripe/resources/tax/form.rb
186
168
  - lib/stripe/resources/tax/registration.rb
187
169
  - lib/stripe/resources/tax/settings.rb
188
170
  - lib/stripe/resources/tax/transaction.rb
@@ -194,7 +176,6 @@ files:
194
176
  - lib/stripe/resources/terminal/connection_token.rb
195
177
  - lib/stripe/resources/terminal/location.rb
196
178
  - lib/stripe/resources/terminal/reader.rb
197
- - lib/stripe/resources/terminal/reader_collected_data.rb
198
179
  - lib/stripe/resources/test_helpers/test_clock.rb
199
180
  - lib/stripe/resources/token.rb
200
181
  - lib/stripe/resources/topup.rb
@@ -216,6 +197,7 @@ files:
216
197
  - lib/stripe/resources/v2/billing/meter_event_adjustment.rb
217
198
  - lib/stripe/resources/v2/billing/meter_event_session.rb
218
199
  - lib/stripe/resources/v2/event.rb
200
+ - lib/stripe/resources/v2/event_destination.rb
219
201
  - lib/stripe/resources/webhook_endpoint.rb
220
202
  - lib/stripe/search_result_object.rb
221
203
  - lib/stripe/services.rb
@@ -223,7 +205,6 @@ files:
223
205
  - lib/stripe/services/account_external_account_service.rb
224
206
  - lib/stripe/services/account_link_service.rb
225
207
  - lib/stripe/services/account_login_link_service.rb
226
- - lib/stripe/services/account_notice_service.rb
227
208
  - lib/stripe/services/account_person_service.rb
228
209
  - lib/stripe/services/account_service.rb
229
210
  - lib/stripe/services/account_session_service.rb
@@ -246,10 +227,6 @@ files:
246
227
  - lib/stripe/services/billing_portal/session_service.rb
247
228
  - lib/stripe/services/billing_portal_service.rb
248
229
  - lib/stripe/services/billing_service.rb
249
- - lib/stripe/services/capital/financing_offer_service.rb
250
- - lib/stripe/services/capital/financing_summary_service.rb
251
- - lib/stripe/services/capital/financing_transaction_service.rb
252
- - lib/stripe/services/capital_service.rb
253
230
  - lib/stripe/services/charge_service.rb
254
231
  - lib/stripe/services/checkout/session_line_item_service.rb
255
232
  - lib/stripe/services/checkout/session_service.rb
@@ -282,43 +259,32 @@ files:
282
259
  - lib/stripe/services/exchange_rate_service.rb
283
260
  - lib/stripe/services/file_link_service.rb
284
261
  - lib/stripe/services/file_service.rb
285
- - lib/stripe/services/financial_connections/account_inferred_balance_service.rb
286
262
  - lib/stripe/services/financial_connections/account_owner_service.rb
287
263
  - lib/stripe/services/financial_connections/account_service.rb
288
- - lib/stripe/services/financial_connections/institution_service.rb
289
264
  - lib/stripe/services/financial_connections/session_service.rb
290
265
  - lib/stripe/services/financial_connections/transaction_service.rb
291
266
  - lib/stripe/services/financial_connections_service.rb
292
267
  - lib/stripe/services/forwarding/request_service.rb
293
268
  - lib/stripe/services/forwarding_service.rb
294
- - lib/stripe/services/gift_cards/card_service.rb
295
- - lib/stripe/services/gift_cards/transaction_service.rb
296
- - lib/stripe/services/gift_cards_service.rb
297
269
  - lib/stripe/services/identity/verification_report_service.rb
298
270
  - lib/stripe/services/identity/verification_session_service.rb
299
271
  - lib/stripe/services/identity_service.rb
300
272
  - lib/stripe/services/invoice_item_service.rb
301
273
  - lib/stripe/services/invoice_line_item_service.rb
302
- - lib/stripe/services/invoice_payment_service.rb
303
274
  - lib/stripe/services/invoice_rendering_template_service.rb
304
275
  - lib/stripe/services/invoice_service.rb
305
276
  - lib/stripe/services/invoice_upcoming_lines_service.rb
306
277
  - lib/stripe/services/issuing/authorization_service.rb
307
278
  - lib/stripe/services/issuing/card_service.rb
308
279
  - lib/stripe/services/issuing/cardholder_service.rb
309
- - lib/stripe/services/issuing/credit_underwriting_record_service.rb
310
280
  - lib/stripe/services/issuing/dispute_service.rb
311
- - lib/stripe/services/issuing/dispute_settlement_detail_service.rb
312
281
  - lib/stripe/services/issuing/personalization_design_service.rb
313
282
  - lib/stripe/services/issuing/physical_bundle_service.rb
314
283
  - lib/stripe/services/issuing/token_service.rb
315
284
  - lib/stripe/services/issuing/transaction_service.rb
316
285
  - lib/stripe/services/issuing_service.rb
317
286
  - lib/stripe/services/mandate_service.rb
318
- - lib/stripe/services/margin_service.rb
319
287
  - lib/stripe/services/oauth_service.rb
320
- - lib/stripe/services/order_line_item_service.rb
321
- - lib/stripe/services/order_service.rb
322
288
  - lib/stripe/services/payment_intent_service.rb
323
289
  - lib/stripe/services/payment_link_line_item_service.rb
324
290
  - lib/stripe/services/payment_link_service.rb
@@ -333,9 +299,6 @@ files:
333
299
  - lib/stripe/services/promotion_code_service.rb
334
300
  - lib/stripe/services/quote_computed_upfront_line_items_service.rb
335
301
  - lib/stripe/services/quote_line_item_service.rb
336
- - lib/stripe/services/quote_line_service.rb
337
- - lib/stripe/services/quote_preview_invoice_service.rb
338
- - lib/stripe/services/quote_preview_subscription_schedule_service.rb
339
302
  - lib/stripe/services/quote_service.rb
340
303
  - lib/stripe/services/radar/early_fraud_warning_service.rb
341
304
  - lib/stripe/services/radar/value_list_item_service.rb
@@ -358,10 +321,8 @@ files:
358
321
  - lib/stripe/services/subscription_item_usage_record_summary_service.rb
359
322
  - lib/stripe/services/subscription_schedule_service.rb
360
323
  - lib/stripe/services/subscription_service.rb
361
- - lib/stripe/services/tax/association_service.rb
362
324
  - lib/stripe/services/tax/calculation_line_item_service.rb
363
325
  - lib/stripe/services/tax/calculation_service.rb
364
- - lib/stripe/services/tax/form_service.rb
365
326
  - lib/stripe/services/tax/registration_service.rb
366
327
  - lib/stripe/services/tax/settings_service.rb
367
328
  - lib/stripe/services/tax/transaction_line_item_service.rb
@@ -373,7 +334,6 @@ files:
373
334
  - lib/stripe/services/terminal/configuration_service.rb
374
335
  - lib/stripe/services/terminal/connection_token_service.rb
375
336
  - lib/stripe/services/terminal/location_service.rb
376
- - lib/stripe/services/terminal/reader_collected_data_service.rb
377
337
  - lib/stripe/services/terminal/reader_service.rb
378
338
  - lib/stripe/services/terminal_service.rb
379
339
  - lib/stripe/services/test_helpers/confirmation_token_service.rb
@@ -416,6 +376,7 @@ files:
416
376
  - lib/stripe/services/v2/billing/meter_event_session_service.rb
417
377
  - lib/stripe/services/v2/billing/meter_event_stream_service.rb
418
378
  - lib/stripe/services/v2/billing_service.rb
379
+ - lib/stripe/services/v2/core/event_destination_service.rb
419
380
  - lib/stripe/services/v2/core/event_service.rb
420
381
  - lib/stripe/services/v2/core_service.rb
421
382
  - lib/stripe/services/v2_services.rb
@@ -454,9 +415,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
454
415
  version: 2.3.0
455
416
  required_rubygems_version: !ruby/object:Gem::Requirement
456
417
  requirements:
457
- - - ">"
418
+ - - ">="
458
419
  - !ruby/object:Gem::Version
459
- version: 1.3.1
420
+ version: '0'
460
421
  requirements: []
461
422
  rubygems_version: 3.3.27
462
423
  signing_key:
@@ -1,79 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Stripe
4
- class RequestSigningAuthenticator
5
- AUTHORIZATION_HEADER_NAME = "Authorization"
6
- CONTENT_TYPE_HEADER_NAME = "Content-Type"
7
- STRIPE_CONTEXT_HEADER_NAME = "Stripe-Context"
8
- STRIPE_ACCOUNT_HEADER_NAME = "Stripe-Account"
9
- CONTENT_DIGEST_HEADER_NAME = "Content-Digest"
10
- SIGNATURE_INPUT_HEADER_NAME = "Signature-Input"
11
- SIGNATURE_HEADER_NAME = "Signature"
12
-
13
- attr_reader :auth_token, :sign_lambda
14
-
15
- def initialize(auth_token, sign_lambda)
16
- raise ArgumentError, "auth_token must be a string" unless auth_token.is_a?(String)
17
- raise ArgumentError, "sign_lambda must be a lambda" unless sign_lambda.is_a?(Proc)
18
-
19
- @auth_token = auth_token
20
- @sign_lambda = sign_lambda
21
- end
22
-
23
- def authenticate(method, headers, body)
24
- covered_headers = [CONTENT_TYPE_HEADER_NAME,
25
- CONTENT_DIGEST_HEADER_NAME,
26
- STRIPE_CONTEXT_HEADER_NAME,
27
- STRIPE_ACCOUNT_HEADER_NAME,
28
- AUTHORIZATION_HEADER_NAME,]
29
-
30
- headers[AUTHORIZATION_HEADER_NAME] = "STRIPE-V2-SIG #{auth_token}"
31
-
32
- if method == :get
33
- covered_headers -= [CONTENT_TYPE_HEADER_NAME,
34
- CONTENT_DIGEST_HEADER_NAME,]
35
- else
36
- content = body || ""
37
- headers[CONTENT_DIGEST_HEADER_NAME] =
38
- %(sha-256=:#{content_digest(content)}:)
39
- end
40
-
41
- covered_headers_formatted = covered_headers
42
- .map { |string| %("#{string.downcase}") }
43
- .join(" ")
44
-
45
- signature_input = "(#{covered_headers_formatted});created=#{created_time}"
46
-
47
- inputs = covered_headers
48
- .map { |header| %("#{header.downcase}": #{headers[header]}) }
49
- .join("\n")
50
-
51
- signature_base = %(#{inputs}\n"@signature-params": #{signature_input})
52
- .encode(Encoding::UTF_8)
53
-
54
- headers[SIGNATURE_INPUT_HEADER_NAME] = "sig1=#{signature_input}"
55
-
56
- headers[SIGNATURE_HEADER_NAME] =
57
- "sig1=:#{encoded_signature(signature_base)}:"
58
- end
59
-
60
- private def sign(signature_base)
61
- @sign_lambda.call(signature_base)
62
- end
63
-
64
- private def encoded_signature(signature_base)
65
- Base64.strict_encode64(sign(signature_base))
66
- rescue StandardError
67
- raise AuthenticationError, "Encountered '#{e.message} (#{e.class})' " \
68
- "when calculating request signature."
69
- end
70
-
71
- private def content_digest(content)
72
- Base64.strict_encode64(OpenSSL::Digest.new("SHA256").digest(content))
73
- end
74
-
75
- private def created_time
76
- Time.now.to_i
77
- end
78
- end
79
- end
@@ -1,32 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- # A notice to a Connected account. Notice can be sent by Stripe on your behalf or you can opt to send the notices yourself.
6
- #
7
- # See the [guide to send notices](https://stripe.com/docs/issuing/compliance-us/issuing-regulated-customer-notices) to your connected accounts.
8
- class AccountNotice < APIResource
9
- extend Stripe::APIOperations::List
10
- include Stripe::APIOperations::Save
11
-
12
- OBJECT_NAME = "account_notice"
13
- def self.object_name
14
- "account_notice"
15
- end
16
-
17
- # Retrieves a list of AccountNotice objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first.
18
- def self.list(filters = {}, opts = {})
19
- request_stripe_object(method: :get, path: "/v1/account_notices", params: filters, opts: opts)
20
- end
21
-
22
- # Updates an AccountNotice object.
23
- def self.update(id, params = {}, opts = {})
24
- request_stripe_object(
25
- method: :post,
26
- path: format("/v1/account_notices/%<id>s", { id: CGI.escape(id) }),
27
- params: params,
28
- opts: opts
29
- )
30
- end
31
- end
32
- end
@@ -1,49 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- module Capital
6
- # This is an object representing an offer of financing from
7
- # Stripe Capital to a Connect subaccount.
8
- class FinancingOffer < APIResource
9
- extend Stripe::APIOperations::List
10
-
11
- OBJECT_NAME = "capital.financing_offer"
12
- def self.object_name
13
- "capital.financing_offer"
14
- end
15
-
16
- # Retrieves the financing offers available for Connected accounts that belong to your platform.
17
- def self.list(filters = {}, opts = {})
18
- request_stripe_object(
19
- method: :get,
20
- path: "/v1/capital/financing_offers",
21
- params: filters,
22
- opts: opts
23
- )
24
- end
25
-
26
- # Acknowledges that platform has received and delivered the financing_offer to
27
- # the intended merchant recipient.
28
- def mark_delivered(params = {}, opts = {})
29
- request_stripe_object(
30
- method: :post,
31
- path: format("/v1/capital/financing_offers/%<financing_offer>s/mark_delivered", { financing_offer: CGI.escape(self["id"]) }),
32
- params: params,
33
- opts: opts
34
- )
35
- end
36
-
37
- # Acknowledges that platform has received and delivered the financing_offer to
38
- # the intended merchant recipient.
39
- def self.mark_delivered(financing_offer, params = {}, opts = {})
40
- request_stripe_object(
41
- method: :post,
42
- path: format("/v1/capital/financing_offers/%<financing_offer>s/mark_delivered", { financing_offer: CGI.escape(financing_offer) }),
43
- params: params,
44
- opts: opts
45
- )
46
- end
47
- end
48
- end
49
- end
@@ -1,15 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- module Capital
6
- # A financing object describes an account's current financing state. Used by Connect
7
- # platforms to read the state of Capital offered to their connected accounts.
8
- class FinancingSummary < SingletonAPIResource
9
- OBJECT_NAME = "capital.financing_summary"
10
- def self.object_name
11
- "capital.financing_summary"
12
- end
13
- end
14
- end
15
- end
@@ -1,27 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- module Capital
6
- # This is an object representing the details of a transaction on a Capital financing object.
7
- class FinancingTransaction < APIResource
8
- extend Stripe::APIOperations::List
9
-
10
- OBJECT_NAME = "capital.financing_transaction"
11
- def self.object_name
12
- "capital.financing_transaction"
13
- end
14
-
15
- # Returns a list of financing transactions. The transactions are returned in sorted order,
16
- # with the most recent transactions appearing first.
17
- def self.list(filters = {}, opts = {})
18
- request_stripe_object(
19
- method: :get,
20
- path: "/v1/capital/financing_transactions",
21
- params: filters,
22
- opts: opts
23
- )
24
- end
25
- end
26
- end
27
- end
@@ -1,14 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- module FinancialConnections
6
- # A historical balance for the account on a particular day. It may be sourced from a balance snapshot provided by a financial institution, or inferred using transactions data.
7
- class AccountInferredBalance < APIResource
8
- OBJECT_NAME = "financial_connections.account_inferred_balance"
9
- def self.object_name
10
- "financial_connections.account_inferred_balance"
11
- end
12
- end
13
- end
14
- end
@@ -1,26 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- module FinancialConnections
6
- # An institution represents a financial institution to which an end user can connect using the Financial Connections authentication flow.
7
- class Institution < APIResource
8
- extend Stripe::APIOperations::List
9
-
10
- OBJECT_NAME = "financial_connections.institution"
11
- def self.object_name
12
- "financial_connections.institution"
13
- end
14
-
15
- # Returns a list of Financial Connections Institution objects.
16
- def self.list(filters = {}, opts = {})
17
- request_stripe_object(
18
- method: :get,
19
- path: "/v1/financial_connections/institutions",
20
- params: filters,
21
- opts: opts
22
- )
23
- end
24
- end
25
- end
26
- end
@@ -1,59 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- module GiftCards
6
- # A gift card represents a single gift card owned by a customer, including the
7
- # remaining balance, gift card code, and whether or not it is active.
8
- class Card < APIResource
9
- extend Stripe::APIOperations::Create
10
- extend Stripe::APIOperations::List
11
- include Stripe::APIOperations::Save
12
-
13
- OBJECT_NAME = "gift_cards.card"
14
- def self.object_name
15
- "gift_cards.card"
16
- end
17
-
18
- # Creates a new gift card object.
19
- def self.create(params = {}, opts = {})
20
- request_stripe_object(
21
- method: :post,
22
- path: "/v1/gift_cards/cards",
23
- params: params,
24
- opts: opts
25
- )
26
- end
27
-
28
- # List gift cards for an account
29
- def self.list(filters = {}, opts = {})
30
- request_stripe_object(
31
- method: :get,
32
- path: "/v1/gift_cards/cards",
33
- params: filters,
34
- opts: opts
35
- )
36
- end
37
-
38
- # Update a gift card
39
- def self.update(id, params = {}, opts = {})
40
- request_stripe_object(
41
- method: :post,
42
- path: format("/v1/gift_cards/cards/%<id>s", { id: CGI.escape(id) }),
43
- params: params,
44
- opts: opts
45
- )
46
- end
47
-
48
- # Validates a gift card code, returning the matching gift card object if it exists.
49
- def self.validate(params = {}, opts = {})
50
- request_stripe_object(
51
- method: :post,
52
- path: "/v1/gift_cards/cards/validate",
53
- params: params,
54
- opts: opts
55
- )
56
- end
57
- end
58
- end
59
- end