stripe 10.1.0 → 12.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +215 -21
  3. data/Gemfile +6 -5
  4. data/Makefile +8 -1
  5. data/OPENAPI_VERSION +1 -1
  6. data/README.md +46 -14
  7. data/Rakefile +7 -5
  8. data/VERSION +1 -1
  9. data/{bin → exe}/stripe-console +1 -1
  10. data/lib/stripe/api_operations/nested_resource.rb +22 -2
  11. data/lib/stripe/api_operations/request.rb +22 -18
  12. data/lib/stripe/api_operations/save.rb +7 -9
  13. data/lib/stripe/api_operations/search.rb +5 -0
  14. data/lib/stripe/api_operations/singleton_save.rb +86 -0
  15. data/lib/stripe/api_resource.rb +13 -4
  16. data/lib/stripe/api_resource_test_helpers.rb +7 -3
  17. data/lib/stripe/api_version.rb +1 -1
  18. data/lib/stripe/connection_manager.rb +4 -6
  19. data/lib/stripe/errors.rb +3 -11
  20. data/lib/stripe/instrumentation.rb +5 -21
  21. data/lib/stripe/list_object.rb +3 -0
  22. data/lib/stripe/multipart_encoder.rb +7 -7
  23. data/lib/stripe/oauth.rb +6 -6
  24. data/lib/stripe/object_types.rb +135 -116
  25. data/lib/stripe/resources/account.rb +103 -25
  26. data/lib/stripe/resources/account_link.rb +8 -0
  27. data/lib/stripe/resources/account_session.rb +8 -0
  28. data/lib/stripe/resources/alipay_account.rb +1 -1
  29. data/lib/stripe/resources/apple_pay_domain.rb +43 -0
  30. data/lib/stripe/resources/application_fee.rb +8 -0
  31. data/lib/stripe/resources/application_fee_refund.rb +4 -2
  32. data/lib/stripe/resources/apps/secret.rb +15 -0
  33. data/lib/stripe/resources/balance.rb +3 -0
  34. data/lib/stripe/resources/balance_transaction.rb +15 -0
  35. data/lib/stripe/resources/bank_account.rb +49 -7
  36. data/lib/stripe/resources/billing/alert.rb +87 -0
  37. data/lib/stripe/resources/billing/meter.rb +83 -0
  38. data/lib/stripe/resources/billing/meter_event.rb +27 -0
  39. data/lib/stripe/resources/billing/meter_event_adjustment.rb +26 -0
  40. data/lib/stripe/resources/billing/meter_event_summary.rb +15 -0
  41. data/lib/stripe/resources/billing_portal/configuration.rb +33 -0
  42. data/lib/stripe/resources/billing_portal/session.rb +14 -1
  43. data/lib/stripe/resources/capability.rb +4 -2
  44. data/lib/stripe/resources/card.rb +28 -0
  45. data/lib/stripe/resources/cash_balance.rb +3 -0
  46. data/lib/stripe/resources/charge.rb +39 -1
  47. data/lib/stripe/resources/checkout/session.rb +47 -5
  48. data/lib/stripe/resources/climate/order.rb +67 -0
  49. data/lib/stripe/resources/climate/product.rb +27 -0
  50. data/lib/stripe/resources/climate/supplier.rb +26 -0
  51. data/lib/stripe/resources/confirmation_token.rb +39 -0
  52. data/lib/stripe/resources/country_spec.rb +8 -0
  53. data/lib/stripe/resources/coupon.rb +45 -0
  54. data/lib/stripe/resources/credit_note.rb +47 -7
  55. data/lib/stripe/resources/credit_note_line_item.rb +3 -0
  56. data/lib/stripe/resources/customer.rb +89 -26
  57. data/lib/stripe/resources/customer_balance_transaction.rb +3 -1
  58. data/lib/stripe/resources/customer_cash_balance_transaction.rb +3 -2
  59. data/lib/stripe/resources/customer_session.rb +29 -0
  60. data/lib/stripe/resources/discount.rb +3 -0
  61. data/lib/stripe/resources/dispute.rb +26 -0
  62. data/lib/stripe/resources/entitlements/active_entitlement.rb +26 -0
  63. data/lib/stripe/resources/entitlements/feature.rb +49 -0
  64. data/lib/stripe/resources/ephemeral_key.rb +23 -0
  65. data/lib/stripe/resources/event.rb +11 -3
  66. data/lib/stripe/resources/exchange_rate.rb +8 -0
  67. data/lib/stripe/resources/file.rb +29 -16
  68. data/lib/stripe/resources/file_link.rb +23 -0
  69. data/lib/stripe/resources/financial_connections/account.rb +66 -7
  70. data/lib/stripe/resources/financial_connections/account_owner.rb +3 -0
  71. data/lib/stripe/resources/financial_connections/account_ownership.rb +3 -0
  72. data/lib/stripe/resources/financial_connections/session.rb +13 -0
  73. data/lib/stripe/resources/financial_connections/transaction.rb +26 -0
  74. data/lib/stripe/resources/forwarding/request.rb +52 -0
  75. data/lib/stripe/resources/funding_instructions.rb +3 -0
  76. data/lib/stripe/resources/identity/verification_report.rb +14 -1
  77. data/lib/stripe/resources/identity/verification_session.rb +90 -4
  78. data/lib/stripe/resources/invoice.rb +170 -17
  79. data/lib/stripe/resources/invoice_item.rb +43 -0
  80. data/lib/stripe/resources/invoice_line_item.rb +21 -0
  81. data/lib/stripe/resources/invoice_rendering_template.rb +63 -0
  82. data/lib/stripe/resources/issuing/authorization.rb +88 -14
  83. data/lib/stripe/resources/issuing/card.rb +50 -16
  84. data/lib/stripe/resources/issuing/cardholder.rb +33 -0
  85. data/lib/stripe/resources/issuing/dispute.rb +35 -0
  86. data/lib/stripe/resources/issuing/personalization_design.rb +119 -0
  87. data/lib/stripe/resources/issuing/physical_bundle.rb +26 -0
  88. data/lib/stripe/resources/issuing/token.rb +18 -0
  89. data/lib/stripe/resources/issuing/transaction.rb +30 -0
  90. data/lib/stripe/resources/line_item.rb +3 -0
  91. data/lib/stripe/resources/login_link.rb +4 -1
  92. data/lib/stripe/resources/mandate.rb +3 -0
  93. data/lib/stripe/resources/payment_intent.rb +190 -25
  94. data/lib/stripe/resources/payment_link.rb +25 -0
  95. data/lib/stripe/resources/payment_method.rb +57 -4
  96. data/lib/stripe/resources/payment_method_configuration.rb +33 -0
  97. data/lib/stripe/resources/payment_method_domain.rb +46 -1
  98. data/lib/stripe/resources/payout.rb +39 -4
  99. data/lib/stripe/resources/person.rb +5 -4
  100. data/lib/stripe/resources/plan.rb +43 -0
  101. data/lib/stripe/resources/price.rb +24 -1
  102. data/lib/stripe/resources/product.rb +47 -1
  103. data/lib/stripe/resources/product_feature.rb +13 -0
  104. data/lib/stripe/resources/promotion_code.rb +23 -0
  105. data/lib/stripe/resources/quote.rb +67 -32
  106. data/lib/stripe/resources/radar/early_fraud_warning.rb +13 -0
  107. data/lib/stripe/resources/radar/value_list.rb +53 -0
  108. data/lib/stripe/resources/radar/value_list_item.rb +43 -0
  109. data/lib/stripe/resources/refund.rb +46 -0
  110. data/lib/stripe/resources/reporting/report_run.rb +23 -0
  111. data/lib/stripe/resources/reporting/report_type.rb +13 -0
  112. data/lib/stripe/resources/reversal.rb +5 -3
  113. data/lib/stripe/resources/review.rb +10 -0
  114. data/lib/stripe/resources/setup_attempt.rb +8 -0
  115. data/lib/stripe/resources/setup_intent.rb +72 -10
  116. data/lib/stripe/resources/shipping_rate.rb +23 -0
  117. data/lib/stripe/resources/sigma/scheduled_query_run.rb +13 -0
  118. data/lib/stripe/resources/source.rb +23 -1
  119. data/lib/stripe/resources/source_transaction.rb +3 -0
  120. data/lib/stripe/resources/subscription.rb +81 -13
  121. data/lib/stripe/resources/subscription_item.rb +54 -1
  122. data/lib/stripe/resources/subscription_schedule.rb +41 -4
  123. data/lib/stripe/resources/tax/calculation.rb +15 -0
  124. data/lib/stripe/resources/tax/calculation_line_item.rb +3 -0
  125. data/lib/stripe/resources/tax/registration.rb +35 -0
  126. data/lib/stripe/resources/tax/settings.rb +4 -2
  127. data/lib/stripe/resources/tax/transaction.rb +15 -8
  128. data/lib/stripe/resources/tax/transaction_line_item.rb +3 -0
  129. data/lib/stripe/resources/tax_code.rb +8 -0
  130. data/lib/stripe/resources/tax_id.rb +30 -12
  131. data/lib/stripe/resources/tax_rate.rb +23 -0
  132. data/lib/stripe/resources/terminal/configuration.rb +53 -0
  133. data/lib/stripe/resources/terminal/connection_token.rb +13 -0
  134. data/lib/stripe/resources/terminal/location.rb +54 -0
  135. data/lib/stripe/resources/terminal/reader.rb +80 -12
  136. data/lib/stripe/resources/test_helpers/test_clock.rb +45 -0
  137. data/lib/stripe/resources/token.rb +10 -1
  138. data/lib/stripe/resources/topup.rb +25 -0
  139. data/lib/stripe/resources/transfer.rb +26 -1
  140. data/lib/stripe/resources/treasury/credit_reversal.rb +23 -0
  141. data/lib/stripe/resources/treasury/debit_reversal.rb +23 -0
  142. data/lib/stripe/resources/treasury/financial_account.rb +42 -5
  143. data/lib/stripe/resources/treasury/financial_account_features.rb +3 -0
  144. data/lib/stripe/resources/treasury/inbound_transfer.rb +47 -11
  145. data/lib/stripe/resources/treasury/outbound_payment.rb +64 -8
  146. data/lib/stripe/resources/treasury/outbound_transfer.rb +64 -8
  147. data/lib/stripe/resources/treasury/received_credit.rb +17 -0
  148. data/lib/stripe/resources/treasury/received_debit.rb +17 -0
  149. data/lib/stripe/resources/treasury/transaction.rb +13 -0
  150. data/lib/stripe/resources/treasury/transaction_entry.rb +13 -0
  151. data/lib/stripe/resources/usage_record.rb +5 -0
  152. data/lib/stripe/resources/usage_record_summary.rb +3 -0
  153. data/lib/stripe/resources/webhook_endpoint.rb +55 -2
  154. data/lib/stripe/resources.rb +18 -0
  155. data/lib/stripe/search_result_object.rb +4 -1
  156. data/lib/stripe/singleton_api_resource.rb +20 -3
  157. data/lib/stripe/stripe_client.rb +61 -63
  158. data/lib/stripe/stripe_configuration.rb +13 -29
  159. data/lib/stripe/stripe_object.rb +23 -21
  160. data/lib/stripe/stripe_response.rb +1 -3
  161. data/lib/stripe/util.rb +13 -15
  162. data/lib/stripe/version.rb +1 -1
  163. data/lib/stripe.rb +26 -0
  164. data/stripe.gemspec +7 -4
  165. metadata +25 -5
