stripe 10.8.0 → 10.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/Gemfile +3 -0
  4. data/Makefile +7 -0
  5. data/OPENAPI_VERSION +1 -1
  6. data/VERSION +1 -1
  7. data/bin/tapioca +27 -0
  8. data/lib/stripe/api_resource.rb +10 -1
  9. data/lib/stripe/api_resource_test_helpers.rb +6 -2
  10. data/lib/stripe/list_object.rb +3 -0
  11. data/lib/stripe/object_types.rb +120 -118
  12. data/lib/stripe/resources/account.rb +6 -4
  13. data/lib/stripe/resources/account_link.rb +3 -0
  14. data/lib/stripe/resources/account_session.rb +3 -0
  15. data/lib/stripe/resources/apple_pay_domain.rb +3 -0
  16. data/lib/stripe/resources/application_fee.rb +3 -0
  17. data/lib/stripe/resources/application_fee_refund.rb +3 -0
  18. data/lib/stripe/resources/apps/secret.rb +3 -0
  19. data/lib/stripe/resources/balance.rb +3 -0
  20. data/lib/stripe/resources/balance_transaction.rb +3 -0
  21. data/lib/stripe/resources/bank_account.rb +3 -0
  22. data/lib/stripe/resources/billing_portal/configuration.rb +3 -0
  23. data/lib/stripe/resources/billing_portal/session.rb +3 -0
  24. data/lib/stripe/resources/capability.rb +3 -0
  25. data/lib/stripe/resources/card.rb +3 -0
  26. data/lib/stripe/resources/cash_balance.rb +3 -0
  27. data/lib/stripe/resources/charge.rb +3 -0
  28. data/lib/stripe/resources/checkout/session.rb +3 -0
  29. data/lib/stripe/resources/climate/order.rb +3 -0
  30. data/lib/stripe/resources/climate/product.rb +3 -0
  31. data/lib/stripe/resources/climate/supplier.rb +3 -0
  32. data/lib/stripe/resources/country_spec.rb +3 -0
  33. data/lib/stripe/resources/coupon.rb +3 -0
  34. data/lib/stripe/resources/credit_note.rb +3 -0
  35. data/lib/stripe/resources/credit_note_line_item.rb +3 -0
  36. data/lib/stripe/resources/customer.rb +7 -2
  37. data/lib/stripe/resources/customer_balance_transaction.rb +3 -0
  38. data/lib/stripe/resources/customer_cash_balance_transaction.rb +3 -0
  39. data/lib/stripe/resources/customer_session.rb +3 -0
  40. data/lib/stripe/resources/discount.rb +3 -0
  41. data/lib/stripe/resources/dispute.rb +3 -0
  42. data/lib/stripe/resources/ephemeral_key.rb +3 -0
  43. data/lib/stripe/resources/event.rb +3 -0
  44. data/lib/stripe/resources/exchange_rate.rb +3 -0
  45. data/lib/stripe/resources/file.rb +6 -0
  46. data/lib/stripe/resources/file_link.rb +3 -0
  47. data/lib/stripe/resources/financial_connections/account.rb +3 -0
  48. data/lib/stripe/resources/financial_connections/account_owner.rb +3 -0
  49. data/lib/stripe/resources/financial_connections/account_ownership.rb +3 -0
  50. data/lib/stripe/resources/financial_connections/session.rb +3 -0
  51. data/lib/stripe/resources/financial_connections/transaction.rb +3 -0
  52. data/lib/stripe/resources/funding_instructions.rb +3 -0
  53. data/lib/stripe/resources/identity/verification_report.rb +3 -0
  54. data/lib/stripe/resources/identity/verification_session.rb +3 -0
  55. data/lib/stripe/resources/invoice.rb +3 -0
  56. data/lib/stripe/resources/invoice_item.rb +3 -0
  57. data/lib/stripe/resources/invoice_line_item.rb +3 -0
  58. data/lib/stripe/resources/issuing/authorization.rb +6 -0
  59. data/lib/stripe/resources/issuing/card.rb +6 -0
  60. data/lib/stripe/resources/issuing/cardholder.rb +3 -0
  61. data/lib/stripe/resources/issuing/dispute.rb +3 -0
  62. data/lib/stripe/resources/issuing/token.rb +3 -0
  63. data/lib/stripe/resources/issuing/transaction.rb +6 -0
  64. data/lib/stripe/resources/line_item.rb +3 -0
  65. data/lib/stripe/resources/login_link.rb +3 -0
  66. data/lib/stripe/resources/mandate.rb +3 -0
  67. data/lib/stripe/resources/payment_intent.rb +5 -4
  68. data/lib/stripe/resources/payment_link.rb +3 -0
  69. data/lib/stripe/resources/payment_method.rb +3 -0
  70. data/lib/stripe/resources/payment_method_configuration.rb +3 -0
  71. data/lib/stripe/resources/payment_method_domain.rb +3 -0
  72. data/lib/stripe/resources/payout.rb +3 -0
  73. data/lib/stripe/resources/person.rb +3 -0
  74. data/lib/stripe/resources/plan.rb +3 -0
  75. data/lib/stripe/resources/price.rb +3 -0
  76. data/lib/stripe/resources/product.rb +3 -0
  77. data/lib/stripe/resources/promotion_code.rb +3 -0
  78. data/lib/stripe/resources/quote.rb +3 -0
  79. data/lib/stripe/resources/radar/early_fraud_warning.rb +3 -0
  80. data/lib/stripe/resources/radar/value_list.rb +3 -0
  81. data/lib/stripe/resources/radar/value_list_item.rb +3 -0
  82. data/lib/stripe/resources/refund.rb +6 -0
  83. data/lib/stripe/resources/reporting/report_run.rb +3 -0
  84. data/lib/stripe/resources/reporting/report_type.rb +3 -0
  85. data/lib/stripe/resources/reversal.rb +3 -0
  86. data/lib/stripe/resources/review.rb +3 -0
  87. data/lib/stripe/resources/setup_attempt.rb +3 -0
  88. data/lib/stripe/resources/setup_intent.rb +3 -0
  89. data/lib/stripe/resources/shipping_rate.rb +3 -0
  90. data/lib/stripe/resources/sigma/scheduled_query_run.rb +3 -0
  91. data/lib/stripe/resources/source.rb +3 -0
  92. data/lib/stripe/resources/source_transaction.rb +3 -0
  93. data/lib/stripe/resources/subscription.rb +3 -0
  94. data/lib/stripe/resources/subscription_item.rb +3 -0
  95. data/lib/stripe/resources/subscription_schedule.rb +3 -0
  96. data/lib/stripe/resources/tax/calculation.rb +3 -0
  97. data/lib/stripe/resources/tax/calculation_line_item.rb +3 -0
  98. data/lib/stripe/resources/tax/registration.rb +3 -0
  99. data/lib/stripe/resources/tax/settings.rb +3 -0
  100. data/lib/stripe/resources/tax/transaction.rb +3 -0
  101. data/lib/stripe/resources/tax/transaction_line_item.rb +3 -0
  102. data/lib/stripe/resources/tax_code.rb +3 -0
  103. data/lib/stripe/resources/tax_id.rb +5 -4
  104. data/lib/stripe/resources/tax_rate.rb +3 -0
  105. data/lib/stripe/resources/terminal/configuration.rb +3 -0
  106. data/lib/stripe/resources/terminal/connection_token.rb +3 -0
  107. data/lib/stripe/resources/terminal/location.rb +3 -0
  108. data/lib/stripe/resources/terminal/reader.rb +6 -0
  109. data/lib/stripe/resources/test_helpers/test_clock.rb +3 -0
  110. data/lib/stripe/resources/token.rb +3 -0
  111. data/lib/stripe/resources/topup.rb +3 -0
  112. data/lib/stripe/resources/transfer.rb +3 -0
  113. data/lib/stripe/resources/treasury/credit_reversal.rb +3 -0
  114. data/lib/stripe/resources/treasury/debit_reversal.rb +3 -0
  115. data/lib/stripe/resources/treasury/financial_account.rb +3 -0
  116. data/lib/stripe/resources/treasury/financial_account_features.rb +3 -0
  117. data/lib/stripe/resources/treasury/inbound_transfer.rb +6 -0
  118. data/lib/stripe/resources/treasury/outbound_payment.rb +6 -0
  119. data/lib/stripe/resources/treasury/outbound_transfer.rb +6 -0
  120. data/lib/stripe/resources/treasury/received_credit.rb +6 -0
  121. data/lib/stripe/resources/treasury/received_debit.rb +6 -0
  122. data/lib/stripe/resources/treasury/transaction.rb +3 -0
  123. data/lib/stripe/resources/treasury/transaction_entry.rb +3 -0
  124. data/lib/stripe/resources/usage_record.rb +3 -0
  125. data/lib/stripe/resources/usage_record_summary.rb +3 -0
  126. data/lib/stripe/resources/webhook_endpoint.rb +3 -0
  127. data/lib/stripe/search_result_object.rb +3 -0
  128. data/lib/stripe/singleton_api_resource.rb +1 -1
  129. data/lib/stripe/version.rb +1 -1
  130. data/sorbet/config +4 -0
  131. data/sorbet/rbi/annotations/.gitattributes +1 -0
  132. data/sorbet/rbi/annotations/coveralls_reborn.rbi +3 -0
  133. data/sorbet/rbi/gems/.gitattributes +1 -0
  134. data/sorbet/rbi/gems/addressable@2.8.6.rbi +1993 -0
  135. data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
  136. data/sorbet/rbi/gems/byebug@11.1.3.rbi +3606 -0
  137. data/sorbet/rbi/gems/coderay@1.1.3.rbi +3437 -0
  138. data/sorbet/rbi/gems/coveralls_reborn@0.25.0.rbi +8 -0
  139. data/sorbet/rbi/gems/crack@0.4.5.rbi +144 -0
  140. data/sorbet/rbi/gems/docile@1.4.0.rbi +8 -0
  141. data/sorbet/rbi/gems/erubi@1.12.0.rbi +146 -0
  142. data/sorbet/rbi/gems/hashdiff@1.1.0.rbi +352 -0
  143. data/sorbet/rbi/gems/jaro_winkler@1.5.4.rbi +19 -0
  144. data/sorbet/rbi/gems/json@2.7.1.rbi +1561 -0
  145. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14237 -0
  146. data/sorbet/rbi/gems/method_source@1.0.0.rbi +272 -0
  147. data/sorbet/rbi/gems/mocha@1.16.1.rbi +11 -0
  148. data/sorbet/rbi/gems/netrc@0.11.0.rbi +161 -0
  149. data/sorbet/rbi/gems/parallel@1.24.0.rbi +280 -0
  150. data/sorbet/rbi/gems/parser@3.2.2.4.rbi +9454 -0
  151. data/sorbet/rbi/gems/power_assert@2.0.3.rbi +414 -0
  152. data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +951 -0
  153. data/sorbet/rbi/gems/prism@0.19.0.rbi +29883 -0
  154. data/sorbet/rbi/gems/pry-byebug@3.10.1.rbi +1150 -0
  155. data/sorbet/rbi/gems/pry@0.14.2.rbi +10085 -0
  156. data/sorbet/rbi/gems/public_suffix@5.0.4.rbi +931 -0
  157. data/sorbet/rbi/gems/racc@1.7.3.rbi +161 -0
  158. data/sorbet/rbi/gems/rack@3.0.8.rbi +5193 -0
  159. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +402 -0
  160. data/sorbet/rbi/gems/rake@13.1.0.rbi +2884 -0
  161. data/sorbet/rbi/gems/rbi@0.1.6.rbi +2922 -0
  162. data/sorbet/rbi/gems/regexp_parser@2.8.3.rbi +3766 -0
  163. data/sorbet/rbi/gems/rexml@3.2.6.rbi +4887 -0
  164. data/sorbet/rbi/gems/rubocop-ast@1.30.0.rbi +7004 -0
  165. data/sorbet/rbi/gems/rubocop@1.57.2.rbi +56919 -0
  166. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1317 -0
  167. data/sorbet/rbi/gems/shoulda-context@2.0.0.rbi +555 -0
  168. data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +8 -0
  169. data/sorbet/rbi/gems/simplecov@0.21.2.rbi +8 -0
  170. data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +8 -0
  171. data/sorbet/rbi/gems/spoom@1.2.4.rbi +3777 -0
  172. data/sorbet/rbi/gems/sync@0.5.0.rbi +8 -0
  173. data/sorbet/rbi/gems/syntax_tree@6.2.0.rbi +23136 -0
  174. data/sorbet/rbi/gems/tapioca@0.11.17.rbi +3503 -0
  175. data/sorbet/rbi/gems/term-ansicolor@1.7.1.rbi +8 -0
  176. data/sorbet/rbi/gems/test-unit@3.6.1.rbi +4403 -0
  177. data/sorbet/rbi/gems/thor@1.3.0.rbi +4345 -0
  178. data/sorbet/rbi/gems/tins@1.32.1.rbi +8 -0
  179. data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +65 -0
  180. data/sorbet/rbi/gems/webmock@3.19.1.rbi +1740 -0
  181. data/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +428 -0
  182. data/sorbet/rbi/gems/yard@0.9.34.rbi +18219 -0
  183. data/sorbet/tapioca/config.yml +13 -0
  184. data/sorbet/tapioca/require.rb +4 -0
  185. metadata +59 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dfa0b44d67551bb50efb1af1be0b3725243833ce55648a68807b268a187505e0
