stripe 5.28.0 → 8.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (243) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +286 -0
  3. data/Gemfile +5 -3
  4. data/Makefile +13 -0
  5. data/OPENAPI_VERSION +1 -0
  6. data/README.md +43 -5
  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 +45 -2
  14. data/lib/stripe/api_operations/save.rb +13 -3
  15. data/lib/stripe/api_operations/search.rb +16 -0
  16. data/lib/stripe/api_resource.rb +11 -18
  17. data/lib/stripe/api_resource_test_helpers.rb +49 -0
  18. data/lib/stripe/api_version.rb +8 -0
  19. data/lib/stripe/connection_manager.rb +49 -11
  20. data/lib/stripe/error_object.rb +2 -3
  21. data/lib/stripe/instrumentation.rb +46 -6
  22. data/lib/stripe/oauth.rb +4 -3
  23. data/lib/stripe/object_types.rb +36 -10
  24. data/lib/stripe/resources/account.rb +39 -17
  25. data/lib/stripe/resources/account_link.rb +4 -0
  26. data/lib/stripe/resources/application_fee_refund.rb +7 -1
  27. data/lib/stripe/resources/apps/secret.rb +40 -0
  28. data/lib/stripe/resources/balance.rb +11 -0
  29. data/lib/stripe/resources/balance_transaction.rb +4 -0
  30. data/lib/stripe/resources/bank_account.rb +7 -0
  31. data/lib/stripe/resources/billing_portal/configuration.rb +15 -0
  32. data/lib/stripe/resources/billing_portal/session.rb +14 -0
  33. data/lib/stripe/resources/capability.rb +5 -1
  34. data/lib/stripe/resources/card.rb +6 -3
  35. data/lib/stripe/resources/cash_balance.rb +23 -0
  36. data/lib/stripe/resources/charge.rb +23 -3
  37. data/lib/stripe/resources/checkout/session.rb +49 -2
  38. data/lib/stripe/resources/country_spec.rb +6 -0
  39. data/lib/stripe/resources/coupon.rb +3 -0
  40. data/lib/stripe/resources/credit_note.rb +27 -9
  41. data/lib/stripe/resources/credit_note_line_item.rb +2 -0
  42. data/lib/stripe/resources/customer.rb +132 -4
  43. data/lib/stripe/resources/customer_balance_transaction.rb +9 -2
  44. data/lib/stripe/resources/customer_cash_balance_transaction.rb +14 -0
  45. data/lib/stripe/resources/discount.rb +5 -0
  46. data/lib/stripe/resources/dispute.rb +17 -3
  47. data/lib/stripe/resources/event.rb +29 -0
  48. data/lib/stripe/resources/exchange_rate.rb +11 -0
  49. data/lib/stripe/resources/file.rb +9 -1
  50. data/lib/stripe/resources/file_link.rb +3 -0
  51. data/lib/stripe/resources/financial_connections/account.rb +67 -0
  52. data/lib/stripe/resources/financial_connections/account_owner.rb +11 -0
  53. data/lib/stripe/resources/financial_connections/account_ownership.rb +11 -0
  54. data/lib/stripe/resources/financial_connections/session.rb +13 -0
  55. data/lib/stripe/resources/funding_instructions.rb +21 -0
  56. data/lib/stripe/resources/identity/verification_report.rb +23 -0
  57. data/lib/stripe/resources/identity/verification_session.rb +61 -0
  58. data/lib/stripe/resources/invoice.rb +105 -17
  59. data/lib/stripe/resources/invoice_item.rb +11 -0
  60. data/lib/stripe/resources/invoice_line_item.rb +1 -0
  61. data/lib/stripe/resources/issuing/authorization.rb +25 -5
  62. data/lib/stripe/resources/issuing/card.rb +78 -8
  63. data/lib/stripe/resources/issuing/cardholder.rb +3 -0
  64. data/lib/stripe/resources/issuing/dispute.rb +13 -3
  65. data/lib/stripe/resources/issuing/transaction.rb +5 -0
  66. data/lib/stripe/resources/line_item.rb +2 -0
  67. data/lib/stripe/resources/login_link.rb +2 -0
  68. data/lib/stripe/resources/mandate.rb +1 -0
  69. data/lib/stripe/resources/payment_intent.rb +103 -6
  70. data/lib/stripe/resources/payment_link.rb +35 -0
  71. data/lib/stripe/resources/payment_method.rb +25 -5
  72. data/lib/stripe/resources/payout.rb +28 -5
  73. data/lib/stripe/resources/person.rb +7 -0
  74. data/lib/stripe/resources/plan.rb +8 -0
  75. data/lib/stripe/resources/price.rb +15 -0
  76. data/lib/stripe/resources/product.rb +17 -0
  77. data/lib/stripe/resources/promotion_code.rb +2 -0
  78. data/lib/stripe/resources/quote.rb +128 -0
  79. data/lib/stripe/resources/radar/early_fraud_warning.rb +4 -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 +49 -0
  83. data/lib/stripe/resources/reporting/report_run.rb +8 -0
  84. data/lib/stripe/resources/reporting/report_type.rb +8 -1
  85. data/lib/stripe/resources/reversal.rb +16 -2
  86. data/lib/stripe/resources/review.rb +14 -3
  87. data/lib/stripe/resources/setup_attempt.rb +4 -0
  88. data/lib/stripe/resources/setup_intent.rb +60 -5
  89. data/lib/stripe/resources/shipping_rate.rb +14 -0
  90. data/lib/stripe/resources/sigma/scheduled_query_run.rb +4 -0
  91. data/lib/stripe/resources/source.rb +26 -6
  92. data/lib/stripe/resources/source_transaction.rb +5 -0
  93. data/lib/stripe/resources/subscription.rb +57 -3
  94. data/lib/stripe/resources/subscription_item.rb +2 -7
  95. data/lib/stripe/resources/subscription_schedule.rb +23 -5
  96. data/lib/stripe/resources/tax/calculation.rb +33 -0
  97. data/lib/stripe/resources/tax/calculation_line_item.rb +10 -0
  98. data/lib/stripe/resources/tax/settings.rb +15 -0
  99. data/lib/stripe/resources/tax/transaction.rb +49 -0
  100. data/lib/stripe/resources/tax/transaction_line_item.rb +10 -0
  101. data/lib/stripe/resources/tax_code.rb +11 -0
  102. data/lib/stripe/resources/tax_id.rb +5 -0
  103. data/lib/stripe/resources/tax_rate.rb +3 -0
  104. data/lib/stripe/resources/terminal/configuration.rb +16 -0
  105. data/lib/stripe/resources/terminal/connection_token.rb +3 -0
  106. data/lib/stripe/resources/terminal/location.rb +3 -0
  107. data/lib/stripe/resources/terminal/reader.rb +119 -0
  108. data/lib/stripe/resources/test_helpers/test_clock.rb +35 -0
  109. data/lib/stripe/resources/token.rb +20 -0
  110. data/lib/stripe/resources/topup.rb +15 -3
  111. data/lib/stripe/resources/transfer.rb +10 -11
  112. data/lib/stripe/resources/treasury/credit_reversal.rb +14 -0
  113. data/lib/stripe/resources/treasury/debit_reversal.rb +14 -0
  114. data/lib/stripe/resources/treasury/financial_account.rb +52 -0
  115. data/lib/stripe/resources/treasury/financial_account_features.rb +12 -0
  116. data/lib/stripe/resources/treasury/inbound_transfer.rb +94 -0
  117. data/lib/stripe/resources/treasury/outbound_payment.rb +96 -0
  118. data/lib/stripe/resources/treasury/outbound_transfer.rb +100 -0
  119. data/lib/stripe/resources/treasury/received_credit.rb +30 -0
  120. data/lib/stripe/resources/treasury/received_debit.rb +30 -0
  121. data/lib/stripe/resources/treasury/transaction.rb +13 -0
  122. data/lib/stripe/resources/treasury/transaction_entry.rb +17 -0
  123. data/lib/stripe/resources/usage_record.rb +5 -0
  124. data/lib/stripe/resources/usage_record_summary.rb +1 -0
  125. data/lib/stripe/resources/webhook_endpoint.rb +7 -0
  126. data/lib/stripe/resources.rb +34 -10
  127. data/lib/stripe/search_result_object.rb +86 -0
  128. data/lib/stripe/stripe_client.rb +267 -121
  129. data/lib/stripe/stripe_configuration.rb +29 -10
  130. data/lib/stripe/stripe_object.rb +25 -2
  131. data/lib/stripe/stripe_response.rb +80 -52
  132. data/lib/stripe/util.rb +100 -9
  133. data/lib/stripe/version.rb +1 -1
  134. data/lib/stripe.rb +27 -23
  135. data/stripe.gemspec +12 -5
  136. metadata +46 -204
  137. data/.editorconfig +0 -10
  138. data/.gitattributes +0 -4
  139. data/.github/ISSUE_TEMPLATE.md +0 -5
  140. data/.gitignore +0 -8
  141. data/.rubocop.yml +0 -80
  142. data/.rubocop_todo.yml +0 -33
  143. data/.travis.yml +0 -38
  144. data/.vscode/extensions.json +0 -7
  145. data/.vscode/settings.json +0 -8
  146. data/lib/stripe/resources/bitcoin_receiver.rb +0 -24
  147. data/lib/stripe/resources/bitcoin_transaction.rb +0 -15
  148. data/lib/stripe/resources/issuing/card_details.rb +0 -9
  149. data/lib/stripe/resources/order.rb +0 -33
  150. data/lib/stripe/resources/order_return.rb +0 -10
  151. data/lib/stripe/resources/recipient.rb +0 -14
  152. data/lib/stripe/resources/sku.rb +0 -13
  153. data/lib/stripe/resources/three_d_secure.rb +0 -14
  154. data/test/openapi/README.md +0 -9
  155. data/test/stripe/account_link_test.rb +0 -18
  156. data/test/stripe/account_test.rb +0 -412
  157. data/test/stripe/alipay_account_test.rb +0 -37
  158. data/test/stripe/api_operations_test.rb +0 -80
  159. data/test/stripe/api_resource_test.rb +0 -646
  160. data/test/stripe/apple_pay_domain_test.rb +0 -46
  161. data/test/stripe/application_fee_refund_test.rb +0 -37
  162. data/test/stripe/application_fee_test.rb +0 -58
  163. data/test/stripe/balance_test.rb +0 -13
  164. data/test/stripe/balance_transaction_test.rb +0 -20
  165. data/test/stripe/bank_account_test.rb +0 -36
  166. data/test/stripe/billing_portal/session_test.rb +0 -18
  167. data/test/stripe/capability_test.rb +0 -45
  168. data/test/stripe/charge_test.rb +0 -64
  169. data/test/stripe/checkout/session_test.rb +0 -53
  170. data/test/stripe/connection_manager_test.rb +0 -167
  171. data/test/stripe/country_spec_test.rb +0 -20
  172. data/test/stripe/coupon_test.rb +0 -61
  173. data/test/stripe/credit_note_test.rb +0 -90
  174. data/test/stripe/customer_balance_transaction_test.rb +0 -37
  175. data/test/stripe/customer_card_test.rb +0 -48
  176. data/test/stripe/customer_test.rb +0 -226
  177. data/test/stripe/dispute_test.rb +0 -51
  178. data/test/stripe/ephemeral_key_test.rb +0 -93
  179. data/test/stripe/errors_test.rb +0 -53
  180. data/test/stripe/exchange_rate_test.rb +0 -20
  181. data/test/stripe/file_link_test.rb +0 -41
  182. data/test/stripe/file_test.rb +0 -87
  183. data/test/stripe/instrumentation_test.rb +0 -74
  184. data/test/stripe/invoice_item_test.rb +0 -66
  185. data/test/stripe/invoice_line_item_test.rb +0 -8
  186. data/test/stripe/invoice_test.rb +0 -229
  187. data/test/stripe/issuing/authorization_test.rb +0 -72
  188. data/test/stripe/issuing/card_test.rb +0 -74
  189. data/test/stripe/issuing/cardholder_test.rb +0 -53
  190. data/test/stripe/issuing/dispute_test.rb +0 -54
  191. data/test/stripe/issuing/transaction_test.rb +0 -48
  192. data/test/stripe/list_object_test.rb +0 -202
  193. data/test/stripe/login_link_test.rb +0 -37
  194. data/test/stripe/mandate_test.rb +0 -14
  195. data/test/stripe/multipart_encoder_test.rb +0 -130
  196. data/test/stripe/oauth_test.rb +0 -104
  197. data/test/stripe/order_return_test.rb +0 -21
  198. data/test/stripe/order_test.rb +0 -82
  199. data/test/stripe/payment_intent_test.rb +0 -107
  200. data/test/stripe/payment_method_test.rb +0 -84
  201. data/test/stripe/payout_test.rb +0 -72
  202. data/test/stripe/person_test.rb +0 -46
  203. data/test/stripe/plan_test.rb +0 -98
  204. data/test/stripe/price_test.rb +0 -48
  205. data/test/stripe/product_test.rb +0 -58
  206. data/test/stripe/promotion_code_test.rb +0 -42
  207. data/test/stripe/radar/early_fraud_warning_test.rb +0 -22
  208. data/test/stripe/radar/value_list_item_test.rb +0 -48
  209. data/test/stripe/radar/value_list_test.rb +0 -61
  210. data/test/stripe/recipient_test.rb +0 -62
  211. data/test/stripe/refund_test.rb +0 -39
  212. data/test/stripe/reporting/report_run_test.rb +0 -33
  213. data/test/stripe/reporting/report_type_test.rb +0 -22
  214. data/test/stripe/reversal_test.rb +0 -43
  215. data/test/stripe/review_test.rb +0 -27
  216. data/test/stripe/setup_attempt_test.rb +0 -16
  217. data/test/stripe/setup_intent_test.rb +0 -84
  218. data/test/stripe/sigma/scheduled_query_run_test.rb +0 -22
  219. data/test/stripe/sku_test.rb +0 -60
  220. data/test/stripe/source_test.rb +0 -119
  221. data/test/stripe/stripe_client_test.rb +0 -1291
  222. data/test/stripe/stripe_configuration_test.rb +0 -131
  223. data/test/stripe/stripe_object_test.rb +0 -500
  224. data/test/stripe/stripe_response_test.rb +0 -95
  225. data/test/stripe/subscription_item_test.rb +0 -84
  226. data/test/stripe/subscription_schedule_test.rb +0 -82
  227. data/test/stripe/subscription_test.rb +0 -80
  228. data/test/stripe/tax_id_test.rb +0 -31
  229. data/test/stripe/tax_rate_test.rb +0 -43
  230. data/test/stripe/terminal/connection_token_test.rb +0 -16
  231. data/test/stripe/terminal/location_test.rb +0 -68
  232. data/test/stripe/terminal/reader_test.rb +0 -62
  233. data/test/stripe/three_d_secure_test.rb +0 -23
  234. data/test/stripe/topup_test.rb +0 -62
  235. data/test/stripe/transfer_test.rb +0 -88
  236. data/test/stripe/usage_record_summary_test.rb +0 -29
  237. data/test/stripe/util_test.rb +0 -402
  238. data/test/stripe/webhook_endpoint_test.rb +0 -59
  239. data/test/stripe/webhook_test.rb +0 -135
  240. data/test/stripe_mock.rb +0 -78
  241. data/test/stripe_test.rb +0 -132
  242. data/test/test_data.rb +0 -61
  243. data/test/test_helper.rb +0 -77