@@ -1,132 +1,151 @@
1
- # File generated from our OpenAPI spec
2
1
  # frozen_string_literal: true
3
2
 
4
3
  # rubocop:disable Metrics/MethodLength
4
+ # rubocop:disable Metrics/AbcSize
5
5
 
6
6
  module Stripe
7
7
  module ObjectTypes
8
8
  def self.object_names_to_classes
9
9
  {
10
10
  # data structures
11
- ListObject::OBJECT_NAME => ListObject,
12
- SearchResultObject::OBJECT_NAME => SearchResultObject,
11
+ ListObject.object_name => ListObject,
12
+ SearchResultObject.object_name => SearchResultObject,
13
+ File.object_name_alt => File,
13
14
 
14
- # business objects
15
- Account::OBJECT_NAME => Account,
16
- AccountLink::OBJECT_NAME => AccountLink,
17
- AccountSession::OBJECT_NAME => AccountSession,
18
- ApplePayDomain::OBJECT_NAME => ApplePayDomain,
19
- ApplicationFee::OBJECT_NAME => ApplicationFee,
20
- ApplicationFeeRefund::OBJECT_NAME => ApplicationFeeRefund,
21
- Apps::Secret::OBJECT_NAME => Apps::Secret,
22
- Balance::OBJECT_NAME => Balance,
23
- BalanceTransaction::OBJECT_NAME => BalanceTransaction,
24
- BankAccount::OBJECT_NAME => BankAccount,
25
- BillingPortal::Configuration::OBJECT_NAME => BillingPortal::Configuration,
26
- BillingPortal::Session::OBJECT_NAME => BillingPortal::Session,
27
- Capability::OBJECT_NAME => Capability,
28
- Card::OBJECT_NAME => Card,
29
- CashBalance::OBJECT_NAME => CashBalance,
30
- Charge::OBJECT_NAME => Charge,
31
- Checkout::Session::OBJECT_NAME => Checkout::Session,
32
- CountrySpec::OBJECT_NAME => CountrySpec,
33
- Coupon::OBJECT_NAME => Coupon,
34
- CreditNote::OBJECT_NAME => CreditNote,
35
- CreditNoteLineItem::OBJECT_NAME => CreditNoteLineItem,
36
- Customer::OBJECT_NAME => Customer,
37
- CustomerBalanceTransaction::OBJECT_NAME => CustomerBalanceTransaction,
38
- CustomerCashBalanceTransaction::OBJECT_NAME => CustomerCashBalanceTransaction,
39
- Discount::OBJECT_NAME => Discount,
40
- Dispute::OBJECT_NAME => Dispute,
41
- EphemeralKey::OBJECT_NAME => EphemeralKey,
42
- Event::OBJECT_NAME => Event,
43
- ExchangeRate::OBJECT_NAME => ExchangeRate,
44
- File::OBJECT_NAME => File,
45
- File::OBJECT_NAME_ALT => File,
46
- FileLink::OBJECT_NAME => FileLink,
47
- FinancialConnections::Account::OBJECT_NAME => FinancialConnections::Account,
48
- FinancialConnections::AccountOwner::OBJECT_NAME => FinancialConnections::AccountOwner,
49
- FinancialConnections::AccountOwnership::OBJECT_NAME =>
50
- FinancialConnections::AccountOwnership,
51
- FinancialConnections::Session::OBJECT_NAME => FinancialConnections::Session,
52
- FundingInstructions::OBJECT_NAME => FundingInstructions,
53
- Identity::VerificationReport::OBJECT_NAME => Identity::VerificationReport,
54
- Identity::VerificationSession::OBJECT_NAME => Identity::VerificationSession,
55
- Invoice::OBJECT_NAME => Invoice,
56
- InvoiceItem::OBJECT_NAME => InvoiceItem,
57
- InvoiceLineItem::OBJECT_NAME => InvoiceLineItem,
58
- Issuing::Authorization::OBJECT_NAME => Issuing::Authorization,
59
- Issuing::Card::OBJECT_NAME => Issuing::Card,
60
- Issuing::Cardholder::OBJECT_NAME => Issuing::Cardholder,
61
- Issuing::Dispute::OBJECT_NAME => Issuing::Dispute,
62
- Issuing::Token::OBJECT_NAME => Issuing::Token,
63
- Issuing::Transaction::OBJECT_NAME => Issuing::Transaction,
64
- LineItem::OBJECT_NAME => LineItem,
65
- LoginLink::OBJECT_NAME => LoginLink,
66
- Mandate::OBJECT_NAME => Mandate,
67
- PaymentIntent::OBJECT_NAME => PaymentIntent,
68
- PaymentLink::OBJECT_NAME => PaymentLink,
69
- PaymentMethod::OBJECT_NAME => PaymentMethod,
70
- PaymentMethodConfiguration::OBJECT_NAME => PaymentMethodConfiguration,
71
- PaymentMethodDomain::OBJECT_NAME => PaymentMethodDomain,
72
- Payout::OBJECT_NAME => Payout,
73
- Person::OBJECT_NAME => Person,
74
- Plan::OBJECT_NAME => Plan,
75
- Price::OBJECT_NAME => Price,
76
- Product::OBJECT_NAME => Product,
77
- PromotionCode::OBJECT_NAME => PromotionCode,
78
- Quote::OBJECT_NAME => Quote,
79
- Radar::EarlyFraudWarning::OBJECT_NAME => Radar::EarlyFraudWarning,
80
- Radar::ValueList::OBJECT_NAME => Radar::ValueList,
81
- Radar::ValueListItem::OBJECT_NAME => Radar::ValueListItem,
82
- Refund::OBJECT_NAME => Refund,
83
- Reporting::ReportRun::OBJECT_NAME => Reporting::ReportRun,
84
- Reporting::ReportType::OBJECT_NAME => Reporting::ReportType,
85
- Reversal::OBJECT_NAME => Reversal,
86
- Review::OBJECT_NAME => Review,
87
- SetupAttempt::OBJECT_NAME => SetupAttempt,
88
- SetupIntent::OBJECT_NAME => SetupIntent,
89
- ShippingRate::OBJECT_NAME => ShippingRate,
90
- Sigma::ScheduledQueryRun::OBJECT_NAME => Sigma::ScheduledQueryRun,
91
- Source::OBJECT_NAME => Source,
92
- SourceTransaction::OBJECT_NAME => SourceTransaction,
93
- Subscription::OBJECT_NAME => Subscription,
94
- SubscriptionItem::OBJECT_NAME => SubscriptionItem,
95
- SubscriptionSchedule::OBJECT_NAME => SubscriptionSchedule,
96
- Tax::Calculation::OBJECT_NAME => Tax::Calculation,
97
- Tax::CalculationLineItem::OBJECT_NAME => Tax::CalculationLineItem,
98
- Tax::Registration::OBJECT_NAME => Tax::Registration,
99
- Tax::Settings::OBJECT_NAME => Tax::Settings,
100
- Tax::Transaction::OBJECT_NAME => Tax::Transaction,
101
- Tax::TransactionLineItem::OBJECT_NAME => Tax::TransactionLineItem,
102
- TaxCode::OBJECT_NAME => TaxCode,
103
- TaxId::OBJECT_NAME => TaxId,
104
- TaxRate::OBJECT_NAME => TaxRate,
105
- Terminal::Configuration::OBJECT_NAME => Terminal::Configuration,
106
- Terminal::ConnectionToken::OBJECT_NAME => Terminal::ConnectionToken,
107
- Terminal::Location::OBJECT_NAME => Terminal::Location,
108
- Terminal::Reader::OBJECT_NAME => Terminal::Reader,
109
- TestHelpers::TestClock::OBJECT_NAME => TestHelpers::TestClock,
110
- Token::OBJECT_NAME => Token,
111
- Topup::OBJECT_NAME => Topup,
112
- Transfer::OBJECT_NAME => Transfer,
113
- Treasury::CreditReversal::OBJECT_NAME => Treasury::CreditReversal,
114
- Treasury::DebitReversal::OBJECT_NAME => Treasury::DebitReversal,
115
- Treasury::FinancialAccount::OBJECT_NAME => Treasury::FinancialAccount,
116
- Treasury::FinancialAccountFeatures::OBJECT_NAME => Treasury::FinancialAccountFeatures,
117
- Treasury::InboundTransfer::OBJECT_NAME => Treasury::InboundTransfer,
118
- Treasury::OutboundPayment::OBJECT_NAME => Treasury::OutboundPayment,
119
- Treasury::OutboundTransfer::OBJECT_NAME => Treasury::OutboundTransfer,
120
- Treasury::ReceivedCredit::OBJECT_NAME => Treasury::ReceivedCredit,
121
- Treasury::ReceivedDebit::OBJECT_NAME => Treasury::ReceivedDebit,
122
- Treasury::Transaction::OBJECT_NAME => Treasury::Transaction,
123
- Treasury::TransactionEntry::OBJECT_NAME => Treasury::TransactionEntry,
124
- UsageRecord::OBJECT_NAME => UsageRecord,
125
- UsageRecordSummary::OBJECT_NAME => UsageRecordSummary,
126
- WebhookEndpoint::OBJECT_NAME => WebhookEndpoint,
15
+ # object classes: The beginning of the section generated from our OpenAPI spec
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
+ Billing::Alert.object_name => Billing::Alert,
27
+ Billing::Meter.object_name => Billing::Meter,
28
+ Billing::MeterEvent.object_name => Billing::MeterEvent,
29
+ Billing::MeterEventAdjustment.object_name => Billing::MeterEventAdjustment,
30
+ Billing::MeterEventSummary.object_name => Billing::MeterEventSummary,
31
+ BillingPortal::Configuration.object_name => BillingPortal::Configuration,
32
+ BillingPortal::Session.object_name => BillingPortal::Session,
33
+ Capability.object_name => Capability,
34
+ Card.object_name => Card,
35
+ CashBalance.object_name => CashBalance,
36
+ Charge.object_name => Charge,
37
+ Checkout::Session.object_name => Checkout::Session,
38
+ Climate::Order.object_name => Climate::Order,
39
+ Climate::Product.object_name => Climate::Product,
40
+ Climate::Supplier.object_name => Climate::Supplier,
41
+ ConfirmationToken.object_name => ConfirmationToken,
42
+ CountrySpec.object_name => CountrySpec,
43
+ Coupon.object_name => Coupon,
44
+ CreditNote.object_name => CreditNote,
45
+ CreditNoteLineItem.object_name => CreditNoteLineItem,
46
+ Customer.object_name => Customer,
47
+ CustomerBalanceTransaction.object_name => CustomerBalanceTransaction,
48
+ CustomerCashBalanceTransaction.object_name => CustomerCashBalanceTransaction,
49
+ CustomerSession.object_name => CustomerSession,
50
+ Discount.object_name => Discount,
51
+ Dispute.object_name => Dispute,
52
+ Entitlements::ActiveEntitlement.object_name => Entitlements::ActiveEntitlement,
53
+ Entitlements::Feature.object_name => Entitlements::Feature,
54
+ EphemeralKey.object_name => EphemeralKey,
55
+ Event.object_name => Event,
56
+ ExchangeRate.object_name => ExchangeRate,
57
+ File.object_name => File,
58
+ FileLink.object_name => FileLink,
59
+ FinancialConnections::Account.object_name => FinancialConnections::Account,
60
+ FinancialConnections::AccountOwner.object_name => FinancialConnections::AccountOwner,
61
+ FinancialConnections::AccountOwnership.object_name => FinancialConnections::AccountOwnership,
62
+ FinancialConnections::Session.object_name => FinancialConnections::Session,
63
+ FinancialConnections::Transaction.object_name => FinancialConnections::Transaction,
64
+ Forwarding::Request.object_name => Forwarding::Request,
65
+ FundingInstructions.object_name => FundingInstructions,
66
+ Identity::VerificationReport.object_name => Identity::VerificationReport,
67
+ Identity::VerificationSession.object_name => Identity::VerificationSession,
68
+ Invoice.object_name => Invoice,
69
+ InvoiceItem.object_name => InvoiceItem,
70
+ InvoiceLineItem.object_name => InvoiceLineItem,
71
+ InvoiceRenderingTemplate.object_name => InvoiceRenderingTemplate,
72
+ Issuing::Authorization.object_name => Issuing::Authorization,
73
+ Issuing::Card.object_name => Issuing::Card,
74
+ Issuing::Cardholder.object_name => Issuing::Cardholder,
75
+ Issuing::Dispute.object_name => Issuing::Dispute,
76
+ Issuing::PersonalizationDesign.object_name => Issuing::PersonalizationDesign,
77
+ Issuing::PhysicalBundle.object_name => Issuing::PhysicalBundle,
78
+ Issuing::Token.object_name => Issuing::Token,
79
+ Issuing::Transaction.object_name => Issuing::Transaction,
80
+ LineItem.object_name => LineItem,
81
+ LoginLink.object_name => LoginLink,
82
+ Mandate.object_name => Mandate,
83
+ PaymentIntent.object_name => PaymentIntent,
84
+ PaymentLink.object_name => PaymentLink,
85
+ PaymentMethod.object_name => PaymentMethod,
86
+ PaymentMethodConfiguration.object_name => PaymentMethodConfiguration,
87
+ PaymentMethodDomain.object_name => PaymentMethodDomain,
88
+ Payout.object_name => Payout,
89
+ Person.object_name => Person,
90
+ Plan.object_name => Plan,
91
+ Price.object_name => Price,
92
+ Product.object_name => Product,
93
+ ProductFeature.object_name => ProductFeature,
94
+ PromotionCode.object_name => PromotionCode,
95
+ Quote.object_name => Quote,
96
+ Radar::EarlyFraudWarning.object_name => Radar::EarlyFraudWarning,
97
+ Radar::ValueList.object_name => Radar::ValueList,
98
+ Radar::ValueListItem.object_name => Radar::ValueListItem,
99
+ Refund.object_name => Refund,
100
+ Reporting::ReportRun.object_name => Reporting::ReportRun,
101
+ Reporting::ReportType.object_name => Reporting::ReportType,
102
+ Reversal.object_name => Reversal,
103
+ Review.object_name => Review,
104
+ SetupAttempt.object_name => SetupAttempt,
105
+ SetupIntent.object_name => SetupIntent,
106
+ ShippingRate.object_name => ShippingRate,
107
+ Sigma::ScheduledQueryRun.object_name => Sigma::ScheduledQueryRun,
108
+ Source.object_name => Source,
109
+ SourceTransaction.object_name => SourceTransaction,
110
+ Subscription.object_name => Subscription,
111
+ SubscriptionItem.object_name => SubscriptionItem,
112
+ SubscriptionSchedule.object_name => SubscriptionSchedule,
113
+ Tax::Calculation.object_name => Tax::Calculation,
114
+ Tax::CalculationLineItem.object_name => Tax::CalculationLineItem,
115
+ Tax::Registration.object_name => Tax::Registration,
116
+ Tax::Settings.object_name => Tax::Settings,
117
+ Tax::Transaction.object_name => Tax::Transaction,
118
+ Tax::TransactionLineItem.object_name => Tax::TransactionLineItem,
119
+ TaxCode.object_name => TaxCode,
120
+ TaxId.object_name => TaxId,
121
+ TaxRate.object_name => TaxRate,
122
+ Terminal::Configuration.object_name => Terminal::Configuration,
123
+ Terminal::ConnectionToken.object_name => Terminal::ConnectionToken,
124
+ Terminal::Location.object_name => Terminal::Location,
125
+ Terminal::Reader.object_name => Terminal::Reader,
126
+ TestHelpers::TestClock.object_name => TestHelpers::TestClock,
127
+ Token.object_name => Token,
128
+ Topup.object_name => Topup,
129
+ Transfer.object_name => Transfer,
130
+ Treasury::CreditReversal.object_name => Treasury::CreditReversal,
131
+ Treasury::DebitReversal.object_name => Treasury::DebitReversal,
132
+ Treasury::FinancialAccount.object_name => Treasury::FinancialAccount,
133
+ Treasury::FinancialAccountFeatures.object_name => Treasury::FinancialAccountFeatures,
134
+ Treasury::InboundTransfer.object_name => Treasury::InboundTransfer,
135
+ Treasury::OutboundPayment.object_name => Treasury::OutboundPayment,
136
+ Treasury::OutboundTransfer.object_name => Treasury::OutboundTransfer,
137
+ Treasury::ReceivedCredit.object_name => Treasury::ReceivedCredit,
138
+ Treasury::ReceivedDebit.object_name => Treasury::ReceivedDebit,
139
+ Treasury::Transaction.object_name => Treasury::Transaction,
140
+ Treasury::TransactionEntry.object_name => Treasury::TransactionEntry,
141
+ UsageRecord.object_name => UsageRecord,
142
+ UsageRecordSummary.object_name => UsageRecordSummary,
143
+ WebhookEndpoint.object_name => WebhookEndpoint,
144
+ # object classes: The end of the section generated from our OpenAPI spec
127
145
  }
