stripe 8.6.0 → 8.7.0.pre.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +163 -40
  3. data/OPENAPI_VERSION +1 -1
  4. data/README.md +11 -0
  5. data/VERSION +1 -1
  6. data/lib/stripe/api_operations/request.rb +2 -0
  7. data/lib/stripe/api_version.rb +1 -0
  8. data/lib/stripe/object_types.rb +15 -0
  9. data/lib/stripe/request_signing_authenticator.rb +83 -0
  10. data/lib/stripe/resources/account_session.rb +17 -0
  11. data/lib/stripe/resources/capital/financing_offer.rb +32 -0
  12. data/lib/stripe/resources/capital/financing_summary.rb +12 -0
  13. data/lib/stripe/resources/capital/financing_transaction.rb +13 -0
  14. data/lib/stripe/resources/customer_session.rb +12 -0
  15. data/lib/stripe/resources/financial_connections/account.rb +39 -0
  16. data/lib/stripe/resources/financial_connections/inferred_balance.rb +13 -0
  17. data/lib/stripe/resources/financial_connections/transaction.rb +13 -0
  18. data/lib/stripe/resources/gift_cards/card.rb +25 -0
  19. data/lib/stripe/resources/gift_cards/transaction.rb +56 -0
  20. data/lib/stripe/resources/issuing/card_bundle.rb +13 -0
  21. data/lib/stripe/resources/issuing/card_design.rb +58 -0
  22. data/lib/stripe/resources/order.rb +89 -0
  23. data/lib/stripe/resources/payment_method_configuration.rb +13 -0
  24. data/lib/stripe/resources/quote.rb +131 -0
  25. data/lib/stripe/resources/quote_phase.rb +29 -0
  26. data/lib/stripe/resources/subscription_schedule.rb +18 -0
  27. data/lib/stripe/resources/tax/registration.rb +19 -0
  28. data/lib/stripe/resources/terminal/reader.rb +54 -0
  29. data/lib/stripe/resources.rb +15 -0
  30. data/lib/stripe/stripe_client.rb +60 -26
  31. data/lib/stripe/stripe_configuration.rb +3 -0
  32. data/lib/stripe/util.rb +8 -1
  33. data/lib/stripe/version.rb +1 -1
  34. data/lib/stripe.rb +47 -0
  35. metadata +19 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dfcf23587dbf38e28cab0b74cbb9419e67356cec27138393a6112e41ebad55b5
4
- data.tar.gz: 7b8859429ac9fcadca1af8d6085f0cae63fb33dc95755c66bac128cf592efe38
3
+ metadata.gz: 4d6ac8a47052e7d62cc1c90a820a80e48ba2b41afc762adaa4484d66285c7be6
4
+ data.tar.gz: 5402314f589374d47902af46944ba32e52f677b08c58dbda6f8f712d73e9ac2d
5
5
  SHA512:
6
- metadata.gz: 50336f3cc9ce1acf8bf863057aae31293f27f6e2ed45abb0b1be75ddb48082f963eaf3ba9fa0fb8226244fc82d7ed94daef9c9740ed1e724281c4ddecb3f6dda
7
- data.tar.gz: 5cd44c495b8c3eeba5d3db29f187c1d145684e3074324f38373b4ce87428c5ece7fe219250730c7c46846b54fe367c17409f37e7e7a08d8feb3677c38147aec9
6
+ metadata.gz: c689945d61327093b962ce9ee5c25e804fcd6010b6f6da08580af905db6fb9b6fe37be15d1868fbcfd5e67d5bc02da6478d45ebf039edb829fac9db95057e17c
7
+ data.tar.gz: c7b986c14cbc246109e61041362ee3e303ce073eda4fa51c0b740f0483bb484926963939abe9bd4020eb1e089c306b4fa542466d9d3c61ff69c65c66e301b948
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 8.7.0-beta.1 - 2023-07-13
4
+ * [#1245](https://github.com/stripe/stripe-ruby/pull/1245) Update generated code for beta
5
+ Release specs are identical.
6
+ * [#1243](https://github.com/stripe/stripe-ruby/pull/1243) Update generated code for beta
7
+ * Add support for new resource `PaymentMethodConfiguration`
8
+ * Add support for `create`, `list`, `retrieve`, and `update` methods on resource `PaymentMethodConfiguration`
9
+ * [#1239](https://github.com/stripe/stripe-ruby/pull/1239) Update generated code for beta
10
+
11
+
3
12
  ## 8.6.0 - 2023-07-13
4
13
  * [#1244](https://github.com/stripe/stripe-ruby/pull/1244) Update generated code
5
14
  * Add support for new resource `Tax.Settings`
@@ -28,13 +37,49 @@
28
37
 
29
38
  * [#1204](https://github.com/stripe/stripe-ruby/pull/1204) Update generated code
30
39
 
40
+ ## 8.6.0-beta.6 - 2023-06-22
41
+ * [#1237](https://github.com/stripe/stripe-ruby/pull/1237) Update generated code for beta
42
+ * Add support for new resource `CustomerSession`
43
+ * Add support for `create` method on resource `CustomerSession`
44
+ * [#1233](https://github.com/stripe/stripe-ruby/pull/1233) Update generated code for beta
45
+ * [#1229](https://github.com/stripe/stripe-ruby/pull/1229) Update generated code for beta
46
+
47
+ ## 8.6.0-beta.5 - 2023-06-01
48
+ * [#1227](https://github.com/stripe/stripe-ruby/pull/1227) Update generated code for beta
49
+ * [#1228](https://github.com/stripe/stripe-ruby/pull/1228) Document raw_request
50
+ * [#1222](https://github.com/stripe/stripe-ruby/pull/1222) Update generated code for beta
51
+ * [#1224](https://github.com/stripe/stripe-ruby/pull/1224) Handle developer message in preview error responses
52
+
53
+ ## 8.6.0-beta.4 - 2023-05-19
54
+ * [#1220](https://github.com/stripe/stripe-ruby/pull/1220) Update generated code for beta
55
+ * Add support for `subscribe` and `unsubscribe` methods on resource `FinancialConnections.Account`
56
+ * [#1217](https://github.com/stripe/stripe-ruby/pull/1217) Add raw_request
57
+ * [#1216](https://github.com/stripe/stripe-ruby/pull/1216) Update generated code for beta
58
+ * [#1214](https://github.com/stripe/stripe-ruby/pull/1214) Update generated code for beta
59
+
60
+ ## 8.6.0-beta.3 - 2023-04-17
61
+ * [#1211](https://github.com/stripe/stripe-ruby/pull/1211) Update generated code for beta
62
+ * [#1210](https://github.com/stripe/stripe-ruby/pull/1210), [#1212](https://github.com/stripe/stripe-ruby/pull/1212), [#1213](https://github.com/stripe/stripe-ruby/pull/1213) Add support for request signing
63
+
64
+ ## 8.6.0-beta.2 - 2023-04-13
65
+ * [#1206](https://github.com/stripe/stripe-ruby/pull/1206) Update generated code for beta
66
+ * Add support for `collect_payment_method` and `confirm_payment_intent` methods on resource `Terminal.Reader`
67
+ * [#1205](https://github.com/stripe/stripe-ruby/pull/1205) Update generated code for beta
68
+
69
+ ## 8.6.0-beta.1 - 2023-03-30
70
+ * [#1202](https://github.com/stripe/stripe-ruby/pull/1202) Update generated code for beta
31
71
 
32
72
  ## 8.5.0 - 2023-03-30
33
73
  * [#1203](https://github.com/stripe/stripe-ruby/pull/1203) Update generated code
34
- * Remove support for `create` method on resource `Tax.Transaction`
74
+ * Remove support for `create` method on resource `Tax.Transaction`
35
75
  * This is not a breaking change, as this method was deprecated before the Tax Transactions API was released in favor of the `create_from_calculation` method.
36
76
  * [#1201](https://github.com/stripe/stripe-ruby/pull/1201) Update save deprecation message
37
77
 
78
+ ## 8.5.0-beta.1 - 2023-03-23
79
+ * [#1194](https://github.com/stripe/stripe-ruby/pull/1194) Update generated code for beta (new)
80
+ * Add support for new resources `Tax.CalculationLineItem` and `Tax.TransactionLineItem`
81
+ * Add support for `collect_inputs` method on resource `Terminal.Reader`
82
+
38
83
  ## 8.4.0 - 2023-03-23
39
84
  * [#1197](https://github.com/stripe/stripe-ruby/pull/1197) Update generated code (new)
40
85
  * Add support for new resources `Tax.CalculationLineItem`, `Tax.Calculation`, `Tax.TransactionLineItem`, and `Tax.Transaction`
@@ -42,18 +87,91 @@
42
87
  * Add support for `create_from_calculation`, `create_reversal`, `create`, `list_line_items`, and `retrieve` methods on resource `Transaction`
43
88
  * [#1152](https://github.com/stripe/stripe-ruby/pull/1152) Symbolize hash keys inside `convert_to_stripe_object_with_params`
44
89
 
90
+ ## 8.4.0-beta.4 - 2023-03-16
91
+ * [#1189](https://github.com/stripe/stripe-ruby/pull/1189) Update generated code for beta (new)
92
+ * Add support for `create_from_calculation` method on resource `Tax.Transaction`
93
+ * [#1188](https://github.com/stripe/stripe-ruby/pull/1188) Update generated code for beta (new)
94
+ * Remove support for resources `Capital.FinancingOffer` and `Capital.FinancingSummary`
95
+ * Remove support for `list`, `mark_delivered`, and `retrieve` methods on resource `FinancingOffer`
96
+ * Remove support for `retrieve` method on resource `FinancingSummary`
97
+ * [#1187](https://github.com/stripe/stripe-ruby/pull/1187) Merge upstream master
98
+
99
+ ## 8.4.0-beta.3 - 2023-03-09
100
+ * [#1184](https://github.com/stripe/stripe-ruby/pull/1184) API Updates for beta branch
101
+ * Updated stable APIs to the latest version
102
+ * Remove support for `list_transactions` method on resource `Tax.Transaction`
103
+
104
+ ## 8.4.0-beta.2 - 2023-03-03
105
+ * [#1183](https://github.com/stripe/stripe-ruby/pull/1183) API Updates for beta branch
106
+ * Updated stable APIs to the latest version
107
+ * Add support for new resources `Issuing.CardBundle` and `Issuing.CardDesign`
108
+ * Add support for `list` and `retrieve` methods on resource `CardBundle`
109
+ * Add support for `list`, `retrieve`, and `update` methods on resource `CardDesign`
110
+
111
+ ## 8.4.0-beta.1 - 2023-02-23
112
+ * [#1182](https://github.com/stripe/stripe-ruby/pull/1182) API Updates for beta branch
113
+ * Updated stable APIs to the latest version
114
+
45
115
  ## 8.3.0 - 2023-02-16
46
116
  * [#1175](https://github.com/stripe/stripe-ruby/pull/1175) API Updates
47
117
  * Add support for `refund_payment` method on resource `Terminal.Reader`
48
118
 
119
+ ## 8.3.0-beta.1 - 2023-02-02
120
+ * [#1174](https://github.com/stripe/stripe-ruby/pull/1174) API Updates for beta branch
121
+ * Updated stable APIs to the latest version
122
+ * Add support for new resource `FinancialConnections.Transaction`
123
+ * Add support for `list` method on resource `Transaction`
124
+
49
125
  ## 8.2.0 - 2023-02-02
50
126
  * [#1173](https://github.com/stripe/stripe-ruby/pull/1173) API Updates
51
127
  * Add support for `resume` method on resource `Subscription`
52
128
  * [#1171](https://github.com/stripe/stripe-ruby/pull/1171) Remove unused `partial` param from `initialize_from`
53
129
 
130
+ ## 8.2.0-beta.3 - 2023-01-26
131
+ * [#1172](https://github.com/stripe/stripe-ruby/pull/1172) API Updates for beta branch
132
+ * Updated stable APIs to the latest version
133
+ * Add support for `list_transactions` method on resource `Tax.Transaction`
134
+
135
+ ## 8.2.0-beta.2 - 2023-01-19
136
+ * [#1170](https://github.com/stripe/stripe-ruby/pull/1170) API Updates for beta branch
137
+ * Updated stable APIs to the latest version
138
+ * Add support for `Tax.Settings` resource.
139
+
140
+ ## 8.2.0-beta.1 - 2023-01-12
141
+ * [#1167](https://github.com/stripe/stripe-ruby/pull/1167) API Updates for beta branch
142
+ * Updated stable APIs to the latest version
143
+ * Change `quote.draft_quote` implementation to from calling `POST /v1/quotes/{quote}/draft` to `POST /v1/quotes/{quote}/mark_draft`
144
+ * Add support for `Tax::Register` resource
145
+
54
146
  ## 8.1.0 - 2023-01-12
55
147
  * [#1162](https://github.com/stripe/stripe-ruby/pull/1162) Improve request events instrumentation
56
148
 
149
+ ## 8.1.0-beta.4 - 2023-01-05
150
+ * [#1164](https://github.com/stripe/stripe-ruby/pull/1164) API Updates for beta branch
151
+ * Updated stable APIs to the latest version
152
+ * Add support for `mark_stale_quote` method on resource `Quote`
153
+
154
+ ## 8.1.0-beta.3 - 2022-12-22
155
+ * [#1158](https://github.com/stripe/stripe-ruby/pull/1158) API Updates for beta branch
156
+ * Updated stable APIs to the latest version
157
+ * Move `TaxCalculation` and `TaxTransaction` to `Tax::Calculation` and `Tax::Transaction`.
158
+
159
+ ## 8.1.0-beta.2 - 2022-12-15
160
+ * [#1156](https://github.com/stripe/stripe-ruby/pull/1156) API Updates for beta branch
161
+ * Updated stable APIs to the latest version
162
+ * Add support for new resources `TaxCalculation`, and `TaxTransaction`
163
+ * Add support for `create` and `list_line_items` methods on resource `TaxCalculation`
164
+ * Add support for `create_reversal`, `create`, and `retrieve` methods on resource `TaxTransaction`
165
+ * [#1155](https://github.com/stripe/stripe-ruby/pull/1155) API Updates for beta branch
166
+ * Updated stable APIs to the latest version
167
+ * Add support for new resource `QuoteLine`.
168
+
169
+ ## 8.1.0-beta.1 - 2022-12-08
170
+ * [#1153](https://github.com/stripe/stripe-ruby/pull/1153) API Updates for beta branch
171
+ * Updated stable APIs to the latest version
172
+ * [#1146](https://github.com/stripe/stripe-ruby/pull/1146) API Updates for beta branch
173
+ * Updated stable APIs to the latest version
174
+
57
175
  ## 8.0.0 - 2022-11-16
58
176
  * [#1144](https://github.com/stripe/stripe-ruby/pull/1144) Next major release changes
59
177
 
@@ -61,30 +179,29 @@ Breaking changes that arose during code generation of the library that we postpo
61
179
 
62
180
  "⚠️" symbol highlights breaking changes.
63
181
 
64
- ### Deprecated
65
- - The `save` method is deprecated. Prefer the static `update` method that doesn't require retrieval of the resource to update it.
66
- ``` ruby
67
- # before
68
- refund = Stripe::Refund.retrieve("re_123")
69
- refund.description = "Refund description"
70
- refund.save
71
-
72
- # after
73
- Stripe::Refund.update("re_123", description: "Refund description")
74
- ```
182
+ ## 7.2.0-beta.5 - 2022-11-02
183
+ * [#1139](https://github.com/stripe/stripe-ruby/pull/1139) API Updates for beta branch
184
+ * Updated beta APIs to the latest stable version
185
+ * [#1135](https://github.com/stripe/stripe-ruby/pull/1135) API Updates for beta branch
186
+ * Updated stable APIs to the latest version
75
187
 
76
- ### ⚠️ Removed
77
- - Removed deprecated `Sku` resource.
78
- - Removed deprecated `Orders` resource.
79
- - Removed deprecated `delete` method on `Subscription` resource. Please use `cancel` method instead.
80
- ```ruby
81
- # before
82
- Stripe::Subscription::delete("sub_12345")
188
+ ## 7.2.0-beta.4 - 2022-10-07
189
+ * [#999](https://github.com/stripe/stripe-ruby/pull/999) DESCRIBE CHANGES HERE (try to use the same style, tense, etc. as the other entries)
83
190
 
84
- # after
85
- Stripe::Subscription::cancel("sub_12345")
86
- ```
191
+ ## 7.2.0-beta.3 - 2022-09-26
192
+ * [#1129](https://github.com/stripe/stripe-ruby/pull/1129) API Updates for beta branch
193
+ * Updated stable APIs to the latest version
194
+ * Add `FinancingOffer`, `FinancingSummary` and `FinancingTransaction` resources.
87
195
 
196
+ ## 7.2.0-beta.2 - 2022-08-26
197
+ * [#1127](https://github.com/stripe/stripe-ruby/pull/1127) API Updates for beta branch
198
+ * Updated stable APIs to the latest version
199
+ * Add support for the beta [Gift Card API](https://stripe.com/docs/gift-cards).
200
+
201
+ ## 7.2.0-beta.1 - 2022-08-23
202
+ * [#1122](https://github.com/stripe/stripe-ruby/pull/1122) API Updates for beta branch
203
+ - Updated stable APIs to the latest version
204
+ - `Stripe-Version` beta headers are not pinned by-default and need to be manually specified, please refer to [beta SDKs README section](https://github.com/stripe/stripe-ruby/blob/master/README.md#beta-sdks)
88
205
 
89
206
  ## 7.1.0 - 2022-08-19
90
207
  * [#1116](https://github.com/stripe/stripe-ruby/pull/1116) API Updates
@@ -93,6 +210,16 @@ Breaking changes that arose during code generation of the library that we postpo
93
210
  * [#1117](https://github.com/stripe/stripe-ruby/pull/1117) Refresh rubocop config.
94
211
  * [#1115](https://github.com/stripe/stripe-ruby/pull/1115) Add a support section to the readme
95
212
 
213
+ ## 7.1.0-beta.2 - 2022-08-11
214
+ * [#1113](https://github.com/stripe/stripe-ruby/pull/1113) API Updates for beta branch
215
+ - Updated stable APIs to the latest version
216
+ - Add `refund_payment` method to Terminal resource
217
+
218
+ ## 7.1.0-beta.1 - 2022-08-03
219
+ * [#1107](https://github.com/stripe/stripe-ruby/pull/1107) API Updates for beta branch
220
+ - Updated stable APIs to the latest version
221
+ - Added the `Order` resource support
222
+
96
223
  ## 7.0.0 - 2022-08-02
97
224
 
98
225
  Breaking changes that arose during code generation of the library that we postponed for the next major version. For changes to the SDK, read more detailed description at https://github.com/stripe/stripe-ruby/wiki/Migration-guide-for-v7. For changes to the Stripe products, read more at https://stripe.com/docs/upgrades#2022-08-01.
@@ -104,21 +231,19 @@ Breaking changes that arose during code generation of the library that we postpo
104
231
  * [#1090](https://github.com/stripe/stripe-ruby/pull/1090) Use auto-generation for `Invoice` methods
105
232
  * [#1103](https://github.com/stripe/stripe-ruby/pull/1103) Next major release changes
106
233
 
107
- ### ⚠️ Changed
108
- * `retrieve_cash_balance` and `update_cash_balance` methods on `Customer` resource no longer requires the second argument to always be `nil`. The methods now now take in `customer_id`, `params`, and `opts` parameters.
109
- * Update default bundle of CA certificates to April 26, 2022.
110
-
111
- ### Deprecated
112
- * Deprecate `delete` method on `Subscription` resource. Please use `cancel` method instead.
113
-
114
- ### ⚠️ Removed
115
- * Remove `details` method from `Issuing.Card` resource. The method was not supported.
116
- * Remove `Issuing.CardDetails` resource. Read more at https://stripe.com/docs/issuing/cards/virtual.
117
- * Remove `create` method from `ReportType` resource. The method was not supported.
118
- * Remove `usage_record_summaries` method from `SubscriptionItem` resource. Please use `list_usage_record_summaries` method instead.
119
- * Remove `AlipayAccount`, `BitcoinReceiver`, `BitcoinTransaction`, `Issuing::CardDetails`, `Recipient`, ` RecipientTransfer`, and `ThreeDSecure` resources. The resources were deprecated or no longer in use.
120
- * Remove ability to list `Card` resource for a `Recipient`.
121
- * Remove `cancel` method from `Transfer` resource. The method was deprecated.
234
+ ## 6.6.0-beta.1 - 2022-07-22
235
+ * [#1100](https://github.com/stripe/stripe-ruby/pull/1100) API Updates for beta branch
236
+ - Updated stable APIs to the latest version
237
+ - Add `QuotePhase` resource
238
+ * [#1097](https://github.com/stripe/stripe-ruby/pull/1097) API Updates for beta branch
239
+ - Updated stable APIs to the latest version
240
+ - Add `SubscriptionSchedule.amend` method.
241
+ * [#1093](https://github.com/stripe/stripe-ruby/pull/1093) API Updates for beta branch
242
+ - Include `server_side_confirmation_beta=v1` beta
243
+ - Add `secretKeyConfirmation` to `PaymentIntent`
244
+ * [#1085](https://github.com/stripe/stripe-ruby/pull/1085) API Updates for beta branch
245
+ - Updated stable APIs to the latest version
246
+ * [#1075](https://github.com/stripe/stripe-ruby/pull/1075) Use the generated API version
122
247
 
123
248
  ## 6.5.0 - 2022-06-29
124
249
  * [#1084](https://github.com/stripe/stripe-ruby/pull/1084) API Updates
@@ -148,8 +273,6 @@ Breaking changes that arose during code generation of the library that we postpo
148
273
  * Add support for new resources `Treasury.CreditReversal`, `Treasury.DebitReversal`, `Treasury.FinancialAccountFeatures`, `Treasury.FinancialAccount`, `Treasury.FlowDetails`, `Treasury.InboundTransfer`, `Treasury.OutboundPayment`, `Treasury.OutboundTransfer`, `Treasury.ReceivedCredit`, `Treasury.ReceivedDebit`, `Treasury.TransactionEntry`, and `Treasury.Transaction`
149
274
  * Add support for `retrieve_payment_method` method on resource `Customer`
150
275
  * Add support for `list_owners` and `list` methods on resource `FinancialConnections.Account`
151
-
152
-
153
276
 
154
277
  ## 6.0.0 - 2022-05-09
155
278
  * [#1056](https://github.com/stripe/stripe-ruby/pull/1056) API Updates
@@ -165,7 +288,6 @@ Breaking changes that arose during code generation of the library that we postpo
165
288
  ## 5.55.0 - 2022-05-05
166
289
  * [#1055](https://github.com/stripe/stripe-ruby/pull/1055) API Updates
167
290
  * Add support for new resources `FinancialConnections.AccountOwner`, `FinancialConnections.AccountOwnership`, `FinancialConnections.Account`, and `FinancialConnections.Session`
168
-
169
291
 
170
292
  ## 5.54.0 - 2022-05-03
171
293
  * [#1053](https://github.com/stripe/stripe-ruby/pull/1053) API Updates
@@ -1196,3 +1318,4 @@ Identical to 1.56.0 above. I incorrectly cut a patch-level release.
1196
1318
  <!--
1197
1319
  # vim: set tw=0:
1198
1320
  -->
1321
+
data/OPENAPI_VERSION CHANGED
@@ -1 +1 @@
1
- v413
1
+ v417
data/README.md CHANGED
@@ -323,6 +323,17 @@ If your beta feature requires a `Stripe-Version` header to be sent, use the `Str
323
323
  Stripe.api_version += "; feature_beta=v3"
324
324
  ```
325
325
 
326
+ ### Custom requests
327
+
328
+ If you would like to send a request to an undocumented API (for example you are in a private beta), or if you prefer to bypass the method definitions in the library and specify your request details directly, you can use the `raw_request` method on `Stripe`.
329
+
330
+ ```ruby
331
+ resp = Stripe.raw_request(:post, "/v1/beta_endpoint", {param: 123}, {stripe_version: "2022-11-15; feature_beta=v3"})
332
+
333
+ # (Optional) resp is a StripeResponse. You can use `Stripe.deserialize` to get a StripeObject.
334
+ deserialized_resp = Stripe.deserialize(resp.http_body)
335
+ ```
336
+
326
337
  ## Support
327
338
 
328
339
  New features and bug fixes are released on the latest major version of the Stripe Ruby library. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 8.6.0
1
+ 8.7.0-beta.1
@@ -47,6 +47,7 @@ module Stripe
47
47
  api_key = headers.delete(:api_key)
48
48
  api_base = headers.delete(:api_base)
49
49
  client = headers.delete(:client)
50
+ api_mode = headers.delete(:api_mode)
50
51
  # Assume all remaining opts must be headers
51
52
 
52
53
  resp, opts[:api_key] = client.send(
@@ -54,6 +55,7 @@ module Stripe
54
55
  method, url,
55
56
  api_base: api_base, api_key: api_key,
56
57
  headers: headers, params: params,
58
+ api_mode: api_mode,
57
59
  &read_body_chunk_block
58
60
  )
59
61
 
@@ -4,5 +4,6 @@
4
4
  module Stripe
5
5
  module ApiVersion
6
6
  CURRENT = "2022-11-15"
7
+ PREVIEW = "20230712T200515"
7
8
  end
8
9
  end
@@ -14,6 +14,7 @@ module Stripe
14
14
  # business objects
15
15
  Account::OBJECT_NAME => Account,
16
16
  AccountLink::OBJECT_NAME => AccountLink,
17
+ AccountSession::OBJECT_NAME => AccountSession,
17
18
  ApplePayDomain::OBJECT_NAME => ApplePayDomain,
18
19
  ApplicationFee::OBJECT_NAME => ApplicationFee,
19
20
  ApplicationFeeRefund::OBJECT_NAME => ApplicationFeeRefund,
@@ -24,6 +25,9 @@ module Stripe
24
25
  BillingPortal::Configuration::OBJECT_NAME => BillingPortal::Configuration,
25
26
  BillingPortal::Session::OBJECT_NAME => BillingPortal::Session,
26
27
  Capability::OBJECT_NAME => Capability,
28
+ Capital::FinancingOffer::OBJECT_NAME => Capital::FinancingOffer,
29
+ Capital::FinancingSummary::OBJECT_NAME => Capital::FinancingSummary,
30
+ Capital::FinancingTransaction::OBJECT_NAME => Capital::FinancingTransaction,
27
31
  Card::OBJECT_NAME => Card,
28
32
  CashBalance::OBJECT_NAME => CashBalance,
29
33
  Charge::OBJECT_NAME => Charge,
@@ -35,6 +39,7 @@ module Stripe
35
39
  Customer::OBJECT_NAME => Customer,
36
40
  CustomerBalanceTransaction::OBJECT_NAME => CustomerBalanceTransaction,
37
41
  CustomerCashBalanceTransaction::OBJECT_NAME => CustomerCashBalanceTransaction,
42
+ CustomerSession::OBJECT_NAME => CustomerSession,
38
43
  Discount::OBJECT_NAME => Discount,
39
44
  Dispute::OBJECT_NAME => Dispute,
40
45
  EphemeralKey::OBJECT_NAME => EphemeralKey,
@@ -47,8 +52,12 @@ module Stripe
47
52
  FinancialConnections::AccountOwner::OBJECT_NAME => FinancialConnections::AccountOwner,
48
53
  FinancialConnections::AccountOwnership::OBJECT_NAME =>
49
54
  FinancialConnections::AccountOwnership,
55
+ FinancialConnections::InferredBalance::OBJECT_NAME => FinancialConnections::InferredBalance,
50
56
  FinancialConnections::Session::OBJECT_NAME => FinancialConnections::Session,
57
+ FinancialConnections::Transaction::OBJECT_NAME => FinancialConnections::Transaction,
51
58
  FundingInstructions::OBJECT_NAME => FundingInstructions,
59
+ GiftCards::Card::OBJECT_NAME => GiftCards::Card,
60
+ GiftCards::Transaction::OBJECT_NAME => GiftCards::Transaction,
52
61
  Identity::VerificationReport::OBJECT_NAME => Identity::VerificationReport,
53
62
  Identity::VerificationSession::OBJECT_NAME => Identity::VerificationSession,
54
63
  Invoice::OBJECT_NAME => Invoice,
@@ -56,15 +65,19 @@ module Stripe
56
65
  InvoiceLineItem::OBJECT_NAME => InvoiceLineItem,
57
66
  Issuing::Authorization::OBJECT_NAME => Issuing::Authorization,
58
67
  Issuing::Card::OBJECT_NAME => Issuing::Card,
68
+ Issuing::CardBundle::OBJECT_NAME => Issuing::CardBundle,
69
+ Issuing::CardDesign::OBJECT_NAME => Issuing::CardDesign,
59
70
  Issuing::Cardholder::OBJECT_NAME => Issuing::Cardholder,
60
71
  Issuing::Dispute::OBJECT_NAME => Issuing::Dispute,
61
72
  Issuing::Transaction::OBJECT_NAME => Issuing::Transaction,
62
73
  LineItem::OBJECT_NAME => LineItem,
63
74
  LoginLink::OBJECT_NAME => LoginLink,
64
75
  Mandate::OBJECT_NAME => Mandate,
76
+ Order::OBJECT_NAME => Order,
65
77
  PaymentIntent::OBJECT_NAME => PaymentIntent,
66
78
  PaymentLink::OBJECT_NAME => PaymentLink,
67
79
  PaymentMethod::OBJECT_NAME => PaymentMethod,
80
+ PaymentMethodConfiguration::OBJECT_NAME => PaymentMethodConfiguration,
68
81
  Payout::OBJECT_NAME => Payout,
69
82
  Person::OBJECT_NAME => Person,
70
83
  Plan::OBJECT_NAME => Plan,
@@ -72,6 +85,7 @@ module Stripe
72
85
  Product::OBJECT_NAME => Product,
73
86
  PromotionCode::OBJECT_NAME => PromotionCode,
74
87
  Quote::OBJECT_NAME => Quote,
88
+ QuotePhase::OBJECT_NAME => QuotePhase,
75
89
  Radar::EarlyFraudWarning::OBJECT_NAME => Radar::EarlyFraudWarning,
76
90
  Radar::ValueList::OBJECT_NAME => Radar::ValueList,
77
91
  Radar::ValueListItem::OBJECT_NAME => Radar::ValueListItem,
@@ -90,6 +104,7 @@ module Stripe
90
104
  SubscriptionItem::OBJECT_NAME => SubscriptionItem,
91
105
  SubscriptionSchedule::OBJECT_NAME => SubscriptionSchedule,
92
106
  Tax::Calculation::OBJECT_NAME => Tax::Calculation,
107
+ Tax::Registration::OBJECT_NAME => Tax::Registration,
93
108
  Tax::Settings::OBJECT_NAME => Tax::Settings,
94
109
  Tax::Transaction::OBJECT_NAME => Tax::Transaction,
95
110
  TaxCode::OBJECT_NAME => TaxCode,
@@ -0,0 +1,83 @@
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
+ unless auth_token.is_a?(String)
17
+ raise ArgumentError, "auth_token must be a string"
18
+ end
19
+ unless sign_lambda.is_a?(Proc)
20
+ raise ArgumentError, "sign_lambda must be a lambda"
21
+ end
22
+
23
+ @auth_token = auth_token
24
+ @sign_lambda = sign_lambda
25
+ end
26
+
27
+ def authenticate(method, headers, body)
28
+ covered_headers = [CONTENT_TYPE_HEADER_NAME,
29
+ CONTENT_DIGEST_HEADER_NAME,
30
+ STRIPE_CONTEXT_HEADER_NAME,
31
+ STRIPE_ACCOUNT_HEADER_NAME,
32
+ AUTHORIZATION_HEADER_NAME,]
33
+
34
+ headers[AUTHORIZATION_HEADER_NAME] = "STRIPE-V2-SIG #{auth_token}"
35
+
36
+ if method == :get
37
+ covered_headers -= [CONTENT_TYPE_HEADER_NAME,
38
+ CONTENT_DIGEST_HEADER_NAME,]
39
+ else
40
+ content = body || ""
41
+ headers[CONTENT_DIGEST_HEADER_NAME] =
42
+ %(sha-256=:#{content_digest(content)}:)
43
+ end
44
+
45
+ covered_headers_formatted = covered_headers
46
+ .map { |string| %("#{string.downcase}") }
47
+ .join(" ")
48
+
49
+ signature_input = "(#{covered_headers_formatted});created=#{created_time}"
50
+
51
+ inputs = covered_headers
52
+ .map { |header| %("#{header.downcase}": #{headers[header]}) }
53
+ .join("\n")
54
+
55
+ signature_base = %(#{inputs}\n"@signature-params": #{signature_input})
56
+ .encode(Encoding::UTF_8)
57
+
58
+ headers[SIGNATURE_INPUT_HEADER_NAME] = "sig1=#{signature_input}"
59
+
60
+ headers[SIGNATURE_HEADER_NAME] =
61
+ "sig1=:#{encoded_signature(signature_base)}:"
62
+ end
63
+
64
+ private def sign(signature_base)
65
+ @sign_lambda.call(signature_base)
66
+ end
67
+
68
+ private def encoded_signature(signature_base)
69
+ Base64.strict_encode64(sign(signature_base))
70
+ rescue StandardError
71
+ raise AuthenticationError, "Encountered '#{e.message} (#{e.class})' "\
72
+ "when calculating request signature."
73
+ end
74
+
75
+ private def content_digest(content)
76
+ Base64.strict_encode64(OpenSSL::Digest.new("SHA256").digest(content))
77
+ end
78
+
79
+ private def created_time
80
+ Time.now.to_i
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,17 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ # An AccountSession allows a Connect platform to grant access to a connected account in Connect embedded components.
6
+ #
7
+ # We recommend that you create an AccountSession each time you need to display an embedded component
8
+ # to your user. Do not save AccountSessions to your database as they expire relatively
9
+ # quickly, and cannot be used more than once.
10
+ #
11
+ # Related guide: [Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components)
12
+ class AccountSession < APIResource
13
+ extend Stripe::APIOperations::Create
14
+
15
+ OBJECT_NAME = "account_session"
16
+ end
17
+ end
@@ -0,0 +1,32 @@
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
+
13
+ def mark_delivered(params = {}, opts = {})
14
+ request_stripe_object(
15
+ method: :post,
16
+ path: format("/v1/capital/financing_offers/%<financing_offer>s/mark_delivered", { financing_offer: CGI.escape(self["id"]) }),
17
+ params: params,
18
+ opts: opts
19
+ )
20
+ end
21
+
22
+ def self.mark_delivered(financing_offer, params = {}, opts = {})
23
+ request_stripe_object(
24
+ method: :post,
25
+ path: format("/v1/capital/financing_offers/%<financing_offer>s/mark_delivered", { financing_offer: CGI.escape(financing_offer) }),
26
+ params: params,
27
+ opts: opts
28
+ )
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,12 @@
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
+ end
11
+ end
12
+ end
@@ -0,0 +1,13 @@
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
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ # A customer session allows you to grant client access to Stripe's frontend SDKs (like StripeJs)
6
+ # control over a customer.
7
+ class CustomerSession < APIResource
8
+ extend Stripe::APIOperations::Create
9
+
10
+ OBJECT_NAME = "customer_session"
11
+ end
12
+ end
@@ -6,9 +6,12 @@ module Stripe
6
6
  # A Financial Connections Account represents an account that exists outside of Stripe, to which you have been granted some degree of access.
7
7
  class Account < APIResource
8
8
  extend Stripe::APIOperations::List
9
+ extend Stripe::APIOperations::NestedResource
9
10
 
10
11
  OBJECT_NAME = "financial_connections.account"
11
12
 
13
+ nested_resource_class_methods :inferred_balance, operations: %i[list]
14
+
12
15
  def disconnect(params = {}, opts = {})
13
16
  request_stripe_object(
14
17
  method: :post,
@@ -36,6 +39,24 @@ module Stripe
36
39
  )
37
40
  end
38
41
 
42
+ def subscribe(params = {}, opts = {})
43
+ request_stripe_object(
44
+ method: :post,
45
+ path: format("/v1/financial_connections/accounts/%<account>s/subscribe", { account: CGI.escape(self["id"]) }),
46
+ params: params,
47
+ opts: opts
48
+ )
49
+ end
50
+
51
+ def unsubscribe(params = {}, opts = {})
52
+ request_stripe_object(
53
+ method: :post,
54
+ path: format("/v1/financial_connections/accounts/%<account>s/unsubscribe", { account: CGI.escape(self["id"]) }),
55
+ params: params,
56
+ opts: opts
57
+ )
58
+ end
59
+
39
60
  def self.disconnect(account, params = {}, opts = {})
40
61
  request_stripe_object(
41
62
  method: :post,
@@ -62,6 +83,24 @@ module Stripe
62
83
  opts: opts
63
84
  )
64
85
  end
86
+
87
+ def self.subscribe(account, params = {}, opts = {})
88
+ request_stripe_object(
89
+ method: :post,
90
+ path: format("/v1/financial_connections/accounts/%<account>s/subscribe", { account: CGI.escape(account) }),
91
+ params: params,
92
+ opts: opts
93
+ )
94
+ end
95
+
96
+ def self.unsubscribe(account, params = {}, opts = {})
97
+ request_stripe_object(
98
+ method: :post,
99
+ path: format("/v1/financial_connections/accounts/%<account>s/unsubscribe", { account: CGI.escape(account) }),
100
+ params: params,
101
+ opts: opts
102
+ )
103
+ end
65
104
  end
66
105
  end
67
106
  end