@@ -1,3 +1,4 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  # rubocop:disable Metrics/MethodLength
@@ -8,22 +9,23 @@ module Stripe
8
9
  {
9
10
  # data structures
10
11
  ListObject::OBJECT_NAME => ListObject,
12
+ SearchResultObject::OBJECT_NAME => SearchResultObject,
11
13
 
12
14
  # business objects
13
15
  Account::OBJECT_NAME => Account,
14
16
  AccountLink::OBJECT_NAME => AccountLink,
15
- AlipayAccount::OBJECT_NAME => AlipayAccount,
16
17
  ApplePayDomain::OBJECT_NAME => ApplePayDomain,
17
18
  ApplicationFee::OBJECT_NAME => ApplicationFee,
18
19
  ApplicationFeeRefund::OBJECT_NAME => ApplicationFeeRefund,
20
+ Apps::Secret::OBJECT_NAME => Apps::Secret,
19
21
  Balance::OBJECT_NAME => Balance,
20
22
  BalanceTransaction::OBJECT_NAME => BalanceTransaction,
21
23
  BankAccount::OBJECT_NAME => BankAccount,
24
+ BillingPortal::Configuration::OBJECT_NAME => BillingPortal::Configuration,
22
25
  BillingPortal::Session::OBJECT_NAME => BillingPortal::Session,
23
- BitcoinReceiver::OBJECT_NAME => BitcoinReceiver,
24
- BitcoinTransaction::OBJECT_NAME => BitcoinTransaction,
25
26
  Capability::OBJECT_NAME => Capability,
26
27
  Card::OBJECT_NAME => Card,
28
+ CashBalance::OBJECT_NAME => CashBalance,
27
29
  Charge::OBJECT_NAME => Charge,
28
30
  Checkout::Session::OBJECT_NAME => Checkout::Session,
29
31
  CountrySpec::OBJECT_NAME => CountrySpec,
@@ -32,6 +34,7 @@ module Stripe
32
34
  CreditNoteLineItem::OBJECT_NAME => CreditNoteLineItem,
33
35
  Customer::OBJECT_NAME => Customer,
34
36
  CustomerBalanceTransaction::OBJECT_NAME => CustomerBalanceTransaction,
37
+ CustomerCashBalanceTransaction::OBJECT_NAME => CustomerCashBalanceTransaction,
35
38
  Discount::OBJECT_NAME => Discount,
36
39
  Dispute::OBJECT_NAME => Dispute,
37
40
  EphemeralKey::OBJECT_NAME => EphemeralKey,
@@ -40,21 +43,27 @@ module Stripe
40
43
  File::OBJECT_NAME => File,
41
44
  File::OBJECT_NAME_ALT => File,
42
45
  FileLink::OBJECT_NAME => FileLink,
46
+ FinancialConnections::Account::OBJECT_NAME => FinancialConnections::Account,
47
+ FinancialConnections::AccountOwner::OBJECT_NAME => FinancialConnections::AccountOwner,
48
+ FinancialConnections::AccountOwnership::OBJECT_NAME =>
49
+ FinancialConnections::AccountOwnership,
50
+ FinancialConnections::Session::OBJECT_NAME => FinancialConnections::Session,
51
+ FundingInstructions::OBJECT_NAME => FundingInstructions,
52
+ Identity::VerificationReport::OBJECT_NAME => Identity::VerificationReport,
53
+ Identity::VerificationSession::OBJECT_NAME => Identity::VerificationSession,
43
54
  Invoice::OBJECT_NAME => Invoice,
44
55
  InvoiceItem::OBJECT_NAME => InvoiceItem,
45
56
  InvoiceLineItem::OBJECT_NAME => InvoiceLineItem,
46
57
  Issuing::Authorization::OBJECT_NAME => Issuing::Authorization,
47
58
  Issuing::Card::OBJECT_NAME => Issuing::Card,
48
- Issuing::CardDetails::OBJECT_NAME => Issuing::CardDetails,
49
59
  Issuing::Cardholder::OBJECT_NAME => Issuing::Cardholder,
50
60
  Issuing::Dispute::OBJECT_NAME => Issuing::Dispute,
51
61
  Issuing::Transaction::OBJECT_NAME => Issuing::Transaction,
52
62
  LineItem::OBJECT_NAME => LineItem,
53
63
  LoginLink::OBJECT_NAME => LoginLink,
54
64
  Mandate::OBJECT_NAME => Mandate,
55
- Order::OBJECT_NAME => Order,
56
- OrderReturn::OBJECT_NAME => OrderReturn,
57
65
  PaymentIntent::OBJECT_NAME => PaymentIntent,
66
+ PaymentLink::OBJECT_NAME => PaymentLink,
58
67
  PaymentMethod::OBJECT_NAME => PaymentMethod,
59
68
  Payout::OBJECT_NAME => Payout,
60
69
  Person::OBJECT_NAME => Person,
@@ -62,34 +71,51 @@ module Stripe
62
71
  Price::OBJECT_NAME => Price,
63
72
  Product::OBJECT_NAME => Product,
64
73
  PromotionCode::OBJECT_NAME => PromotionCode,
74
+ Quote::OBJECT_NAME => Quote,
65
75
  Radar::EarlyFraudWarning::OBJECT_NAME => Radar::EarlyFraudWarning,
66
76
  Radar::ValueList::OBJECT_NAME => Radar::ValueList,
67
77
  Radar::ValueListItem::OBJECT_NAME => Radar::ValueListItem,
68
- Recipient::OBJECT_NAME => Recipient,
69
- RecipientTransfer::OBJECT_NAME => RecipientTransfer,
70
78
  Refund::OBJECT_NAME => Refund,
71
79
  Reporting::ReportRun::OBJECT_NAME => Reporting::ReportRun,
72
80
  Reporting::ReportType::OBJECT_NAME => Reporting::ReportType,
73
81
  Reversal::OBJECT_NAME => Reversal,
74
82
  Review::OBJECT_NAME => Review,
75
- SKU::OBJECT_NAME => SKU,
76
83
  SetupAttempt::OBJECT_NAME => SetupAttempt,
77
84
  SetupIntent::OBJECT_NAME => SetupIntent,
85
+ ShippingRate::OBJECT_NAME => ShippingRate,
78
86
  Sigma::ScheduledQueryRun::OBJECT_NAME => Sigma::ScheduledQueryRun,
79
87
  Source::OBJECT_NAME => Source,
80
88
  SourceTransaction::OBJECT_NAME => SourceTransaction,
81
89
  Subscription::OBJECT_NAME => Subscription,
82
90
  SubscriptionItem::OBJECT_NAME => SubscriptionItem,
83
91
  SubscriptionSchedule::OBJECT_NAME => SubscriptionSchedule,
92
+ Tax::Calculation::OBJECT_NAME => Tax::Calculation,
93
+ Tax::CalculationLineItem::OBJECT_NAME => Tax::CalculationLineItem,
94
+ Tax::Settings::OBJECT_NAME => Tax::Settings,
95
+ Tax::Transaction::OBJECT_NAME => Tax::Transaction,
96
+ Tax::TransactionLineItem::OBJECT_NAME => Tax::TransactionLineItem,
97
+ TaxCode::OBJECT_NAME => TaxCode,
84
98
  TaxId::OBJECT_NAME => TaxId,
85
99
  TaxRate::OBJECT_NAME => TaxRate,
100
+ Terminal::Configuration::OBJECT_NAME => Terminal::Configuration,
86
101
  Terminal::ConnectionToken::OBJECT_NAME => Terminal::ConnectionToken,
87
102
  Terminal::Location::OBJECT_NAME => Terminal::Location,
88
103
  Terminal::Reader::OBJECT_NAME => Terminal::Reader,
89
- ThreeDSecure::OBJECT_NAME => ThreeDSecure,
104
+ TestHelpers::TestClock::OBJECT_NAME => TestHelpers::TestClock,
90
105
  Token::OBJECT_NAME => Token,
91
106
  Topup::OBJECT_NAME => Topup,
92
107
  Transfer::OBJECT_NAME => Transfer,
108
+ Treasury::CreditReversal::OBJECT_NAME => Treasury::CreditReversal,
109
+ Treasury::DebitReversal::OBJECT_NAME => Treasury::DebitReversal,
110
+ Treasury::FinancialAccount::OBJECT_NAME => Treasury::FinancialAccount,
111
+ Treasury::FinancialAccountFeatures::OBJECT_NAME => Treasury::FinancialAccountFeatures,
112
+ Treasury::InboundTransfer::OBJECT_NAME => Treasury::InboundTransfer,
113
+ Treasury::OutboundPayment::OBJECT_NAME => Treasury::OutboundPayment,
114
+ Treasury::OutboundTransfer::OBJECT_NAME => Treasury::OutboundTransfer,
115
+ Treasury::ReceivedCredit::OBJECT_NAME => Treasury::ReceivedCredit,
116
+ Treasury::ReceivedDebit::OBJECT_NAME => Treasury::ReceivedDebit,
117
+ Treasury::Transaction::OBJECT_NAME => Treasury::Transaction,
118
+ Treasury::TransactionEntry::OBJECT_NAME => Treasury::TransactionEntry,
93
119
  UsageRecord::OBJECT_NAME => UsageRecord,
94
120
  UsageRecordSummary::OBJECT_NAME => UsageRecordSummary,
95
121
  WebhookEndpoint::OBJECT_NAME => WebhookEndpoint,
@@ -2,6 +2,14 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Stripe
5
+ # This is an object representing a Stripe account. You can retrieve it to see
6
+ # properties on the account like its current requirements or if the account is
7
+ # enabled to make live charges or receive payouts.
8
+ #
9
+ # For Custom accounts, the properties below are always returned. For other accounts, some properties are returned until that
10
+ # account has started to go through Connect Onboarding. Once you create an [Account Link](https://stripe.com/docs/api/account_links)
11
+ # for a Standard or Express account, some parameters are no longer returned. These are marked as **Custom Only** or **Custom and Express**
12
+ # below. Learn about the differences [between accounts](https://stripe.com/docs/connect/accounts).
5
13
  class Account < APIResource
6
14
  extend Gem::Deprecate
7
15
  extend Stripe::APIOperations::Create
@@ -12,18 +20,43 @@ module Stripe
12
20
 
13
21
  OBJECT_NAME = "account"
14
22
 
15
- custom_method :reject, http_verb: :post
16
-
17
23
  nested_resource_class_methods :capability,
18
24
  operations: %i[retrieve update list],
19
25
  resource_plural: "capabilities"
20
26
  nested_resource_class_methods :person,
21
27
  operations: %i[create retrieve update delete list]
22
28
 
29
+ def persons(params = {}, opts = {})
30
+ request_stripe_object(
31
+ method: :get,
32
+ path: format("/v1/accounts/%<account>s/persons", { account: CGI.escape(self["id"]) }),
33
+ params: params,
34
+ opts: opts
35
+ )
36
+ end
37
+
23
38
  def reject(params = {}, opts = {})
24
39
  request_stripe_object(
25
40
  method: :post,
26
- path: resource_url + "/reject",
41
+ path: format("/v1/accounts/%<account>s/reject", { account: CGI.escape(self["id"]) }),
42
+ params: params,
43
+ opts: opts
44
+ )
45
+ end
46
+
47
+ def self.persons(account, params = {}, opts = {})
48
+ request_stripe_object(
49
+ method: :get,
50
+ path: format("/v1/accounts/%<account>s/persons", { account: CGI.escape(account) }),
51
+ params: params,
52
+ opts: opts
53
+ )
54
+ end
55
+
56
+ def self.reject(account, params = {}, opts = {})
57
+ request_stripe_object(
58
+ method: :post,
59
+ path: format("/v1/accounts/%<account>s/reject", { account: CGI.escape(account) }),
27
60
  params: params,
28
61
  opts: opts
29
62
  )
@@ -33,7 +66,6 @@ module Stripe
33
66
 
34
67
  nested_resource_class_methods :external_account,
35
68
  operations: %i[create retrieve update delete list]
36
-
37
69
  nested_resource_class_methods :login_link, operations: %i[create]
38
70
 
39
71
  def resource_url
@@ -45,12 +77,8 @@ module Stripe
45
77
  end
46
78
 
47
79
  # @override To make id optional
48
- def self.retrieve(id = ARGUMENT_NOT_PROVIDED, opts = {})
49
- id = if id.equal?(ARGUMENT_NOT_PROVIDED)
50
- nil
51
- else
52
- Util.check_string_argument!(id)
53
- end
80
+ def self.retrieve(id = nil, opts = {})
81
+ Util.check_string_argument!(id) if id
54
82
 
55
83
  # Account used to be a singleton, where this method's signature was
56
84
  # `(opts={})`. For the sake of not breaking folks who pass in an OAuth
@@ -64,11 +92,6 @@ module Stripe
64
92
  super(id, opts)
65
93
  end
66
94
 
67
- def persons(params = {}, opts = {})
68
- resp, opts = execute_resource_request(:get, resource_url + "/persons", params, opts)
69
- Util.convert_to_stripe_object(resp.data, opts)
70
- end
71
-
72
95
  # We are not adding a helper for capabilities here as the Account object
73
96
  # already has a capabilities property which is a hash and not the sub-list
74
97
  # of capabilities.
@@ -136,11 +159,10 @@ module Stripe
136
159
  client_id: client_id,
137
160
  stripe_user_id: id,
138
161
  }