128
146
  end
129
147
  end
130
148
  end
131
149
 
150
+ # rubocop:enable Metrics/AbcSize
132
151
  # rubocop:enable Metrics/MethodLength
@@ -6,25 +6,82 @@ module Stripe
6
6
  # properties on the account like its current requirements or if the account is
7
7
  # enabled to make live charges or receive payouts.
8
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).
9
+ # For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection)
10
+ # is `application`, which includes Custom accounts, the properties below are always
11
+ # returned.
12
+ #
13
+ # For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection)
14
+ # is `stripe`, which includes Standard and Express accounts, some properties are only returned
15
+ # until you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions)
16
+ # to start Connect Onboarding. Learn about the [differences between accounts](https://stripe.com/connect/accounts).
13
17
  class Account < APIResource
14
- extend Gem::Deprecate
15
18
  extend Stripe::APIOperations::Create
16
19
  include Stripe::APIOperations::Delete
17
20
  extend Stripe::APIOperations::List
18
- include Stripe::APIOperations::Save
19
21
  extend Stripe::APIOperations::NestedResource
22
+ include Stripe::APIOperations::Save
20
23
 
21
24
  OBJECT_NAME = "account"
25
+ def self.object_name
26
+ "account"
27
+ end
22
28
 
23
29
  nested_resource_class_methods :capability,