4
- data.tar.gz: 1221c6171794af119e1435efe01ed5ea1add02165ed64da1de00ed5a5a3076a9
3
+ metadata.gz: a2f7b58163e4353bfa2145baed7e00ad770b8a84151047636a41b4a7e8e7eb60
4
+ data.tar.gz: 90e66e626c77ea4a1b8a8f664b46c5cef59903ebd00b8765e24ab4ec276de9af
5
5
  SHA512:
6
- metadata.gz: 81e2320868d4dc90896a3cb488c619d2b5153b108bf48af7772f0a5800a985aeade6089d93a0114f8eb7d005ba3966400c673cd8f10cc15a67c861e634cfc32d
7
- data.tar.gz: 665172138ab5c5a8154ec52ace0a21f15c494fff506cf52e7f44dfa8d91cffda9c55077948543d4c013bd887c827ffc00f5f16eb5de605607a37fd0224c4f961
6
+ metadata.gz: 0d0b03dc95ab2be4ee4a10cd7c599f2e25e06f83b1c4d06166f13d56c2f4e979292b2b72a7f5ce134ab384a57fb39b5d9758bf4ebfd2e4607c664fa06c7c7a6c
7
+ data.tar.gz: 21db9ed53787a4213883fd1784099412fe174367ffe5ed2ccc58cbbf03ab6ac0ec80b52512bffea6efe2bcd29acbd4de649d50c9eb92de24b80961cc06966e7d
data/CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
1
  # Changelog