162
+ opts = @opts.merge(Util.normalize_opts(opts))
139
163
  OAuth.deauthorize(params, opts)
140
164
  end
141
165
 
142
- ARGUMENT_NOT_PROVIDED = Object.new
143
-
144
166
  private def serialize_additional_owners(legal_entity, additional_owners)
145
167
  original_value =
146
168
  legal_entity
@@ -2,6 +2,10 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Stripe
5
+ # Account Links are the means by which a Connect platform grants a connected account permission to access
6
+ # Stripe-hosted applications, such as Connect Onboarding.
7
+ #
8
+ # Related guide: [Connect Onboarding](https://stripe.com/docs/connect/connect-onboarding)
5
9
  class AccountLink < APIResource
6
10
  extend Stripe::APIOperations::Create
7
11
 
@@ -1,9 +1,15 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Stripe
5
+ # `Application Fee Refund` objects allow you to refund an application fee that
6
+ # has previously been created but not yet refunded. Funds will be refunded to
7
+ # the Stripe account from which the fee was originally collected.
8
+ #
9
+ # Related guide: [Refunding application fees](https://stripe.com/docs/connect/destination-charges#refunding-app-fee)
4
10
  class ApplicationFeeRefund < APIResource
5
- include Stripe::APIOperations::Save
6
11
  extend Stripe::APIOperations::List