24
30
  operations: %i[retrieve update list],
25
31
  resource_plural: "capabilities"
32
+ nested_resource_class_methods :external_account,
33
+ operations: %i[create retrieve update delete list]
34
+ nested_resource_class_methods :login_link, operations: %i[create]
26
35
  nested_resource_class_methods :person, operations: %i[create retrieve update delete list]
27
36
 
37
+ # With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users.
38
+ # To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings).
39
+ #
40
+ # If you've already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when
41
+ # creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding.
42
+ # You can prefill any information on the account.
43
+ def self.create(params = {}, opts = {})
44
+ request_stripe_object(method: :post, path: "/v1/accounts", params: params, opts: opts)
45
+ end
46
+
47
+ # With [Connect](https://stripe.com/connect), you can delete accounts you manage.
48
+ #
49
+ # Test-mode accounts can be deleted at any time.
50
+ #
51
+ # Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balance_object) are zero.
52
+ #
53
+ # If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead.
54
+ def self.delete(id, params = {}, opts = {})
55
+ request_stripe_object(
56
+ method: :delete,
57
+ path: format("/v1/accounts/%<id>s", { id: CGI.escape(id) }),
58
+ params: params,
59
+ opts: opts
60
+ )
61
+ end
62
+
63
+ # With [Connect](https://stripe.com/connect), you can delete accounts you manage.
64
+ #
65
+ # Test-mode accounts can be deleted at any time.
66
+ #
67
+ # Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balance_object) are zero.
68
+ #
69
+ # If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead.
70
+ def delete(params = {}, opts = {})
71
+ request_stripe_object(
72
+ method: :delete,
73
+ path: format("/v1/accounts/%<account>s", { account: CGI.escape(self["id"]) }),
74
+ params: params,
75
+ opts: opts
76
+ )
77
+ end
78
+
79
+ # Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty.
80
+ def self.list(filters = {}, opts = {})
81
+ request_stripe_object(method: :get, path: "/v1/accounts", params: filters, opts: opts)
82
+ end
83
+
84
+ # 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.
28
85
  def persons(params = {}, opts = {})
