stripe 5.55.0 → 8.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +122 -2
  3. data/Gemfile +1 -0
  4. data/Makefile +1 -1
  5. data/OPENAPI_VERSION +1 -0
  6. data/README.md +37 -3
  7. data/VERSION +1 -1
  8. data/lib/data/ca-certificates.crt +1241 -1937
  9. data/lib/stripe/api_operations/create.rb +6 -2
  10. data/lib/stripe/api_operations/delete.rb +12 -7
  11. data/lib/stripe/api_operations/list.rb +6 -9
  12. data/lib/stripe/api_operations/nested_resource.rb +62 -34
  13. data/lib/stripe/api_operations/request.rb +10 -0
  14. data/lib/stripe/api_operations/save.rb +11 -3
  15. data/lib/stripe/api_operations/search.rb +6 -9
  16. data/lib/stripe/api_resource.rb +1 -1
  17. data/lib/stripe/api_resource_test_helpers.rb +2 -0
  18. data/lib/stripe/api_version.rb +8 -0
  19. data/lib/stripe/instrumentation.rb +45 -7
  20. data/lib/stripe/object_types.rb +12 -10
  21. data/lib/stripe/resources/account.rb +36 -9
  22. data/lib/stripe/resources/account_link.rb +4 -0
  23. data/lib/stripe/resources/application_fee_refund.rb +5 -0
  24. data/lib/stripe/resources/apps/secret.rb +40 -0
  25. data/lib/stripe/resources/balance.rb +11 -0
  26. data/lib/stripe/resources/balance_transaction.rb +4 -0
  27. data/lib/stripe/resources/bank_account.rb +7 -0
  28. data/lib/stripe/resources/billing_portal/configuration.rb +1 -0
  29. data/lib/stripe/resources/billing_portal/session.rb +14 -0
  30. data/lib/stripe/resources/capability.rb +3 -0
  31. data/lib/stripe/resources/card.rb +6 -3
  32. data/lib/stripe/resources/cash_balance.rb +1 -0
  33. data/lib/stripe/resources/charge.rb +15 -3
  34. data/lib/stripe/resources/checkout/session.rb +41 -5
  35. data/lib/stripe/resources/country_spec.rb +6 -0
  36. data/lib/stripe/resources/coupon.rb +3 -0
  37. data/lib/stripe/resources/credit_note.rb +27 -9
  38. data/lib/stripe/resources/customer.rb +109 -19
  39. data/lib/stripe/resources/customer_balance_transaction.rb +6 -0
  40. data/lib/stripe/resources/customer_cash_balance_transaction.rb +14 -0
  41. data/lib/stripe/resources/discount.rb +4 -0
  42. data/lib/stripe/resources/dispute.rb +17 -3
  43. data/lib/stripe/resources/event.rb +29 -0
  44. data/lib/stripe/resources/exchange_rate.rb +11 -0
  45. data/lib/stripe/resources/file.rb +7 -0
  46. data/lib/stripe/resources/file_link.rb +3 -0
  47. data/lib/stripe/resources/financial_connections/account.rb +42 -6
  48. data/lib/stripe/resources/financial_connections/account_ownership.rb +1 -0
  49. data/lib/stripe/resources/financial_connections/session.rb +1 -0
  50. data/lib/stripe/resources/funding_instructions.rb +5 -0
  51. data/lib/stripe/resources/identity/verification_report.rb +11 -0
  52. data/lib/stripe/resources/identity/verification_session.rb +31 -5
  53. data/lib/stripe/resources/invoice.rb +96 -17
  54. data/lib/stripe/resources/invoice_item.rb +11 -0
  55. data/lib/stripe/resources/issuing/authorization.rb +25 -5
  56. data/lib/stripe/resources/issuing/card.rb +78 -8
  57. data/lib/stripe/resources/issuing/cardholder.rb +3 -0
  58. data/lib/stripe/resources/issuing/dispute.rb +13 -3
  59. data/lib/stripe/resources/issuing/transaction.rb +5 -0
  60. data/lib/stripe/resources/line_item.rb +1 -0
  61. data/lib/stripe/resources/mandate.rb +1 -0
  62. data/lib/stripe/resources/payment_intent.rb +71 -13
  63. data/lib/stripe/resources/payment_link.rb +15 -3
  64. data/lib/stripe/resources/payment_method.rb +25 -5
  65. data/lib/stripe/resources/payout.rb +28 -5
  66. data/lib/stripe/resources/person.rb +6 -0
  67. data/lib/stripe/resources/plan.rb +8 -0
  68. data/lib/stripe/resources/price.rb +6 -0
  69. data/lib/stripe/resources/product.rb +8 -0
  70. data/lib/stripe/resources/promotion_code.rb +2 -0
  71. data/lib/stripe/resources/quote.rb +52 -11
  72. data/lib/stripe/resources/radar/early_fraud_warning.rb +4 -0
  73. data/lib/stripe/resources/radar/value_list.rb +3 -0
  74. data/lib/stripe/resources/radar/value_list_item.rb +3 -0
  75. data/lib/stripe/resources/refund.rb +24 -5
  76. data/lib/stripe/resources/reporting/report_run.rb +8 -0
  77. data/lib/stripe/resources/reporting/report_type.rb +8 -1
  78. data/lib/stripe/resources/reversal.rb +13 -0
  79. data/lib/stripe/resources/review.rb +14 -3
  80. data/lib/stripe/resources/setup_attempt.rb +4 -0
  81. data/lib/stripe/resources/setup_intent.rb +52 -7
  82. data/lib/stripe/resources/shipping_rate.rb +3 -0
  83. data/lib/stripe/resources/sigma/scheduled_query_run.rb +4 -0
  84. data/lib/stripe/resources/source.rb +26 -6
  85. data/lib/stripe/resources/source_transaction.rb +4 -0
  86. data/lib/stripe/resources/subscription.rb +48 -3
  87. data/lib/stripe/resources/subscription_item.rb +2 -7
  88. data/lib/stripe/resources/subscription_schedule.rb +23 -5
  89. data/lib/stripe/resources/tax_code.rb +1 -0
  90. data/lib/stripe/resources/tax_id.rb +4 -0
  91. data/lib/stripe/resources/tax_rate.rb +3 -0
  92. data/lib/stripe/resources/terminal/configuration.rb +1 -0
  93. data/lib/stripe/resources/terminal/connection_token.rb +3 -0
  94. data/lib/stripe/resources/terminal/location.rb +3 -0
  95. data/lib/stripe/resources/terminal/reader.rb +70 -11
  96. data/lib/stripe/resources/test_helpers/test_clock.rb +13 -3
  97. data/lib/stripe/resources/token.rb +22 -0
  98. data/lib/stripe/resources/topup.rb +15 -3
  99. data/lib/stripe/resources/transfer.rb +10 -11
  100. data/lib/stripe/resources/treasury/credit_reversal.rb +14 -0
  101. data/lib/stripe/resources/treasury/debit_reversal.rb +14 -0
  102. data/lib/stripe/resources/treasury/financial_account.rb +52 -0
  103. data/lib/stripe/resources/treasury/inbound_transfer.rb +94 -0
  104. data/lib/stripe/resources/treasury/outbound_payment.rb +96 -0
  105. data/lib/stripe/resources/treasury/outbound_transfer.rb +100 -0
  106. data/lib/stripe/resources/treasury/received_credit.rb +30 -0
  107. data/lib/stripe/resources/treasury/received_debit.rb +30 -0
  108. data/lib/stripe/resources/treasury/transaction.rb +13 -0
  109. data/lib/stripe/resources/treasury/transaction_entry.rb +17 -0
  110. data/lib/stripe/resources/usage_record.rb +4 -0
  111. data/lib/stripe/resources/webhook_endpoint.rb +7 -0
  112. data/lib/stripe/resources.rb +12 -10
  113. data/lib/stripe/stripe_client.rb +25 -17
  114. data/lib/stripe/stripe_object.rb +2 -2
  115. data/lib/stripe/util.rb +38 -3
  116. data/lib/stripe/version.rb +1 -1
  117. metadata +17 -11
  118. data/lib/stripe/resources/bitcoin_receiver.rb +0 -24
  119. data/lib/stripe/resources/bitcoin_transaction.rb +0 -16
  120. data/lib/stripe/resources/issuing/card_details.rb +0 -10
  121. data/lib/stripe/resources/order.rb +0 -33
  122. data/lib/stripe/resources/order_return.rb +0 -10
  123. data/lib/stripe/resources/recipient.rb +0 -14
  124. data/lib/stripe/resources/sku.rb +0 -13
  125. data/lib/stripe/resources/three_d_secure.rb +0 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e81cc3af76a8942f879c1b312bbcc6ad27257cb9b68f9a63df76bd430ff9cf8