12
+ include Stripe::APIOperations::Save
7
13
 
8
14
  OBJECT_NAME = "fee_refund"
9
15
 
@@ -0,0 +1,40 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Apps
6
+ # Secret Store is an API that allows Stripe Apps developers to securely persist secrets for use by UI Extensions and app backends.
7
+ #
8
+ # The primary resource in Secret Store is a `secret`. Other apps can't view secrets created by an app. Additionally, secrets are scoped to provide further permission control.
9
+ #
10
+ # All Dashboard users and the app backend share `account` scoped secrets. Use the `account` scope for secrets that don't change per-user, like a third-party API key.
11
+ #
12
+ # A `user` scoped secret is accessible by the app backend and one specific Dashboard user. Use the `user` scope for per-user secrets like per-user OAuth tokens, where different users might have different permissions.
13
+ #
14
+ # Related guide: [Store data between page reloads](https://stripe.com/docs/stripe-apps/store-auth-data-custom-objects)
15
+ class Secret < APIResource
16
+ extend Stripe::APIOperations::Create
17
+ extend Stripe::APIOperations::List
18
+
19
+ OBJECT_NAME = "apps.secret"
20
+
21
+ def self.delete_where(params = {}, opts = {})
22
+ request_stripe_object(
23
+ method: :post,
24
+ path: "/v1/apps/secrets/delete",
25
+ params: params,
26
+ opts: opts
27
+ )
28
+ end
29
+
30
+ def self.find(params = {}, opts = {})
31
+ request_stripe_object(
32
+ method: :get,
33
+ path: "/v1/apps/secrets/find",
34
+ params: params,
35
+ opts: opts
36
+ )
37
+ end
38
+ end
39
+ end
40
+ end
@@ -2,6 +2,17 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Stripe
5
+ # This is an object representing your Stripe balance. You can retrieve it to see
6
+ # the balance currently on your Stripe account.
7
+ #
8
+ # You can also retrieve the balance history, which contains a list of
9
+ # [transactions](https://stripe.com/docs/reporting/balance-transaction-types) that contributed to the balance
10
+ # (charges, payouts, and so forth).
11
+ #
12
+ # The available and pending amounts for each currency are broken down further by
13
+ # payment source types.
14
+ #
15
+ # Related guide: [Understanding Connect account balances](https://stripe.com/docs/connect/account-balances)
5
16
  class Balance < SingletonAPIResource