29
86
  request_stripe_object(
30
87
  method: :get,
@@ -34,6 +91,19 @@ module Stripe
34
91
  )
35
92
  end
36
93
 
94
+ # 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.
95
+ def self.persons(account, params = {}, opts = {})
96
+ request_stripe_object(
97
+ method: :get,
98
+ path: format("/v1/accounts/%<account>s/persons", { account: CGI.escape(account) }),
99
+ params: params,
100
+ opts: opts
101
+ )
102
+ end
103
+
104
+ # With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious.
105
+ #
106
+ # Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero.
37
107
  def reject(params = {}, opts = {})
38
108
  request_stripe_object(
39
109
  method: :post,
@@ -43,19 +113,35 @@ module Stripe
43
113
  )
44
114
  end
45
115
 
46
- def self.persons(account, params = {}, opts = {})
116
+ # With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious.
117
+ #
118
+ # Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero.
119
+ def self.reject(account, params = {}, opts = {})
47
120
  request_stripe_object(
48
- method: :get,
49
- path: format("/v1/accounts/%<account>s/persons", { account: CGI.escape(account) }),
121
+ method: :post,
122
+ path: format("/v1/accounts/%<account>s/reject", { account: CGI.escape(account) }),
50
123
  params: params,
51
124
  opts: opts
52
125
  )