4
- data.tar.gz: c83f7ae353941a10279ba76237f64e700f0e6bce06fe9475250b85308f72d57f
3
+ metadata.gz: 8293f29e86f093b7980e362cf7721a56f6b7059b155e2e36b6f3975aa72aad2d
4
+ data.tar.gz: f2885f99fc05115e4398ca14f5e55f8dbe77f4a2565fc1cd9dedd40e8a439ed9
5
5
  SHA512:
6
- metadata.gz: 4b4aff3650ae5933a0fae274bf1fe1e142f8361fbd0b3734502ce317a82492bda2124e155ff335b311abbda1d9751fdbc15e4a1754c94fe8b6d8a24e206b599e
7
- data.tar.gz: f23307331d6ded3934361f9fff180a0ecda5df30bb3f5708e359d3b0712ed5262873b2220400d124544b113249a7ff5f1ae885cef381b9a8b3aa6388295527a7
6
+ metadata.gz: a21a14b0a0e0096ce0801dd6b9370e6e3649630120b79f3e13c171115cdfa51fd6a186e4470fbedecd99d33c9afa7502e2952d7142896cc1ba2a2c1601a2250f
7
+ data.tar.gz: 708a644e596972a37d5c0e9c37164c52df62e73d44588485b5ef7c6d991d63280f9aba9410d8a39bccbc0667ed1cbbf0e905f662e5af96e301ab42d4cfae7eab
data/CHANGELOG.md CHANGED
@@ -1,9 +1,129 @@
1
1
  # Changelog