6
17
  OBJECT_NAME = "balance"
7
18
  end
@@ -2,6 +2,10 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Stripe
5
+ # Balance transactions represent funds moving through your Stripe account.
6
+ # They're created for every type of transaction that comes into or flows out of your Stripe account balance.
7
+ #
8
+ # Related guide: [Balance transaction types](https://stripe.com/docs/reports/balance-transaction-types)
5
9
  class BalanceTransaction < APIResource
6
10
  extend Stripe::APIOperations::List
7
11
 
@@ -2,6 +2,13 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Stripe
5
+ # These bank accounts are payment methods on `Customer` objects.
6
+ #
7
+ # On the other hand [External Accounts](https://stripe.com/docs/api#external_accounts) are transfer
8
+ # destinations on `Account` objects for [Custom accounts](https://stripe.com/docs/connect/custom-accounts).
9
+ # They can be bank accounts or debit cards as well, and are documented in the links above.
10
+ #
11
+ # Related guide: [Bank debits and transfers](https://stripe.com/docs/payments/bank-debits-transfers)
5
12
  class BankAccount < APIResource
6
13
  include Stripe::APIOperations::Delete
7
14
  extend Stripe::APIOperations::List
@@ -0,0 +1,15 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module BillingPortal
6
+ # A portal configuration describes the functionality and behavior of a portal session.
7
+ class Configuration < APIResource
8
+ extend Stripe::APIOperations::Create
9
+ extend Stripe::APIOperations::List
10
+ include Stripe::APIOperations::Save
11
+
12
+ OBJECT_NAME = "billing_portal.configuration"
13
+ end
14
+ end
15
+ end
@@ -3,6 +3,20 @@
3
3
 