53
126
  end
54
127
 
55
- def self.reject(account, params = {}, opts = {})
128
+ # Updates a [connected account](https://stripe.com/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are
129
+ # left unchanged.
130
+ #
131
+ # For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection)
132
+ # is application, which includes Custom accounts, you can update any information on the account.
133
+ #
134
+ # For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection)
135
+ # is stripe, which includes Standard and Express accounts, you can update all information until you create
136
+ # an [Account Link or <a href="/api/account_sessions">Account Session](https://stripe.com/api/account_links) to start Connect onboarding,
137
+ # after which some properties can no longer be updated.
138
+ #
139
+ # To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). Refer to our
140
+ # [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts.
141
+ def self.update(id, params = {}, opts = {})
56
142
  request_stripe_object(
57
143
  method: :post,
58
- path: format("/v1/accounts/%<account>s/reject", { account: CGI.escape(account) }),
144
+ path: format("/v1/accounts/%<id>s", { id: CGI.escape(id) }),
59
145
  params: params,
60
146
  opts: opts
61
147
  )
@@ -63,10 +149,6 @@ module Stripe
63
149
 
64
150
  save_nested_resource :external_account
65
151
 
66
- nested_resource_class_methods :external_account,
67
- operations: %i[create retrieve update delete list]
68
- nested_resource_class_methods :login_link, operations: %i[create]
69
-
70
152
  def resource_url
