stripe 10.1.0 → 12.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +215 -21
- data/Gemfile +6 -5
- data/Makefile +8 -1
- data/OPENAPI_VERSION +1 -1
- data/README.md +46 -14
- data/Rakefile +7 -5
- data/VERSION +1 -1
- data/{bin → exe}/stripe-console +1 -1
- data/lib/stripe/api_operations/nested_resource.rb +22 -2
- data/lib/stripe/api_operations/request.rb +22 -18
- data/lib/stripe/api_operations/save.rb +7 -9
- data/lib/stripe/api_operations/search.rb +5 -0
- data/lib/stripe/api_operations/singleton_save.rb +86 -0
- data/lib/stripe/api_resource.rb +13 -4
- data/lib/stripe/api_resource_test_helpers.rb +7 -3
- data/lib/stripe/api_version.rb +1 -1
- data/lib/stripe/connection_manager.rb +4 -6
- data/lib/stripe/errors.rb +3 -11
- data/lib/stripe/instrumentation.rb +5 -21
- data/lib/stripe/list_object.rb +3 -0
- data/lib/stripe/multipart_encoder.rb +7 -7
- data/lib/stripe/oauth.rb +6 -6
- data/lib/stripe/object_types.rb +135 -116
- data/lib/stripe/resources/account.rb +103 -25
- data/lib/stripe/resources/account_link.rb +8 -0
- data/lib/stripe/resources/account_session.rb +8 -0
- data/lib/stripe/resources/alipay_account.rb +1 -1
- data/lib/stripe/resources/apple_pay_domain.rb +43 -0
- data/lib/stripe/resources/application_fee.rb +8 -0
- data/lib/stripe/resources/application_fee_refund.rb +4 -2
- data/lib/stripe/resources/apps/secret.rb +15 -0
- data/lib/stripe/resources/balance.rb +3 -0
- data/lib/stripe/resources/balance_transaction.rb +15 -0
- data/lib/stripe/resources/bank_account.rb +49 -7
- data/lib/stripe/resources/billing/alert.rb +87 -0
- data/lib/stripe/resources/billing/meter.rb +83 -0
- data/lib/stripe/resources/billing/meter_event.rb +27 -0
- data/lib/stripe/resources/billing/meter_event_adjustment.rb +26 -0
- data/lib/stripe/resources/billing/meter_event_summary.rb +15 -0
- data/lib/stripe/resources/billing_portal/configuration.rb +33 -0
- data/lib/stripe/resources/billing_portal/session.rb +14 -1
- data/lib/stripe/resources/capability.rb +4 -2
- data/lib/stripe/resources/card.rb +28 -0
- data/lib/stripe/resources/cash_balance.rb +3 -0
- data/lib/stripe/resources/charge.rb +39 -1
- data/lib/stripe/resources/checkout/session.rb +47 -5
- data/lib/stripe/resources/climate/order.rb +67 -0
- data/lib/stripe/resources/climate/product.rb +27 -0
- data/lib/stripe/resources/climate/supplier.rb +26 -0
- data/lib/stripe/resources/confirmation_token.rb +39 -0
- data/lib/stripe/resources/country_spec.rb +8 -0
- data/lib/stripe/resources/coupon.rb +45 -0
- data/lib/stripe/resources/credit_note.rb +47 -7
- data/lib/stripe/resources/credit_note_line_item.rb +3 -0
- data/lib/stripe/resources/customer.rb +89 -26
- data/lib/stripe/resources/customer_balance_transaction.rb +3 -1
- data/lib/stripe/resources/customer_cash_balance_transaction.rb +3 -2
- data/lib/stripe/resources/customer_session.rb +29 -0
- data/lib/stripe/resources/discount.rb +3 -0
- data/lib/stripe/resources/dispute.rb +26 -0
- data/lib/stripe/resources/entitlements/active_entitlement.rb +26 -0
- data/lib/stripe/resources/entitlements/feature.rb +49 -0
- data/lib/stripe/resources/ephemeral_key.rb +23 -0
- data/lib/stripe/resources/event.rb +11 -3
- data/lib/stripe/resources/exchange_rate.rb +8 -0
- data/lib/stripe/resources/file.rb +29 -16
- data/lib/stripe/resources/file_link.rb +23 -0
- data/lib/stripe/resources/financial_connections/account.rb +66 -7
- data/lib/stripe/resources/financial_connections/account_owner.rb +3 -0
- data/lib/stripe/resources/financial_connections/account_ownership.rb +3 -0
- data/lib/stripe/resources/financial_connections/session.rb +13 -0
- data/lib/stripe/resources/financial_connections/transaction.rb +26 -0
- data/lib/stripe/resources/forwarding/request.rb +52 -0
- data/lib/stripe/resources/funding_instructions.rb +3 -0
- data/lib/stripe/resources/identity/verification_report.rb +14 -1
- data/lib/stripe/resources/identity/verification_session.rb +90 -4
- data/lib/stripe/resources/invoice.rb +170 -17
- data/lib/stripe/resources/invoice_item.rb +43 -0
- data/lib/stripe/resources/invoice_line_item.rb +21 -0
- data/lib/stripe/resources/invoice_rendering_template.rb +63 -0
- data/lib/stripe/resources/issuing/authorization.rb +88 -14
- data/lib/stripe/resources/issuing/card.rb +50 -16
- data/lib/stripe/resources/issuing/cardholder.rb +33 -0
- data/lib/stripe/resources/issuing/dispute.rb +35 -0
- data/lib/stripe/resources/issuing/personalization_design.rb +119 -0
- data/lib/stripe/resources/issuing/physical_bundle.rb +26 -0
- data/lib/stripe/resources/issuing/token.rb +18 -0
- data/lib/stripe/resources/issuing/transaction.rb +30 -0
- data/lib/stripe/resources/line_item.rb +3 -0
- data/lib/stripe/resources/login_link.rb +4 -1
- data/lib/stripe/resources/mandate.rb +3 -0
- data/lib/stripe/resources/payment_intent.rb +190 -25
- data/lib/stripe/resources/payment_link.rb +25 -0
- data/lib/stripe/resources/payment_method.rb +57 -4
- data/lib/stripe/resources/payment_method_configuration.rb +33 -0
- data/lib/stripe/resources/payment_method_domain.rb +46 -1
- data/lib/stripe/resources/payout.rb +39 -4
- data/lib/stripe/resources/person.rb +5 -4
- data/lib/stripe/resources/plan.rb +43 -0
- data/lib/stripe/resources/price.rb +24 -1
- data/lib/stripe/resources/product.rb +47 -1
- data/lib/stripe/resources/product_feature.rb +13 -0
- data/lib/stripe/resources/promotion_code.rb +23 -0
- data/lib/stripe/resources/quote.rb +67 -32
- data/lib/stripe/resources/radar/early_fraud_warning.rb +13 -0
- data/lib/stripe/resources/radar/value_list.rb +53 -0
- data/lib/stripe/resources/radar/value_list_item.rb +43 -0
- data/lib/stripe/resources/refund.rb +46 -0
- data/lib/stripe/resources/reporting/report_run.rb +23 -0
- data/lib/stripe/resources/reporting/report_type.rb +13 -0
- data/lib/stripe/resources/reversal.rb +5 -3
- data/lib/stripe/resources/review.rb +10 -0
- data/lib/stripe/resources/setup_attempt.rb +8 -0
- data/lib/stripe/resources/setup_intent.rb +72 -10
- data/lib/stripe/resources/shipping_rate.rb +23 -0
- data/lib/stripe/resources/sigma/scheduled_query_run.rb +13 -0
- data/lib/stripe/resources/source.rb +23 -1
- data/lib/stripe/resources/source_transaction.rb +3 -0
- data/lib/stripe/resources/subscription.rb +81 -13
- data/lib/stripe/resources/subscription_item.rb +54 -1
- data/lib/stripe/resources/subscription_schedule.rb +41 -4
- data/lib/stripe/resources/tax/calculation.rb +15 -0
- data/lib/stripe/resources/tax/calculation_line_item.rb +3 -0
- data/lib/stripe/resources/tax/registration.rb +35 -0
- data/lib/stripe/resources/tax/settings.rb +4 -2
- data/lib/stripe/resources/tax/transaction.rb +15 -8
- data/lib/stripe/resources/tax/transaction_line_item.rb +3 -0
- data/lib/stripe/resources/tax_code.rb +8 -0
- data/lib/stripe/resources/tax_id.rb +30 -12
- data/lib/stripe/resources/tax_rate.rb +23 -0
- data/lib/stripe/resources/terminal/configuration.rb +53 -0
- data/lib/stripe/resources/terminal/connection_token.rb +13 -0
- data/lib/stripe/resources/terminal/location.rb +54 -0
- data/lib/stripe/resources/terminal/reader.rb +80 -12
- data/lib/stripe/resources/test_helpers/test_clock.rb +45 -0
- data/lib/stripe/resources/token.rb +10 -1
- data/lib/stripe/resources/topup.rb +25 -0
- data/lib/stripe/resources/transfer.rb +26 -1
- data/lib/stripe/resources/treasury/credit_reversal.rb +23 -0
- data/lib/stripe/resources/treasury/debit_reversal.rb +23 -0
- data/lib/stripe/resources/treasury/financial_account.rb +42 -5
- data/lib/stripe/resources/treasury/financial_account_features.rb +3 -0
- data/lib/stripe/resources/treasury/inbound_transfer.rb +47 -11
- data/lib/stripe/resources/treasury/outbound_payment.rb +64 -8
- data/lib/stripe/resources/treasury/outbound_transfer.rb +64 -8
- data/lib/stripe/resources/treasury/received_credit.rb +17 -0
- data/lib/stripe/resources/treasury/received_debit.rb +17 -0
- data/lib/stripe/resources/treasury/transaction.rb +13 -0
- data/lib/stripe/resources/treasury/transaction_entry.rb +13 -0
- data/lib/stripe/resources/usage_record.rb +5 -0
- data/lib/stripe/resources/usage_record_summary.rb +3 -0
- data/lib/stripe/resources/webhook_endpoint.rb +55 -2
- data/lib/stripe/resources.rb +18 -0
- data/lib/stripe/search_result_object.rb +4 -1
- data/lib/stripe/singleton_api_resource.rb +20 -3
- data/lib/stripe/stripe_client.rb +61 -63
- data/lib/stripe/stripe_configuration.rb +13 -29
- data/lib/stripe/stripe_object.rb +23 -21
- data/lib/stripe/stripe_response.rb +1 -3
- data/lib/stripe/util.rb +13 -15
- data/lib/stripe/version.rb +1 -1
- data/lib/stripe.rb +26 -0
- data/stripe.gemspec +7 -4
- metadata +25 -5
data/lib/stripe/object_types.rb
CHANGED
@@ -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
|
12
|
-
SearchResultObject
|
11
|
+
ListObject.object_name => ListObject,
|
12
|
+
SearchResultObject.object_name => SearchResultObject,
|
13
|
+
File.object_name_alt => File,
|
13
14
|
|
14
|
-
#
|
15
|
-
Account
|
16
|
-
AccountLink
|
17
|
-
AccountSession
|
18
|
-
ApplePayDomain
|
19
|
-
ApplicationFee
|
20
|
-
ApplicationFeeRefund
|
21
|
-
Apps::Secret
|
22
|
-
Balance
|
23
|
-
BalanceTransaction
|
24
|
-
BankAccount
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
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
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
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
|
-
|
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: :
|
49
|
-
path: format("/v1/accounts/%<account>s/
|
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
|
-
|
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/%<
|
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
|
-
|
128
|
-
|
129
|
-
|
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
|
-
|
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
|
@@ -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
|
-
|
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
|