2
+ ## 10.9.0 - 2024-02-15
3
+ * [#1329](https://github.com/stripe/stripe-ruby/pull/1329) Update generated code
4
+ * Fixed bug where `TaxId` resource `delete` method sent request to wrong URL (https://github.com/stripe/stripe-ruby/issues/1333)
5
+ * [#1324](https://github.com/stripe/stripe-ruby/pull/1324) Start running Sorbet in CI
6
+ * [#1327](https://github.com/stripe/stripe-ruby/pull/1327) Add methods for dynamically referenced constants
7
+
2
8
  ## 10.8.0 - 2024-02-08
3
9
  * [#1322](https://github.com/stripe/stripe-ruby/pull/1322) Update generated code
4
10
  * [#1323](https://github.com/stripe/stripe-ruby/pull/1323) Extract other CRUDL api operations from mixins
data/Gemfile CHANGED
@@ -31,6 +31,9 @@ group :development do
31
31
  # don't install on truffleruby
32
32
  gem "jaro_winkler", "1.5.4" unless RUBY_ENGINE == "truffleruby"
33
33
 
34
+ gem "sorbet-static"
35
+ gem "tapioca"
36
+
34
37
  platforms :mri do
35
38
  gem "byebug"
36
39
  gem "pry"
data/Makefile CHANGED
@@ -9,5 +9,12 @@ codegen-format:
9
9
 
10
10
  ci-test:
11
11
  bundle install && bundle exec rake test
12
+ @version=$$(ruby -e "puts RUBY_VERSION.split('.')[0..1].join.to_i"); \
13
+ if [ $$version -ge 27 ]; then \
14
+ echo "Ruby version >= 2.7, continue with srb tc"; \
15
+ bundle exec srb tc; \
16
+ else \
17
+ echo "Ruby version < 2.7, skipping srb tc"; \
18
+ fi
12
19
 
13
20
  test: ci-test
data/OPENAPI_VERSION CHANGED
@@ -1 +1 @@
1
- v810
1
+ v829
data/VERSION CHANGED
@@ -1 +1 @@
1
- 10.8.0
1
+ 10.9.0
data/bin/tapioca ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'tapioca' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12
+
13
+ bundle_binstub = File.expand_path("bundle", __dir__)
14
+
15
+ if File.file?(bundle_binstub)
16
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
17
+ load(bundle_binstub)
18
+ else
19
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21
+ end
22
+ end
23
+
24
+ require "rubygems"
25
+ require "bundler/setup"
26
+
27
+ load Gem.bin_path("tapioca", "tapioca")
@@ -11,6 +11,15 @@ module Stripe
11
11
  # for example, where this is allowed.
12
12
  attr_accessor :save_with_parent
13
13
 
14
+ # TODO: (major) Remove OBJECT_NAME and stop using const_get here
15
+ # This is a workaround to avoid breaking users who have defined their own
16
+ # APIResource subclasses with a custom OBJECT_NAME. We should never fallback
17
+ # on this case otherwise.
18
+ OBJECT_NAME = ""
19
+ def self.object_name
20
+ const_get(:OBJECT_NAME)
21
+ end
22
+
14
23
  def self.class_name
15
24
  name.split("::")[-1]
16
25
  end
@@ -23,7 +32,7 @@ module Stripe
23
32
  end
24
33
  # Namespaces are separated in object names with periods (.) and in URLs
25
34
  # with forward slashes (/), so replace the former with the latter.
26
- "/v1/#{self::OBJECT_NAME.downcase.tr('.', '/')}s"
35
+ "/v1/#{object_name.downcase.tr('.', '/')}s"
27
36
  end
28
37
 
29
38
  # A metaprogramming call that specifies that a field of a resource can be
@@ -14,6 +14,10 @@ module Stripe
14
14
  @resource = resource
15
15
  end
16
16
 
17
+ def self.resource_class
18
+ nil
19
+ end
20
+
17
21
  # Adds a custom method to a test helper. This is used to add support for
18
22
  # non-CRUDL API requests, e.g. capturing charges. custom_method takes the
19
23
  # following parameters:
@@ -27,12 +31,12 @@ module Stripe
27
31
  # adds a `capture` class method to the resource class that, when called,
28
32
  # will send a POST request to `/v1/<object_name>/capture`.
29
33
  def self.custom_method(name, http_verb:, http_path: nil)
30
- Util.custom_method self::RESOURCE_CLASS, self, name, http_verb, http_path
34
+ Util.custom_method resource_class, self, name, http_verb, http_path
31
35
  end
32
36
 
33
37
  def self.resource_url
34
38
  "/v1/test_helpers/" \
35
- "#{self::RESOURCE_CLASS::OBJECT_NAME.downcase.tr('.', '/')}s"
39
+ "#{resource_class.object_name.downcase.tr('.', '/')}s"
36
40
  end
37
41
 
38
42
  def resource_url
@@ -8,6 +8,9 @@ module Stripe
8
8
  include Stripe::APIOperations::Create
9
9
 
10
10
  OBJECT_NAME = "list"
11
+ def self.object_name
12
+ "list"
13
+ end
11
14
 
12
15
  # This accessor allows a `ListObject` to inherit various filters that were
13
16
  # given to a predecessor. This allows for things like consistent limits,
@@ -2,136 +2,138 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  # rubocop:disable Metrics/MethodLength
5
+ # rubocop:disable Metrics/AbcSize
5
6
 
6
7
  module Stripe
7
8
  module ObjectTypes
8
9
  def self.object_names_to_classes
9
10
  {
10
11
  # data structures
11
- ListObject::OBJECT_NAME => ListObject,
12
- SearchResultObject::OBJECT_NAME => SearchResultObject,
12
+ ListObject.object_name => ListObject,
13
+ SearchResultObject.object_name => SearchResultObject,
13
14
 
14
15
  # business objects
15
- File::OBJECT_NAME_ALT => File,
16
- Account::OBJECT_NAME => Account,
17
- AccountLink::OBJECT_NAME => AccountLink,
18
- AccountSession::OBJECT_NAME => AccountSession,
19
- ApplePayDomain::OBJECT_NAME => ApplePayDomain,
20
- ApplicationFee::OBJECT_NAME => ApplicationFee,
21
- ApplicationFeeRefund::OBJECT_NAME => ApplicationFeeRefund,
22
- Apps::Secret::OBJECT_NAME => Apps::Secret,
23
- Balance::OBJECT_NAME => Balance,
24
- BalanceTransaction::OBJECT_NAME => BalanceTransaction,
25
- BankAccount::OBJECT_NAME => BankAccount,
26
- BillingPortal::Configuration::OBJECT_NAME => BillingPortal::Configuration,
27
- BillingPortal::Session::OBJECT_NAME => BillingPortal::Session,
28
- Capability::OBJECT_NAME => Capability,
29
- Card::OBJECT_NAME => Card,
30
- CashBalance::OBJECT_NAME => CashBalance,
31
- Charge::OBJECT_NAME => Charge,
32
- Checkout::Session::OBJECT_NAME => Checkout::Session,
33
- Climate::Order::OBJECT_NAME => Climate::Order,
34
- Climate::Product::OBJECT_NAME => Climate::Product,
35
- Climate::Supplier::OBJECT_NAME => Climate::Supplier,
36
- CountrySpec::OBJECT_NAME => CountrySpec,
37
- Coupon::OBJECT_NAME => Coupon,
38
- CreditNote::OBJECT_NAME => CreditNote,
39
- CreditNoteLineItem::OBJECT_NAME => CreditNoteLineItem,
40
- Customer::OBJECT_NAME => Customer,
41
- CustomerBalanceTransaction::OBJECT_NAME => CustomerBalanceTransaction,
42
- CustomerCashBalanceTransaction::OBJECT_NAME => CustomerCashBalanceTransaction,
43
- CustomerSession::OBJECT_NAME => CustomerSession,
44
- Discount::OBJECT_NAME => Discount,
45
- Dispute::OBJECT_NAME => Dispute,
46
- EphemeralKey::OBJECT_NAME => EphemeralKey,
47
- Event::OBJECT_NAME => Event,
48
- ExchangeRate::OBJECT_NAME => ExchangeRate,
49
- File::OBJECT_NAME => File,
50
- FileLink::OBJECT_NAME => FileLink,
51
- FinancialConnections::Account::OBJECT_NAME => FinancialConnections::Account,
52
- FinancialConnections::AccountOwner::OBJECT_NAME => FinancialConnections::AccountOwner,
53
- FinancialConnections::AccountOwnership::OBJECT_NAME =>
16
+ File.object_name_alt => File,
17
+ Account.object_name => Account,
18
+ AccountLink.object_name => AccountLink,
19
+ AccountSession.object_name => AccountSession,
20
+ ApplePayDomain.object_name => ApplePayDomain,
21
+ ApplicationFee.object_name => ApplicationFee,
22
+ ApplicationFeeRefund.object_name => ApplicationFeeRefund,
23
+ Apps::Secret.object_name => Apps::Secret,
24
+ Balance.object_name => Balance,
25
+ BalanceTransaction.object_name => BalanceTransaction,
26
+ BankAccount.object_name => BankAccount,
27
+ BillingPortal::Configuration.object_name => BillingPortal::Configuration,
28
+ BillingPortal::Session.object_name => BillingPortal::Session,
29
+ Capability.object_name => Capability,
30
+ Card.object_name => Card,
31
+ CashBalance.object_name => CashBalance,
32
+ Charge.object_name => Charge,
33
+ Checkout::Session.object_name => Checkout::Session,
34
+ Climate::Order.object_name => Climate::Order,
35
+ Climate::Product.object_name => Climate::Product,
36
+ Climate::Supplier.object_name => Climate::Supplier,
37
+ CountrySpec.object_name => CountrySpec,
38
+ Coupon.object_name => Coupon,
39
+ CreditNote.object_name => CreditNote,
40
+ CreditNoteLineItem.object_name => CreditNoteLineItem,
41
+ Customer.object_name => Customer,
42
+ CustomerBalanceTransaction.object_name => CustomerBalanceTransaction,
43
+ CustomerCashBalanceTransaction.object_name => CustomerCashBalanceTransaction,
44
+ CustomerSession.object_name => CustomerSession,
45
+ Discount.object_name => Discount,
46
+ Dispute.object_name => Dispute,
47
+ EphemeralKey.object_name => EphemeralKey,
48
+ Event.object_name => Event,
49
+ ExchangeRate.object_name => ExchangeRate,
50
+ File.object_name => File,
51
+ FileLink.object_name => FileLink,
52
+ FinancialConnections::Account.object_name => FinancialConnections::Account,
53
+ FinancialConnections::AccountOwner.object_name => FinancialConnections::AccountOwner,
54
+ FinancialConnections::AccountOwnership.object_name =>
54
55
  FinancialConnections::AccountOwnership,
55
- FinancialConnections::Session::OBJECT_NAME => FinancialConnections::Session,
56
- FinancialConnections::Transaction::OBJECT_NAME => FinancialConnections::Transaction,
57
- FundingInstructions::OBJECT_NAME => FundingInstructions,
58
- Identity::VerificationReport::OBJECT_NAME => Identity::VerificationReport,
59
- Identity::VerificationSession::OBJECT_NAME => Identity::VerificationSession,
60
- Invoice::OBJECT_NAME => Invoice,
61
- InvoiceItem::OBJECT_NAME => InvoiceItem,
62
- InvoiceLineItem::OBJECT_NAME => InvoiceLineItem,
63
- Issuing::Authorization::OBJECT_NAME => Issuing::Authorization,
64
- Issuing::Card::OBJECT_NAME => Issuing::Card,
65
- Issuing::Cardholder::OBJECT_NAME => Issuing::Cardholder,
66
- Issuing::Dispute::OBJECT_NAME => Issuing::Dispute,
67
- Issuing::Token::OBJECT_NAME => Issuing::Token,
68
- Issuing::Transaction::OBJECT_NAME => Issuing::Transaction,
69
- LineItem::OBJECT_NAME => LineItem,
70
- LoginLink::OBJECT_NAME => LoginLink,
71
- Mandate::OBJECT_NAME => Mandate,
72
- PaymentIntent::OBJECT_NAME => PaymentIntent,
73
- PaymentLink::OBJECT_NAME => PaymentLink,
74
- PaymentMethod::OBJECT_NAME => PaymentMethod,
75
- PaymentMethodConfiguration::OBJECT_NAME => PaymentMethodConfiguration,
76
- PaymentMethodDomain::OBJECT_NAME => PaymentMethodDomain,
77
- Payout::OBJECT_NAME => Payout,
78
- Person::OBJECT_NAME => Person,
79
- Plan::OBJECT_NAME => Plan,
80
- Price::OBJECT_NAME => Price,
81
- Product::OBJECT_NAME => Product,
82
- PromotionCode::OBJECT_NAME => PromotionCode,
83
- Quote::OBJECT_NAME => Quote,
84
- Radar::EarlyFraudWarning::OBJECT_NAME => Radar::EarlyFraudWarning,
85
- Radar::ValueList::OBJECT_NAME => Radar::ValueList,
86
- Radar::ValueListItem::OBJECT_NAME => Radar::ValueListItem,
87
- Refund::OBJECT_NAME => Refund,
88
- Reporting::ReportRun::OBJECT_NAME => Reporting::ReportRun,
89
- Reporting::ReportType::OBJECT_NAME => Reporting::ReportType,
90
- Reversal::OBJECT_NAME => Reversal,
91
- Review::OBJECT_NAME => Review,
92
- SetupAttempt::OBJECT_NAME => SetupAttempt,
93
- SetupIntent::OBJECT_NAME => SetupIntent,
94
- ShippingRate::OBJECT_NAME => ShippingRate,
95
- Sigma::ScheduledQueryRun::OBJECT_NAME => Sigma::ScheduledQueryRun,
96
- Source::OBJECT_NAME => Source,
97
- SourceTransaction::OBJECT_NAME => SourceTransaction,
98
- Subscription::OBJECT_NAME => Subscription,
99
- SubscriptionItem::OBJECT_NAME => SubscriptionItem,
100
- SubscriptionSchedule::OBJECT_NAME => SubscriptionSchedule,
101
- Tax::Calculation::OBJECT_NAME => Tax::Calculation,
102
- Tax::CalculationLineItem::OBJECT_NAME => Tax::CalculationLineItem,
103
- Tax::Registration::OBJECT_NAME => Tax::Registration,
104
- Tax::Settings::OBJECT_NAME => Tax::Settings,
105
- Tax::Transaction::OBJECT_NAME => Tax::Transaction,
106
- Tax::TransactionLineItem::OBJECT_NAME => Tax::TransactionLineItem,
107
- TaxCode::OBJECT_NAME => TaxCode,
108
- TaxId::OBJECT_NAME => TaxId,
109
- TaxRate::OBJECT_NAME => TaxRate,
110
- Terminal::Configuration::OBJECT_NAME => Terminal::Configuration,
111
- Terminal::ConnectionToken::OBJECT_NAME => Terminal::ConnectionToken,
112
- Terminal::Location::OBJECT_NAME => Terminal::Location,
113
- Terminal::Reader::OBJECT_NAME => Terminal::Reader,
114
- TestHelpers::TestClock::OBJECT_NAME => TestHelpers::TestClock,
115
- Token::OBJECT_NAME => Token,
116
- Topup::OBJECT_NAME => Topup,
117
- Transfer::OBJECT_NAME => Transfer,
118
- Treasury::CreditReversal::OBJECT_NAME => Treasury::CreditReversal,
119
- Treasury::DebitReversal::OBJECT_NAME => Treasury::DebitReversal,
120
- Treasury::FinancialAccount::OBJECT_NAME => Treasury::FinancialAccount,
121
- Treasury::FinancialAccountFeatures::OBJECT_NAME => Treasury::FinancialAccountFeatures,
122
- Treasury::InboundTransfer::OBJECT_NAME => Treasury::InboundTransfer,
123
- Treasury::OutboundPayment::OBJECT_NAME => Treasury::OutboundPayment,
124
- Treasury::OutboundTransfer::OBJECT_NAME => Treasury::OutboundTransfer,
125
- Treasury::ReceivedCredit::OBJECT_NAME => Treasury::ReceivedCredit,
126
- Treasury::ReceivedDebit::OBJECT_NAME => Treasury::ReceivedDebit,
127
- Treasury::Transaction::OBJECT_NAME => Treasury::Transaction,
128
- Treasury::TransactionEntry::OBJECT_NAME => Treasury::TransactionEntry,
129
- UsageRecord::OBJECT_NAME => UsageRecord,
130
- UsageRecordSummary::OBJECT_NAME => UsageRecordSummary,
131
- WebhookEndpoint::OBJECT_NAME => WebhookEndpoint,
56
+ FinancialConnections::Session.object_name => FinancialConnections::Session,
57
+ FinancialConnections::Transaction.object_name => FinancialConnections::Transaction,
58
+ FundingInstructions.object_name => FundingInstructions,
59
+ Identity::VerificationReport.object_name => Identity::VerificationReport,
60
+ Identity::VerificationSession.object_name => Identity::VerificationSession,
61
+ Invoice.object_name => Invoice,
62
+ InvoiceItem.object_name => InvoiceItem,
63
+ InvoiceLineItem.object_name => InvoiceLineItem,
64
+ Issuing::Authorization.object_name => Issuing::Authorization,
65
+ Issuing::Card.object_name => Issuing::Card,
66
+ Issuing::Cardholder.object_name => Issuing::Cardholder,
67
+ Issuing::Dispute.object_name => Issuing::Dispute,
68
+ Issuing::Token.object_name => Issuing::Token,
69
+ Issuing::Transaction.object_name => Issuing::Transaction,
70
+ LineItem.object_name => LineItem,
71
+ LoginLink.object_name => LoginLink,
72
+ Mandate.object_name => Mandate,
73
+ PaymentIntent.object_name => PaymentIntent,
74
+ PaymentLink.object_name => PaymentLink,
75
+ PaymentMethod.object_name => PaymentMethod,
76
+ PaymentMethodConfiguration.object_name => PaymentMethodConfiguration,
77
+ PaymentMethodDomain.object_name => PaymentMethodDomain,
78
+ Payout.object_name => Payout,
79
+ Person.object_name => Person,
80
+ Plan.object_name => Plan,
81
+ Price.object_name => Price,
82
+ Product.object_name => Product,
83
+ PromotionCode.object_name => PromotionCode,
84
+ Quote.object_name => Quote,
85
+ Radar::EarlyFraudWarning.object_name => Radar::EarlyFraudWarning,
86
+ Radar::ValueList.object_name => Radar::ValueList,
87
+ Radar::ValueListItem.object_name => Radar::ValueListItem,
88
+ Refund.object_name => Refund,
89
+ Reporting::ReportRun.object_name => Reporting::ReportRun,
90
+ Reporting::ReportType.object_name => Reporting::ReportType,
91
+ Reversal.object_name => Reversal,
92
+ Review.object_name => Review,
93
+ SetupAttempt.object_name => SetupAttempt,
94
+ SetupIntent.object_name => SetupIntent,
95
+ ShippingRate.object_name => ShippingRate,
96
+ Sigma::ScheduledQueryRun.object_name => Sigma::ScheduledQueryRun,
97
+ Source.object_name => Source,
98
+ SourceTransaction.object_name => SourceTransaction,
99
+ Subscription.object_name => Subscription,
100
+ SubscriptionItem.object_name => SubscriptionItem,
101
+ SubscriptionSchedule.object_name => SubscriptionSchedule,
102
+ Tax::Calculation.object_name => Tax::Calculation,
103
+ Tax::CalculationLineItem.object_name => Tax::CalculationLineItem,
104
+ Tax::Registration.object_name => Tax::Registration,
105
+ Tax::Settings.object_name => Tax::Settings,
106
+ Tax::Transaction.object_name => Tax::Transaction,
107
+ Tax::TransactionLineItem.object_name => Tax::TransactionLineItem,
108
+ TaxCode.object_name => TaxCode,
109
+ TaxId.object_name => TaxId,
110
+ TaxRate.object_name => TaxRate,
111
+ Terminal::Configuration.object_name => Terminal::Configuration,
112
+ Terminal::ConnectionToken.object_name => Terminal::ConnectionToken,
113
+ Terminal::Location.object_name => Terminal::Location,
114
+ Terminal::Reader.object_name => Terminal::Reader,
115
+ TestHelpers::TestClock.object_name => TestHelpers::TestClock,
116
+ Token.object_name => Token,
117
+ Topup.object_name => Topup,
118
+ Transfer.object_name => Transfer,
119
+ Treasury::CreditReversal.object_name => Treasury::CreditReversal,
120
+ Treasury::DebitReversal.object_name => Treasury::DebitReversal,
121
+ Treasury::FinancialAccount.object_name => Treasury::FinancialAccount,
122
+ Treasury::FinancialAccountFeatures.object_name => Treasury::FinancialAccountFeatures,
123
+ Treasury::InboundTransfer.object_name => Treasury::InboundTransfer,
124
+ Treasury::OutboundPayment.object_name => Treasury::OutboundPayment,
125
+ Treasury::OutboundTransfer.object_name => Treasury::OutboundTransfer,
126
+ Treasury::ReceivedCredit.object_name => Treasury::ReceivedCredit,
127
+ Treasury::ReceivedDebit.object_name => Treasury::ReceivedDebit,
128
+ Treasury::Transaction.object_name => Treasury::Transaction,
129
+ Treasury::TransactionEntry.object_name => Treasury::TransactionEntry,
130
+ UsageRecord.object_name => UsageRecord,
131
+ UsageRecordSummary.object_name => UsageRecordSummary,
132
+ WebhookEndpoint.object_name => WebhookEndpoint,
132
133
  }
133
134
  end
134
135
  end
135
136
  end
136
137
 
138
+ # rubocop:enable Metrics/AbcSize
137
139
  # rubocop:enable Metrics/MethodLength
@@ -17,10 +17,16 @@ module Stripe
17
17
  extend Stripe::APIOperations::NestedResource
18
18
 
19
19
  OBJECT_NAME = "account"
20
+ def self.object_name
21
+ "account"
22
+ end
20
23
 
21
24
  nested_resource_class_methods :capability,
22
25
  operations: %i[retrieve update list],
23
26
  resource_plural: "capabilities"
27
+ nested_resource_class_methods :external_account,
28
+ operations: %i[create retrieve update delete list]
29
+ nested_resource_class_methods :login_link, operations: %i[create]
24
30
  nested_resource_class_methods :person, operations: %i[create retrieve update delete list]
25
31
 
26
32
  # Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first.
@@ -69,10 +75,6 @@ module Stripe
69
75
 
70
76
  save_nested_resource :external_account
71
77
 
72
- nested_resource_class_methods :external_account,
73
- operations: %i[create retrieve update delete list]
74
- nested_resource_class_methods :login_link, operations: %i[create]
75
-
76
78
  def resource_url
77
79
  if self["id"]
78
80
  super
@@ -10,6 +10,9 @@ module Stripe
10
10
  extend Stripe::APIOperations::Create
11
11
 
12
12
  OBJECT_NAME = "account_link"
13
+ def self.object_name
14
+ "account_link"
15
+ end
13
16
 
14
17
  # Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow.
15
18
  def self.create(params = {}, opts = {})
@@ -13,6 +13,9 @@ module Stripe
13
13
  extend Stripe::APIOperations::Create
14
14
 
15
15
  OBJECT_NAME = "account_session"
16
+ def self.object_name
17
+ "account_session"
18
+ end
16
19
 
17
20
  # Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access.
18
21
  def self.create(params = {}, opts = {})
@@ -9,6 +9,9 @@ module Stripe
9
9
  extend Stripe::APIOperations::List
10
10
 
11
11
  OBJECT_NAME = "apple_pay_domain"
12
+ def self.object_name
13
+ "apple_pay_domain"
14
+ end
12
15
 
13
16
  def self.resource_url
14
17
  "/v1/apple_pay/domains"
@@ -7,6 +7,9 @@ module Stripe
7
7
  extend Stripe::APIOperations::NestedResource
8
8
 
9
9
  OBJECT_NAME = "application_fee"
10
+ def self.object_name
11
+ "application_fee"
12
+ end
10
13
 
11
14
  nested_resource_class_methods :refund, operations: %i[create retrieve update list]
12
15
 
@@ -11,6 +11,9 @@ module Stripe
11
11
  include Stripe::APIOperations::Save
12
12
 
13
13
  OBJECT_NAME = "fee_refund"
14
+ def self.object_name
15
+ "fee_refund"
16
+ end
14
17
 
15
18
  def resource_url
16
19
  "#{ApplicationFee.resource_url}/#{CGI.escape(fee)}/refunds" \
@@ -17,6 +17,9 @@ module Stripe
17
17
  extend Stripe::APIOperations::List
18
18
 
19
19
  OBJECT_NAME = "apps.secret"
20
+ def self.object_name
21
+ "apps.secret"
22
+ end
20
23
 
21
24
  # Deletes a secret from the secret store by name and scope.
22
25
  def self.delete_where(params = {}, opts = {})
@@ -15,5 +15,8 @@ module Stripe
15
15
  # Related guide: [Understanding Connect account balances](https://stripe.com/docs/connect/account-balances)
16
16
  class Balance < SingletonAPIResource
17
17
  OBJECT_NAME = "balance"
18
+ def self.object_name
19
+ "balance"
20
+ end
18
21
  end
19
22
  end
@@ -10,6 +10,9 @@ module Stripe
10
10
  extend Stripe::APIOperations::List
11
11
 
12
12
  OBJECT_NAME = "balance_transaction"
13
+ def self.object_name
14
+ "balance_transaction"
15
+ end
13
16
 
14
17
  # Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first.
15
18
  #
@@ -15,6 +15,9 @@ module Stripe
15
15
  include Stripe::APIOperations::Save
16
16
 
17
17
  OBJECT_NAME = "bank_account"
18
+ def self.object_name
19
+ "bank_account"
20
+ end
18
21
 
19
22
  def verify(params = {}, opts = {})
20
23
  resp, opts = execute_resource_request(:post, resource_url + "/verify", params, opts)
@@ -10,6 +10,9 @@ module Stripe
10
10
  include Stripe::APIOperations::Save
11
11
 
12
12
  OBJECT_NAME = "billing_portal.configuration"
13
+ def self.object_name
14
+ "billing_portal.configuration"
15
+ end
13
16
 
14
17
  # Creates a configuration that describes the functionality and behavior of a PortalSession
15
18
  def self.create(params = {}, opts = {})
@@ -21,6 +21,9 @@ module Stripe
21
21
  extend Stripe::APIOperations::Create
22
22
 
23
23
  OBJECT_NAME = "billing_portal.session"
24
+ def self.object_name
25
+ "billing_portal.session"
26
+ end
24
27
 
25
28
  # Creates a session of the customer portal.
26
29
  def self.create(params = {}, opts = {})
@@ -9,6 +9,9 @@ module Stripe
9
9
  include Stripe::APIOperations::Save
10
10
 
11
11
  OBJECT_NAME = "capability"
12
+ def self.object_name
13
+ "capability"
14
+ end
12
15
 
13
16
  def resource_url
14
17
  if !respond_to?(:account) || account.nil?
@@ -13,6 +13,9 @@ module Stripe
13
13
  include Stripe::APIOperations::Save
14
14
 
15
15
  OBJECT_NAME = "card"
16
+ def self.object_name
17
+ "card"
18
+ end
16
19
 
17
20
  def resource_url
18
21
  if respond_to?(:customer) && !customer.nil? && !customer.empty?
@@ -5,6 +5,9 @@ module Stripe
5
5
  # A customer's `Cash balance` represents real funds. Customers can add funds to their cash balance by sending a bank transfer. These funds can be used for payment and can eventually be paid out to your bank account.
6
6
  class CashBalance < APIResource
7
7
  OBJECT_NAME = "cash_balance"
8
+ def self.object_name
9
+ "cash_balance"
10
+ end
8
11
 
9
12
  def resource_url
10
13
  if !respond_to?(:customer) || customer.nil?
@@ -13,6 +13,9 @@ module Stripe
13
13
  include Stripe::APIOperations::Save
14
14
 
15
15
  OBJECT_NAME = "charge"
16
+ def self.object_name
17
+ "charge"
18
+ end
16
19
 
17
20
  # Capture the payment of an existing, uncaptured charge that was created with the capture option set to false.
18
21
  #
@@ -22,6 +22,9 @@ module Stripe
22
22
  extend Stripe::APIOperations::List
23
23
 
24
24
  OBJECT_NAME = "checkout.session"
25
+ def self.object_name
26
+ "checkout.session"
27
+ end
25
28
 
26
29
  # A Session can be expired when it is in one of these statuses: open
27
30
  #
@@ -11,6 +11,9 @@ module Stripe
11
11
  include Stripe::APIOperations::Save
12
12
 
13
13
  OBJECT_NAME = "climate.order"
14
+ def self.object_name
15
+ "climate.order"
16
+ end
14
17
 
15
18
  # Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the
16
19
  # reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier
@@ -9,6 +9,9 @@ module Stripe
9
9
  extend Stripe::APIOperations::List
10
10
 
11
11
  OBJECT_NAME = "climate.product"
12
+ def self.object_name
13
+ "climate.product"
14
+ end
12
15
 
13
16
  # Lists all available Climate product objects.
14
17
  def self.list(filters = {}, opts = {})