71
153
  if self["id"]
72
154
  super
@@ -123,17 +205,13 @@ module Stripe
123
205
  end
124
206
 
125
207
  def serialize_params_account(_obj, update_hash, options = {})
126
- if (entity = @values[:legal_entity])
127
- if (owners = entity[:additional_owners])
128
- entity_update = update_hash[:legal_entity] ||= {}
129
- entity_update[:additional_owners] =
130
- serialize_additional_owners(entity, owners)
131
- end
208
+ if (entity = @values[:legal_entity]) && (owners = entity[:additional_owners])
209
+ entity_update = update_hash[:legal_entity] ||= {}
210
+ entity_update[:additional_owners] =
211
+ serialize_additional_owners(entity, owners)
132
212
  end
133
- if (individual = @values[:individual])
134
- if individual.is_a?(Person) && !update_hash.key?(:individual)
135
- update_hash[:individual] = individual.serialize_params(options)
136
- end
213
+ if (individual = @values[:individual]) && (individual.is_a?(Person) && !update_hash.key?(:individual))
214
+ update_hash[:individual] = individual.serialize_params(options)
137
215
  end
138
216
  update_hash
139
217
  end
@@ -10,5 +10,13 @@ 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
16
+
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.
18
+ def self.create(params = {}, opts = {})
19
+ request_stripe_object(method: :post, path: "/v1/account_links", params: params, opts: opts)
20
+ end
13
21
  end