4
4
  module Stripe
5
5
  module BillingPortal
6
+ # The Billing customer portal is a Stripe-hosted UI for subscription and
7
+ # billing management.
8
+ #
9
+ # A portal configuration describes the functionality and features that you
10
+ # want to provide to your customers through the portal.
11
+ #
12
+ # A portal session describes the instantiation of the customer portal for
13
+ # a particular customer. By visiting the session's URL, the customer
14
+ # can manage their subscriptions and billing details. For security reasons,
15
+ # sessions are short-lived and will expire if the customer does not visit the URL.
16
+ # Create sessions on-demand when customers intend to manage their subscriptions
17
+ # and billing details.
18
+ #
19
+ # Learn more in the [integration guide](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal).
6
20
  class Session < APIResource
7
21
  extend Stripe::APIOperations::Create
8
22
 
@@ -1,6 +1,10 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Stripe
5
+ # This is an object representing a capability for a Stripe account.
6
+ #
7
+ # Related guide: [Account capabilities](https://stripe.com/docs/connect/account-capabilities)
4
8
  class Capability < APIResource
5
9
  extend Stripe::APIOperations::List
6
10
  include Stripe::APIOperations::Save
@@ -26,7 +30,7 @@ module Stripe
26
30
  def self.update(_id, _params = nil, _opts = nil)