2
2
 
3
+ ## 8.3.0 - 2023-02-16
4
+ * [#1175](https://github.com/stripe/stripe-ruby/pull/1175) API Updates
5
+ * Add support for `refund_payment` method on resource `Terminal.Reader`
6
+
7
+ ## 8.2.0 - 2023-02-02
8
+ * [#1173](https://github.com/stripe/stripe-ruby/pull/1173) API Updates
9
+ * Add support for `resume` method on resource `Subscription`
10
+ * [#1171](https://github.com/stripe/stripe-ruby/pull/1171) Remove unused `partial` param from `initialize_from`
11
+
12
+ ## 8.1.0 - 2023-01-12
13
+ * [#1162](https://github.com/stripe/stripe-ruby/pull/1162) Improve request events instrumentation
14
+
15
+ ## 8.0.0 - 2022-11-16
16
+ * [#1144](https://github.com/stripe/stripe-ruby/pull/1144) Next major release changes
17
+
18
+ Breaking changes that arose during code generation of the library that we postponed for the next major version. For changes to the Stripe products, read more at https://stripe.com/docs/upgrades#2022-11-15.
19
+
20
+ "⚠️" symbol highlights breaking changes.
21
+
22
+ ### Deprecated
23
+ - The `save` method is deprecated. Prefer the static `update` method that doesn't require retrieval of the resource to update it.
24
+ ``` ruby
25
+ # before
26
+ refund = Stripe::Refund.retrieve("re_123")
27
+ refund.description = "Refund description"
28
+ refund.save
29
+
30
+ # after
31
+ Stripe::Refund.update("re_123", description: "Refund description")
32
+ ```
33
+
34
+ ### ⚠️ Removed
35
+ - Removed deprecated `Sku` resource.
36
+ - Removed deprecated `Orders` resource.
37
+ - Removed deprecated `delete` method on `Subscription` resource. Please use `cancel` method instead.
38
+ ```ruby
39
+ # before
40
+ Stripe::Subscription::delete("sub_12345")
41
+
42
+ # after
43
+ Stripe::Subscription::cancel("sub_12345")
44
+ ```
45
+
46
+
47
+ ## 7.1.0 - 2022-08-19
48
+ * [#1116](https://github.com/stripe/stripe-ruby/pull/1116) API Updates
49
+ * Add support for new resource `CustomerCashBalanceTransaction`
50
+ * [#1118](https://github.com/stripe/stripe-ruby/pull/1118) Update AllowedChars in rubocop config
51
+ * [#1117](https://github.com/stripe/stripe-ruby/pull/1117) Refresh rubocop config.
52
+ * [#1115](https://github.com/stripe/stripe-ruby/pull/1115) Add a support section to the readme
53
+
54
+ ## 7.0.0 - 2022-08-02
55
+
56
+ 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.
57
+
58
+ "⚠️" symbol highlights breaking changes.
59
+
60
+ * [#1106](https://github.com/stripe/stripe-ruby/pull/1106) API Updates
61
+ * [#1092](https://github.com/stripe/stripe-ruby/pull/1092) API Updates
62
+ * [#1090](https://github.com/stripe/stripe-ruby/pull/1090) Use auto-generation for `Invoice` methods
63
+ * [#1103](https://github.com/stripe/stripe-ruby/pull/1103) Next major release changes
64
+
65
+ ### ⚠️ Changed
66
+ * `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.
67
+ * Update default bundle of CA certificates to April 26, 2022.
68
+
69
+ ### Deprecated
70
+ * Deprecate `delete` method on `Subscription` resource. Please use `cancel` method instead.
71
+
72
+ ### ⚠️ Removed
73
+ * Remove `details` method from `Issuing.Card` resource. The method was not supported.
74
+ * Remove `Issuing.CardDetails` resource. Read more at https://stripe.com/docs/issuing/cards/virtual.
75
+ * Remove `create` method from `ReportType` resource. The method was not supported.
76
+ * Remove `usage_record_summaries` method from `SubscriptionItem` resource. Please use `list_usage_record_summaries` method instead.
77
+ * Remove `AlipayAccount`, `BitcoinReceiver`, `BitcoinTransaction`, `Issuing::CardDetails`, `Recipient`, ` RecipientTransfer`, and `ThreeDSecure` resources. The resources were deprecated or no longer in use.
78
+ * Remove ability to list `Card` resource for a `Recipient`.
79
+ * Remove `cancel` method from `Transfer` resource. The method was deprecated.
80
+
81
+ ## 6.5.0 - 2022-06-29
82
+ * [#1084](https://github.com/stripe/stripe-ruby/pull/1084) API Updates
83
+ * Add support for `deliver_card`, `fail_card`, `return_card`, and `ship_card` test helper methods on resource `Issuing.Card`
84
+ * [#1076](https://github.com/stripe/stripe-ruby/pull/1076) fix: Update logging to coerce ASCII-8BIT into UTF-8.
85
+
86
+ ## 6.4.0 - 2022-06-17
87
+ * [#1073](https://github.com/stripe/stripe-ruby/pull/1073) API Updates
88
+ * Add support for `fund_cash_balance` test helper method on resource `Customer`
89
+ * [#1074](https://github.com/stripe/stripe-ruby/pull/1074) Support updating pre-release versions
90
+ * [#1072](https://github.com/stripe/stripe-ruby/pull/1072) Trigger workflows on beta branches
91
+ * [#1071](https://github.com/stripe/stripe-ruby/pull/1071) Use request_stripe_object for all requests
92
+ * [#1070](https://github.com/stripe/stripe-ruby/pull/1070) API Updates
93
+
94
+ Switch from using meta-programing to generating explicit methods for custom methods.
95
+ * [#1069](https://github.com/stripe/stripe-ruby/pull/1069) chore: Stop special implementation of Account.persons method.
96
+
97
+ ## 6.3.0 - 2022-06-08
98
+ * [#1063](https://github.com/stripe/stripe-ruby/pull/1063) fix: Update cash balance methods to no longer require nested ID.
99
+
100
+ ## 6.2.0 - 2022-05-23
101
+ * [#1060](https://github.com/stripe/stripe-ruby/pull/1060) API Updates
102
+ * Add support for new resource `Apps.Secret`
103
+
104
+ ## 6.1.0 - 2022-05-19
105
+ * [#1057](https://github.com/stripe/stripe-ruby/pull/1057) API Updates
106
+ * 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`
107
+ * Add support for `retrieve_payment_method` method on resource `Customer`
108
+ * Add support for `list_owners` and `list` methods on resource `FinancialConnections.Account`
109
+
110
+
111
+
112
+ ## 6.0.0 - 2022-05-09
113
+ * [#1056](https://github.com/stripe/stripe-ruby/pull/1056) API Updates
114
+ Major version release. The [migration guide](https://github.com/stripe/stripe-ruby/wiki/Migration-Guide-for-v6) contains more information.
115
+
116
+ (⚠️ = breaking changes):
117
+ * ⚠️ Replace the legacy `Order` API with the new `Order` API.
118
+ * New methods: `cancel`, `list_line_items`, `reopen`, and `submit`
119
+ * Removed methods: `pay` and `return_order`
120
+ * Removed resources: `OrderItem` and `OrderReturn`
121
+ * ⚠️ Rename `FinancialConnections::Account.refresh` to `FinancialConnections::Account.refresh_account
122
+
3
123
  ## 5.55.0 - 2022-05-05
4
124
  * [#1055](https://github.com/stripe/stripe-ruby/pull/1055) API Updates
5
- * Add support for new resources `FinancialConnections.AccountOwner`, `FinancialConnections.AccountOwnership`, `FinancialConnections.Account`, and `FinancialConnections.Session`
6
-
125
+ * Add support for new resources `FinancialConnections.AccountOwner`, `FinancialConnections.AccountOwnership`, `FinancialConnections.Account`, and `FinancialConnections.Session`
126
+
7
127
 
8
128
  ## 5.54.0 - 2022-05-03
9
129
  * [#1053](https://github.com/stripe/stripe-ruby/pull/1053) API Updates
data/Gemfile CHANGED
@@ -5,6 +5,7 @@ source "https://rubygems.org"
5
5
  gemspec
6
6
 
7
7
  group :development do
8
+ gem "coveralls_reborn", "~> 0.25.0" if RUBY_VERSION >= "3.1"
8
9
  gem "mocha", "~> 0.13.2"
9
10
  gem "rack", ">= 2.0.6"
10
11
  gem "rake"
data/Makefile CHANGED
@@ -1,7 +1,7 @@
1
1
  .PHONY: update-version codegen-format
2
2
  update-version:
3
3
  @echo "$(VERSION)" > VERSION
4
- @perl -pi -e 's|VERSION = "[.\d]+"|VERSION = "$(VERSION)"|' lib/stripe/version.rb
4
+ @perl -pi -e 's|VERSION = "[.\-\w\d]+"|VERSION = "$(VERSION)"|' lib/stripe/version.rb
5
5
 
6
6
  codegen-format:
7
7
  bundle exec rubocop -o /dev/null --auto-correct
data/OPENAPI_VERSION ADDED
@@ -0,0 +1 @@
1
+ v226
data/README.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # Stripe Ruby Library
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/stripe.svg)](https://badge.fury.io/rb/stripe)
4
- [![Build Status](https://travis-ci.org/stripe/stripe-ruby.svg?branch=master)](https://travis-ci.org/stripe/stripe-ruby)
4
+ [![Build Status](https://github.com/stripe/stripe-ruby/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-ruby/actions?query=branch%3Amaster)
5
+ [![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-ruby/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-ruby?branch=master)
5
6
 
6
7
  The Stripe Ruby library provides convenient access to the Stripe API from
7
8
  applications written in the Ruby language. It includes a pre-defined set of
@@ -252,7 +253,11 @@ a success or error. Receives `RequestEndEvent` with the following properties:
252
253
  - `path`: Request path. (`String`)
253
254
  - `user_data`: A hash on which users may have set arbitrary data in
254
255
  `request_begin`. See above for more information. (`Hash`)
255
- - `request_id`. HTTP request identifier.
256
+ - `request_id`: HTTP request identifier. (`String`)
257
+ - `response_header`: The response headers. (`Hash`)
258
+ - `response_body` = The response body. (`String`)
259
+ - `request_header` = The request headers. (`Hash`)
260
+ - `request_body` = The request body. (`String`)
256
261
 
257
262
  #### Example
258
263
 
@@ -260,9 +265,13 @@ For example:
260
265
 
261
266
  ```ruby
262
267
  Stripe::Instrumentation.subscribe(:request_end) do |request_event|
268
+ # Filter out high-cardinality ids from `path`
269
+ path_parts = event.path.split("/").drop(2)
270
+ resource = path_parts.map { |part| part.match?(/\A[a-z_]+\z/) ? part : ":id" }.join("/")
271
+
263
272
  tags = {
264
273
  method: request_event.method,
265
- resource: request_event.path.split('/')[2],
274
+ resource: resource,
266
275
  code: request_event.http_status,
267
276
  retries: request_event.num_retries
268
277
  }
@@ -293,6 +302,31 @@ You can disable this behavior if you prefer:
293
302
  Stripe.enable_telemetry = false
294
303
  ```
295
304
 
305
+ ### Beta SDKs
306
+
307
+ Stripe has features in the beta phase that can be accessed via the beta version of this package.
308
+ We would love for you to try these and share feedback with us before these features reach the stable phase.
309
+ To install a beta version use `gem install` with the exact version you'd like to use:
310
+
311
+ ```sh
312
+ gem install stripe -v 7.1.0.pre.beta.2
313
+ ```
314
+
315
+ > **Note**
316
+ > There can be breaking changes between beta versions. Therefore we recommend pinning the package version to a specific beta version in your Gemfile. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest beta version.
317
+
318
+ We highly recommend keeping an eye on when the beta feature you are interested in goes from beta to stable so that you can move from using a beta version of the SDK to the stable version.
319
+
320
+ If your beta feature requires a `Stripe-Version` header to be sent, use the `Stripe.api_version` field to set it:
321
+
322
+ ```python
323
+ Stripe.api_version += "; feature_beta=v3"
324
+ ```
325
+
326
+ ## Support
327
+
328
+ 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.
329
+
296
330
  ## Development
297
331
 
298
332
  The test suite depends on [stripe-mock], so make sure to fetch and run it from a
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.55.0
1
+ 8.3.0