14
22
  end
@@ -13,5 +13,13 @@ 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
19
+
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.
21
+ def self.create(params = {}, opts = {})
22
+ request_stripe_object(method: :post, path: "/v1/account_sessions", params: params, opts: opts)
23
+ end
16
24
  end
17
25
  end
@@ -14,7 +14,7 @@ module Stripe
14
14
  end
15
15
 
16
16
  "#{Customer.resource_url}/#{CGI.escape(customer)}/sources" \
17
- "/#{CGI.escape(id)}"
17
+ "/#{CGI.escape(id)}"
18
18
  end
19
19
 
20
20
  def self.update(_id, _params = nil, _opts = nil)
@@ -9,6 +9,49 @@ 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
15
+
16
+ # Create an apple pay domain.
17
+ def self.create(params = {}, opts = {})
18
+ request_stripe_object(
19
+ method: :post,
20
+ path: "/v1/apple_pay/domains",
21
+ params: params,
22
+ opts: opts
23
+ )
24
+ end
25
+
26
+ # Delete an apple pay domain.
27
+ def self.delete(id, params = {}, opts = {})
28
+ request_stripe_object(
29
+ method: :delete,
30
+ path: format("/v1/apple_pay/domains/%<id>s", { id: CGI.escape(id) }),
31
+ params: params,
32
+ opts: opts
33
+ )
34
+ end
35
+
36
+ # Delete an apple pay domain.
37
+ def delete(params = {}, opts = {})
38
+ request_stripe_object(
39
+ method: :delete,
40
+ path: format("/v1/apple_pay/domains/%<domain>s", { domain: CGI.escape(self["id"]) }),
41
+ params: params,
42
+ opts: opts
43
+ )
44
+ end
45
+
46
+ # List apple pay domains.
47
+ def self.list(filters = {}, opts = {})
48
+ request_stripe_object(
49
+ method: :get,
50
+ path: "/v1/apple_pay/domains",
51
+ params: filters,
52
+ opts: opts
53
+ )
54
+ end
12
55
 
13
56
  def self.resource_url
14
57
  "/v1/apple_pay/domains"
@@ -7,7 +7,15 @@ 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]
15
+
16
+ # Returns a list of application fees you've previously collected. The application fees are returned in sorted order, with the most recent fees appearing first.
17
+ def self.list(filters = {}, opts = {})
18
+ request_stripe_object(method: :get, path: "/v1/application_fees", params: filters, opts: opts)
19
+ end
12
20
  end
13
21
  end
@@ -8,14 +8,16 @@ module Stripe
8
8
  #
9
9
  # Related guide: [Refunding application fees](https://stripe.com/docs/connect/destination-charges#refunding-app-fee)
10
10
  class ApplicationFeeRefund < APIResource
11
- extend Stripe::APIOperations::List
12
11
  include Stripe::APIOperations::Save
13
12
 
14
13
  OBJECT_NAME = "fee_refund"
14
+ def self.object_name
15
+ "fee_refund"
16
+ end
15
17
 
16
18
  def resource_url
17
19
  "#{ApplicationFee.resource_url}/#{CGI.escape(fee)}/refunds" \
18
- "/#{CGI.escape(id)}"
20
+ "/#{CGI.escape(id)}"
19
21
  end
20
22
 
21
23
  def self.update(_id, _params = nil, _opts = nil)
@@ -17,7 +17,16 @@ 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
23
+
24
+ # Create or replace a secret in the secret store.
25
+ def self.create(params = {}, opts = {})
26
+ request_stripe_object(method: :post, path: "/v1/apps/secrets", params: params, opts: opts)
27
+ end
20
28
 
29
+ # Deletes a secret from the secret store by name and scope.
21
30
  def self.delete_where(params = {}, opts = {})
22
31
  request_stripe_object(
23
32
  method: :post,
@@ -27,6 +36,7 @@ module Stripe
27
36
  )
28
37
  end
29
38
 
39
+ # Finds a secret in the secret store by name and scope.
30
40
  def self.find(params = {}, opts = {})
31
41
  request_stripe_object(
32
42
  method: :get,
@@ -35,6 +45,11 @@ module Stripe
35
45
  opts: opts
36
46
  )
37
47
  end
48
+
49
+ # List all secrets stored on the given scope.
50
+ def self.list(filters = {}, opts = {})
51
+ request_stripe_object(method: :get, path: "/v1/apps/secrets", params: filters, opts: opts)
52
+ end
38
53
  end
39
54
  end
40
55
  end
@@ -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