27
31
  raise NotImplementedError,
28
32
  "Capabilities cannot be updated without an account ID. Update a " \
29
- "capability using Account.update_capability('account_id', " \
33
+ "capability using `Account.update_capability('account_id', " \
30
34
  "'capability_id', update_params)`"
31
35
  end
32
36
  end
@@ -2,6 +2,11 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Stripe
5
+ # You can store multiple cards on a customer in order to charge the customer
6
+ # later. You can also store multiple debit cards on a recipient in order to
7
+ # transfer to those cards later.
8
+ #
9
+ # Related guide: [Card payments with Sources](https://stripe.com/docs/sources/cards)
5
10
  class Card < APIResource
6
11
  include Stripe::APIOperations::Delete
7
12
  extend Stripe::APIOperations::List
@@ -10,9 +15,7 @@ module Stripe
10
15
  OBJECT_NAME = "card"
11
16
 
12
17
  def resource_url
13
- if respond_to?(:recipient) && !recipient.nil? && !recipient.empty?
14
- "#{Recipient.resource_url}/#{CGI.escape(recipient)}/cards/#{CGI.escape(id)}"
15
- elsif respond_to?(:customer) && !customer.nil? && !customer.empty?
18
+ if respond_to?(:customer) && !customer.nil? && !customer.empty?
16
19
  "#{Customer.resource_url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}"
17
20
  elsif respond_to?(:account) && !account.nil? && !account.empty?
18
21
  "#{Account.resource_url}/#{CGI.escape(account)}/external_accounts/#{CGI.escape(id)}"
@@ -0,0 +1,23 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
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
+ class CashBalance < APIResource
7
+ OBJECT_NAME = "cash_balance"
8
+
9
+ def resource_url
10
+ if !respond_to?(:customer) || customer.nil?
11
+ raise NotImplementedError,
12
+ "Customer Cash Balance cannot be accessed without a customer ID."
13
+ end
14
+ "#{Customer.resource_url}/#{CGI.escape(customer)}/cash_balance"
15
+ end
16
+
17
+ def self.retrieve(_id, _opts = {})
18
+ raise NotImplementedError,
19
+ "Customer Cash Balance cannot be retrieved without a customer ID. " \
20
+ "Retrieve a Customer Cash Balance using `Customer.retrieve_cash_balance('cus_123')`"
21
+ end
22
+ end
23
+ end
@@ -2,22 +2,42 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Stripe
5
+ # The `Charge` object represents a single attempt to move money into your Stripe account.
6
+ # PaymentIntent confirmation is the most common way to create Charges, but transferring
7
+ # money to a different Stripe account through Connect also creates Charges.
8
+ # Some legacy payment flows create Charges directly, which is not recommended for new integrations.
5
9
  class Charge < APIResource
6
10
  extend Stripe::APIOperations::Create
7
11
  extend Stripe::APIOperations::List
12
+ extend Stripe::APIOperations::Search
8
13
  include Stripe::APIOperations::Save
9
14
 
10
15
  OBJECT_NAME = "charge"
11
16
 
12
- custom_method :capture, http_verb: :post
13
-
14
17
  def capture(params = {}, opts = {})
15
18
  request_stripe_object(
16
19
  method: :post,
17
- path: resource_url + "/capture",
20
+ path: format("/v1/charges/%<charge>s/capture", { charge: CGI.escape(self["id"]) }),
21
+ params: params,
22
+ opts: opts
23
+ )
24
+ end
25
+
26
+ def self.capture(charge, params = {}, opts = {})
27
+ request_stripe_object(
28
+ method: :post,
29
+ path: format("/v1/charges/%<charge>s/capture", { charge: CGI.escape(charge) }),
18
30
  params: params,
19
31
  opts: opts
20
32
  )
21
33
  end
34
+
35
+ def self.search(params = {}, opts = {})
36
+ _search("/v1/charges/search", params, opts)
37
+ end
38
+
39
+ def self.search_auto_paging_each(params = {}, opts = {}, &blk)
40
+ search(params, opts).auto_paging_each(&blk)
41
+ end
22
42
  end
23
43
  end
@@ -3,14 +3,61 @@
3
3
 
4
4
  module Stripe
5
5
  module Checkout
6
+ # A Checkout Session represents your customer's session as they pay for
7
+ # one-time purchases or subscriptions through [Checkout](https://stripe.com/docs/payments/checkout)
8
+ # or [Payment Links](https://stripe.com/docs/payments/payment-links). We recommend creating a
9
+ # new Session each time your customer attempts to pay.
10
+ #
11
+ # Once payment is successful, the Checkout Session will contain a reference
12
+ # to the [Customer](https://stripe.com/docs/api/customers), and either the successful
13
+ # [PaymentIntent](https://stripe.com/docs/api/payment_intents) or an active
14
+ # [Subscription](https://stripe.com/docs/api/subscriptions).
15
+ #
16
+ # You can create a Checkout Session on your server and redirect to its URL
17
+ # to begin Checkout.
18
+ #
19
+ # Related guide: [Checkout quickstart](https://stripe.com/docs/checkout/quickstart)
6
20
  class Session < APIResource
7
21
  extend Stripe::APIOperations::Create
8
22
  extend Stripe::APIOperations::List
9
- extend Stripe::APIOperations::NestedResource
10
23
 
11
24
  OBJECT_NAME = "checkout.session"
12
25
 
13
- nested_resource_class_methods :line_item, operations: %i[list]
26
+ def expire(params = {}, opts = {})
27
+ request_stripe_object(
28
+ method: :post,
29
+ path: format("/v1/checkout/sessions/%<session>s/expire", { session: CGI.escape(self["id"]) }),
30
+ params: params,
31
+ opts: opts
32
+ )
33
+ end
34
+
35
+ def list_line_items(params = {}, opts = {})
36
+ request_stripe_object(
37
+ method: :get,
38
+ path: format("/v1/checkout/sessions/%<session>s/line_items", { session: CGI.escape(self["id"]) }),
39
+ params: params,
40
+ opts: opts
41
+ )
42
+ end
43
+
44
+ def self.expire(session, params = {}, opts = {})
45
+ request_stripe_object(
46
+ method: :post,
47
+ path: format("/v1/checkout/sessions/%<session>s/expire", { session: CGI.escape(session) }),
48
+ params: params,
49
+ opts: opts
50
+ )
51
+ end
52
+
53
+ def self.list_line_items(session, params = {}, opts = {})
54
+ request_stripe_object(
55
+ method: :get,
56
+ path: format("/v1/checkout/sessions/%<session>s/line_items", { session: CGI.escape(session) }),
57
+ params: params,
58
+ opts: opts
59
+ )
60
+ end
14
61
  end
15
62
  end
16
63
  end
@@ -2,6 +2,12 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Stripe
5
+ # Stripe needs to collect certain pieces of information about each account
6
+ # created. These requirements can differ depending on the account's country. The
7
+ # Country Specs API makes these rules available to your integration.
8
+ #
9
+ # You can also view the information from this API call as [an online
10
+ # guide](https://stripe.com/docs/connect/required-verification-information).
5
11
  class CountrySpec < APIResource
6
12
  extend Stripe::APIOperations::List
7
13
 
@@ -2,6 +2,9 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Stripe
5
+ # A coupon contains information about a percent-off or amount-off discount you
6
+ # might want to apply to a customer. Coupons may be applied to [subscriptions](https://stripe.com/docs/api#subscriptions), [invoices](https://stripe.com/docs/api#invoices),
7
+ # [checkout sessions](https://stripe.com/docs/api/checkout/sessions), [quotes](https://stripe.com/docs/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge) or [payment intents](https://stripe.com/docs/api/payment_intents).
5
8
  class Coupon < APIResource
6
9
  extend Stripe::APIOperations::Create
7
10
  include Stripe::APIOperations::Delete
@@ -2,6 +2,9 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Stripe
5
+ # Issue a credit note to adjust an invoice's amount after the invoice is finalized.
6
+ #
7
+ # Related guide: [Credit notes](https://stripe.com/docs/billing/invoices/credit-notes)
5
8
  class CreditNote < APIResource
6
9
  extend Stripe::APIOperations::Create
7
10
  extend Stripe::APIOperations::List
@@ -9,25 +12,40 @@ module Stripe
9
12
 
10
13
  OBJECT_NAME = "credit_note"
11
14
 
12
- custom_method :void_credit_note, http_verb: :post, http_path: "void"
13
-
14
15
  def void_credit_note(params = {}, opts = {})
15
16
  request_stripe_object(
16
17
  method: :post,
17
- path: resource_url + "/void",
18
+ path: format("/v1/credit_notes/%<id>s/void", { id: CGI.escape(self["id"]) }),
19
+ params: params,
20
+ opts: opts
21
+ )
22
+ end
23
+
24
+ def self.list_preview_line_items(params = {}, opts = {})
25
+ request_stripe_object(
26
+ method: :get,
27
+ path: "/v1/credit_notes/preview/lines",
18
28
  params: params,
19
29
  opts: opts
20
30
  )
21
31
  end
22
32
 
23
- def self.preview(params, opts = {})
24
- resp, opts = execute_resource_request(:get, resource_url + "/preview", params, opts)
25
- Util.convert_to_stripe_object(resp.data, opts)
33
+ def self.preview(params = {}, opts = {})
34
+ request_stripe_object(
35
+ method: :get,
36
+ path: "/v1/credit_notes/preview",
37
+ params: params,
38
+ opts: opts
39
+ )
26
40
  end
27
41
 
28
- def self.list_preview_line_items(params, opts = {})
29
- resp, opts = execute_resource_request(:get, resource_url + "/preview/lines", params, opts)
30
- Util.convert_to_stripe_object(resp.data, opts)
42
+ def self.void_credit_note(id, params = {}, opts = {})
43
+ request_stripe_object(
44
+ method: :post,
45
+ path: format("/v1/credit_notes/%<id>s/void", { id: CGI.escape(id) }),
46
+ params: params,
47
+ opts: opts
48
+ )
31
49
  end
32
50
  end
33
51
  end
@@ -1,6 +1,8 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Stripe
5
+ # The credit note line item object
4
6
  class CreditNoteLineItem < StripeObject
5
7
  OBJECT_NAME = "credit_note_line_item"
6
8
  end