stripe 15.0.0 → 15.3.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/API_VERSION +1 -0
- data/CHANGELOG.md +129 -44
- data/CONTRIBUTING.md +25 -0
- data/Gemfile +1 -1
- data/OPENAPI_VERSION +1 -1
- data/README.md +28 -55
- data/VERSION +1 -1
- data/lib/stripe/api_operations/nested_resource.rb +35 -35
- data/lib/stripe/api_requestor.rb +1 -1
- data/lib/stripe/api_version.rb +2 -1
- data/lib/stripe/connection_manager.rb +1 -3
- data/lib/stripe/event_types.rb +1 -0
- data/lib/stripe/events/v1_billing_meter_error_report_triggered_event.rb +1 -1
- data/lib/stripe/events/v1_billing_meter_no_meter_found_event.rb +1 -1
- data/lib/stripe/events/v2_core_event_destination_ping_event.rb +21 -0
- data/lib/stripe/oauth.rb +1 -1
- data/lib/stripe/resources/account.rb +198 -28
- data/lib/stripe/resources/account_session.rb +176 -72
- data/lib/stripe/resources/apple_pay_domain.rb +1 -2
- data/lib/stripe/resources/balance.rb +42 -0
- data/lib/stripe/resources/balance_transaction.rb +2 -0
- data/lib/stripe/resources/bank_account.rb +2 -2
- data/lib/stripe/resources/billing_portal/session.rb +3 -3
- data/lib/stripe/resources/capability.rb +1 -1
- data/lib/stripe/resources/charge.rb +43 -20
- data/lib/stripe/resources/checkout/session.rb +120 -19
- data/lib/stripe/resources/confirmation_token.rb +119 -100
- data/lib/stripe/resources/country_spec.rb +1 -1
- data/lib/stripe/resources/coupon.rb +2 -3
- data/lib/stripe/resources/credit_note.rb +21 -18
- data/lib/stripe/resources/customer.rb +4 -6
- data/lib/stripe/resources/customer_session.rb +5 -5
- data/lib/stripe/resources/dispute.rb +2 -2
- data/lib/stripe/resources/event.rb +3 -1
- data/lib/stripe/resources/file.rb +1 -1
- data/lib/stripe/resources/funding_instructions.rb +1 -1
- data/lib/stripe/resources/identity/verification_report.rb +6 -0
- data/lib/stripe/resources/identity/verification_session.rb +51 -11
- data/lib/stripe/resources/invoice.rb +146 -32
- data/lib/stripe/resources/invoice_item.rb +3 -7
- data/lib/stripe/resources/invoice_line_item.rb +1 -1
- data/lib/stripe/resources/invoice_payment.rb +9 -2
- data/lib/stripe/resources/issuing/authorization.rb +8 -8
- data/lib/stripe/resources/issuing/card.rb +1 -1
- data/lib/stripe/resources/issuing/dispute.rb +3 -3
- data/lib/stripe/resources/login_link.rb +2 -1
- data/lib/stripe/resources/mandate.rb +3 -0
- data/lib/stripe/resources/payment_intent.rb +602 -325
- data/lib/stripe/resources/payment_method.rb +76 -117
- data/lib/stripe/resources/payment_method_configuration.rb +356 -2
- data/lib/stripe/resources/payment_method_domain.rb +15 -2
- data/lib/stripe/resources/payout.rb +4 -4
- data/lib/stripe/resources/person.rb +27 -3
- data/lib/stripe/resources/plan.rb +2 -3
- data/lib/stripe/resources/price.rb +1 -1
- data/lib/stripe/resources/product.rb +1 -2
- data/lib/stripe/resources/quote.rb +28 -3
- data/lib/stripe/resources/radar/value_list.rb +1 -2
- data/lib/stripe/resources/radar/value_list_item.rb +1 -2
- data/lib/stripe/resources/refund.rb +8 -1
- data/lib/stripe/resources/reversal.rb +1 -1
- data/lib/stripe/resources/review.rb +1 -1
- data/lib/stripe/resources/setup_attempt.rb +1 -1
- data/lib/stripe/resources/setup_intent.rb +414 -293
- data/lib/stripe/resources/source.rb +1 -1
- data/lib/stripe/resources/subscription.rb +149 -27
- data/lib/stripe/resources/subscription_item.rb +33 -0
- data/lib/stripe/resources/subscription_schedule.rb +141 -4
- data/lib/stripe/resources/tax/calculation.rb +6 -2
- data/lib/stripe/resources/tax/calculation_line_item.rb +2 -0
- data/lib/stripe/resources/tax/registration.rb +261 -1
- data/lib/stripe/resources/tax/transaction.rb +1 -1
- data/lib/stripe/resources/tax_id.rb +3 -4
- data/lib/stripe/resources/tax_rate.rb +2 -2
- data/lib/stripe/resources/terminal/configuration.rb +2 -2
- data/lib/stripe/resources/terminal/location.rb +2 -3
- data/lib/stripe/resources/terminal/reader.rb +426 -6
- data/lib/stripe/resources/test_helpers/test_clock.rb +1 -2
- data/lib/stripe/resources/token.rb +63 -2
- data/lib/stripe/resources/transfer.rb +1 -1
- data/lib/stripe/resources/treasury/financial_account.rb +5 -1
- data/lib/stripe/resources/v2/billing/meter_event.rb +2 -2
- data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +2 -2
- data/lib/stripe/resources/v2/billing/meter_event_session.rb +2 -2
- data/lib/stripe/resources/v2/event.rb +2 -2
- data/lib/stripe/resources/v2/event_destination.rb +2 -2
- data/lib/stripe/resources/webhook_endpoint.rb +1 -2
- data/lib/stripe/resources.rb +1 -0
- data/lib/stripe/services/account_external_account_service.rb +3 -4
- data/lib/stripe/services/account_login_link_service.rb +1 -1
- data/lib/stripe/services/account_person_service.rb +85 -2
- data/lib/stripe/services/account_service.rb +169 -20
- data/lib/stripe/services/account_session_service.rb +115 -47
- data/lib/stripe/services/apple_pay_domain_service.rb +1 -2
- data/lib/stripe/services/application_fee_service.rb +1 -1
- data/lib/stripe/services/apps_service.rb +1 -1
- data/lib/stripe/services/balance_service.rb +1 -1
- data/lib/stripe/services/billing/meter_service.rb +1 -1
- data/lib/stripe/services/billing_portal/session_service.rb +1 -1
- data/lib/stripe/services/billing_portal_service.rb +1 -1
- data/lib/stripe/services/billing_service.rb +1 -1
- data/lib/stripe/services/charge_service.rb +4 -4
- data/lib/stripe/services/checkout/session_service.rb +94 -15
- data/lib/stripe/services/checkout_service.rb +1 -1
- data/lib/stripe/services/climate_service.rb +1 -1
- data/lib/stripe/services/coupon_service.rb +1 -2
- data/lib/stripe/services/credit_note_preview_lines_service.rb +3 -3
- data/lib/stripe/services/credit_note_service.rb +14 -15
- data/lib/stripe/services/customer_balance_transaction_service.rb +3 -3
- data/lib/stripe/services/customer_cash_balance_transaction_service.rb +2 -2
- data/lib/stripe/services/customer_payment_method_service.rb +1 -1
- data/lib/stripe/services/customer_payment_source_service.rb +1 -1
- data/lib/stripe/services/customer_service.rb +5 -7
- data/lib/stripe/services/customer_session_service.rb +1 -1
- data/lib/stripe/services/customer_tax_id_service.rb +2 -3
- data/lib/stripe/services/dispute_service.rb +1 -1
- data/lib/stripe/services/entitlements_service.rb +1 -1
- data/lib/stripe/services/file_service.rb +1 -1
- data/lib/stripe/services/financial_connections/account_service.rb +1 -1
- data/lib/stripe/services/financial_connections_service.rb +1 -1
- data/lib/stripe/services/forwarding_service.rb +1 -1
- data/lib/stripe/services/identity/verification_session_service.rb +21 -5
- data/lib/stripe/services/identity_service.rb +1 -1
- data/lib/stripe/services/invoice_item_service.rb +1 -2
- data/lib/stripe/services/invoice_service.rb +122 -28
- data/lib/stripe/services/issuing/authorization_service.rb +4 -4
- data/lib/stripe/services/issuing/card_service.rb +1 -1
- data/lib/stripe/services/issuing/dispute_service.rb +2 -2
- data/lib/stripe/services/issuing_service.rb +1 -1
- data/lib/stripe/services/payment_intent_service.rb +563 -313
- data/lib/stripe/services/payment_link_service.rb +1 -1
- data/lib/stripe/services/payment_method_configuration_service.rb +254 -2
- data/lib/stripe/services/payment_method_domain_service.rb +1 -1
- data/lib/stripe/services/payment_method_service.rb +59 -105
- data/lib/stripe/services/payout_service.rb +2 -2
- data/lib/stripe/services/plan_service.rb +2 -3
- data/lib/stripe/services/price_service.rb +2 -2
- data/lib/stripe/services/product_feature_service.rb +1 -2
- data/lib/stripe/services/product_service.rb +3 -4
- data/lib/stripe/services/promotion_code_service.rb +1 -1
- data/lib/stripe/services/quote_service.rb +21 -4
- data/lib/stripe/services/radar/early_fraud_warning_service.rb +1 -1
- data/lib/stripe/services/radar/value_list_item_service.rb +1 -2
- data/lib/stripe/services/radar/value_list_service.rb +1 -2
- data/lib/stripe/services/radar_service.rb +1 -1
- data/lib/stripe/services/reporting_service.rb +1 -1
- data/lib/stripe/services/setup_intent_service.rb +403 -291
- data/lib/stripe/services/sigma_service.rb +1 -1
- data/lib/stripe/services/source_service.rb +2 -2
- data/lib/stripe/services/subscription_item_service.rb +26 -0
- data/lib/stripe/services/subscription_schedule_service.rb +106 -3
- data/lib/stripe/services/subscription_service.rb +121 -26
- data/lib/stripe/services/tax/calculation_service.rb +6 -2
- data/lib/stripe/services/tax/registration_service.rb +170 -1
- data/lib/stripe/services/tax/transaction_service.rb +1 -1
- data/lib/stripe/services/tax_id_service.rb +2 -3
- data/lib/stripe/services/tax_service.rb +1 -1
- data/lib/stripe/services/terminal/configuration_service.rb +1 -2
- data/lib/stripe/services/terminal/location_service.rb +2 -3
- data/lib/stripe/services/terminal/reader_service.rb +196 -2
- data/lib/stripe/services/terminal_service.rb +1 -1
- data/lib/stripe/services/test_helpers/confirmation_token_service.rb +90 -91
- data/lib/stripe/services/test_helpers/issuing_service.rb +1 -1
- data/lib/stripe/services/test_helpers/terminal/reader_service.rb +43 -0
- data/lib/stripe/services/test_helpers/terminal_service.rb +1 -1
- data/lib/stripe/services/test_helpers/test_clock_service.rb +1 -2
- data/lib/stripe/services/test_helpers/treasury_service.rb +1 -1
- data/lib/stripe/services/test_helpers_service.rb +1 -1
- data/lib/stripe/services/token_service.rb +62 -1
- data/lib/stripe/services/transfer_service.rb +2 -2
- data/lib/stripe/services/treasury/financial_account_service.rb +6 -2
- data/lib/stripe/services/treasury_service.rb +1 -1
- data/lib/stripe/services/v1_services.rb +1 -1
- data/lib/stripe/services/v2/billing/meter_event_session_service.rb +1 -2
- data/lib/stripe/services/v2/billing_service.rb +3 -3
- data/lib/stripe/services/v2/core/event_destination_service.rb +17 -23
- data/lib/stripe/services/v2/core/event_service.rb +1 -2
- data/lib/stripe/services/v2/core_service.rb +1 -1
- data/lib/stripe/services/v2_services.rb +1 -1
- data/lib/stripe/services/webhook_endpoint_service.rb +1 -2
- data/lib/stripe/version.rb +1 -1
- data/lib/stripe/webhook.rb +1 -1
- data/rbi/stripe/resources/account.rbi +190 -35
- data/rbi/stripe/resources/account_session.rbi +196 -77
- data/rbi/stripe/resources/apple_pay_domain.rbi +1 -3
- data/rbi/stripe/resources/balance.rbi +55 -0
- data/rbi/stripe/resources/balance_transaction.rbi +3 -0
- data/rbi/stripe/resources/bank_account.rbi +2 -2
- data/rbi/stripe/resources/billing/alert.rbi +2 -2
- data/rbi/stripe/resources/billing_portal/session.rbi +3 -3
- data/rbi/stripe/resources/capability.rbi +1 -1
- data/rbi/stripe/resources/charge.rbi +52 -20
- data/rbi/stripe/resources/checkout/session.rbi +133 -24
- data/rbi/stripe/resources/confirmation_token.rbi +140 -115
- data/rbi/stripe/resources/country_spec.rbi +1 -1
- data/rbi/stripe/resources/coupon.rbi +2 -4
- data/rbi/stripe/resources/credit_note.rbi +23 -18
- data/rbi/stripe/resources/customer.rbi +4 -8
- data/rbi/stripe/resources/customer_session.rbi +5 -5
- data/rbi/stripe/resources/dispute.rbi +2 -2
- data/rbi/stripe/resources/event.rbi +4 -1
- data/rbi/stripe/resources/file.rbi +1 -1
- data/rbi/stripe/resources/identity/verification_report.rbi +9 -0
- data/rbi/stripe/resources/identity/verification_session.rbi +59 -12
- data/rbi/stripe/resources/invoice.rbi +149 -40
- data/rbi/stripe/resources/invoice_item.rbi +3 -8
- data/rbi/stripe/resources/invoice_line_item.rbi +2 -2
- data/rbi/stripe/resources/invoice_payment.rbi +9 -2
- data/rbi/stripe/resources/issuing/authorization.rbi +8 -8
- data/rbi/stripe/resources/issuing/card.rbi +1 -1
- data/rbi/stripe/resources/issuing/dispute.rbi +3 -3
- data/rbi/stripe/resources/login_link.rbi +2 -1
- data/rbi/stripe/resources/mandate.rbi +4 -0
- data/rbi/stripe/resources/payment_intent.rbi +637 -381
- data/rbi/stripe/resources/payment_method.rbi +81 -133
- data/rbi/stripe/resources/payment_method_configuration.rbi +400 -4
- data/rbi/stripe/resources/payment_method_domain.rbi +18 -2
- data/rbi/stripe/resources/payout.rbi +4 -4
- data/rbi/stripe/resources/person.rbi +33 -3
- data/rbi/stripe/resources/plan.rbi +2 -4
- data/rbi/stripe/resources/price.rbi +1 -1
- data/rbi/stripe/resources/product.rbi +1 -3
- data/rbi/stripe/resources/quote.rbi +25 -3
- data/rbi/stripe/resources/radar/value_list.rbi +1 -3
- data/rbi/stripe/resources/radar/value_list_item.rbi +1 -3
- data/rbi/stripe/resources/refund.rbi +8 -1
- data/rbi/stripe/resources/reversal.rbi +1 -1
- data/rbi/stripe/resources/review.rbi +1 -1
- data/rbi/stripe/resources/setup_attempt.rbi +1 -1
- data/rbi/stripe/resources/setup_intent.rbi +464 -346
- data/rbi/stripe/resources/source.rbi +1 -1
- data/rbi/stripe/resources/subscription.rbi +150 -34
- data/rbi/stripe/resources/subscription_item.rbi +36 -2
- data/rbi/stripe/resources/subscription_schedule.rbi +161 -11
- data/rbi/stripe/resources/tax/calculation.rbi +7 -3
- data/rbi/stripe/resources/tax/calculation_line_item.rbi +4 -1
- data/rbi/stripe/resources/tax/registration.rbi +249 -2
- data/rbi/stripe/resources/tax/transaction.rbi +1 -1
- data/rbi/stripe/resources/tax_id.rbi +3 -5
- data/rbi/stripe/resources/tax_rate.rbi +2 -2
- data/rbi/stripe/resources/terminal/configuration.rbi +2 -3
- data/rbi/stripe/resources/terminal/location.rbi +4 -6
- data/rbi/stripe/resources/terminal/reader.rbi +415 -8
- data/rbi/stripe/resources/test_helpers/test_clock.rbi +1 -3
- data/rbi/stripe/resources/token.rbi +70 -4
- data/rbi/stripe/resources/transfer.rbi +1 -1
- data/rbi/stripe/resources/treasury/financial_account.rbi +6 -2
- data/rbi/stripe/resources/v2/billing/meter_event.rbi +3 -3
- data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +3 -3
- data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +3 -3
- data/rbi/stripe/resources/v2/event.rbi +3 -3
- data/rbi/stripe/resources/v2/event_destination.rbi +3 -3
- data/rbi/stripe/resources/webhook_endpoint.rbi +1 -3
- data/rbi/stripe/services/account_external_account_service.rbi +3 -5
- data/rbi/stripe/services/account_login_link_service.rbi +1 -1
- data/rbi/stripe/services/account_person_service.rbi +93 -5
- data/rbi/stripe/services/account_service.rbi +166 -28
- data/rbi/stripe/services/account_session_service.rbi +126 -52
- data/rbi/stripe/services/apple_pay_domain_service.rbi +1 -3
- data/rbi/stripe/services/balance_service.rbi +1 -1
- data/rbi/stripe/services/billing/alert_service.rbi +2 -2
- data/rbi/stripe/services/billing_portal/session_service.rbi +1 -1
- data/rbi/stripe/services/charge_service.rbi +4 -4
- data/rbi/stripe/services/checkout/session_service.rbi +104 -19
- data/rbi/stripe/services/coupon_service.rbi +1 -3
- data/rbi/stripe/services/credit_note_preview_lines_service.rbi +3 -3
- data/rbi/stripe/services/credit_note_service.rbi +13 -14
- data/rbi/stripe/services/customer_balance_transaction_service.rbi +3 -3
- data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +2 -2
- data/rbi/stripe/services/customer_payment_method_service.rbi +1 -1
- data/rbi/stripe/services/customer_payment_source_service.rbi +1 -1
- data/rbi/stripe/services/customer_service.rbi +4 -8
- data/rbi/stripe/services/customer_session_service.rbi +1 -1
- data/rbi/stripe/services/customer_tax_id_service.rbi +2 -4
- data/rbi/stripe/services/dispute_service.rbi +1 -1
- data/rbi/stripe/services/file_service.rbi +1 -1
- data/rbi/stripe/services/identity/verification_session_service.rbi +22 -6
- data/rbi/stripe/services/invoice_item_service.rbi +1 -3
- data/rbi/stripe/services/invoice_service.rbi +126 -35
- data/rbi/stripe/services/issuing/authorization_service.rbi +4 -4
- data/rbi/stripe/services/issuing/card_service.rbi +1 -1
- data/rbi/stripe/services/issuing/dispute_service.rbi +2 -2
- data/rbi/stripe/services/payment_intent_service.rbi +599 -369
- data/rbi/stripe/services/payment_method_configuration_service.rbi +280 -4
- data/rbi/stripe/services/payment_method_domain_service.rbi +1 -1
- data/rbi/stripe/services/payment_method_service.rbi +62 -121
- data/rbi/stripe/services/payout_service.rbi +2 -2
- data/rbi/stripe/services/plan_service.rbi +2 -4
- data/rbi/stripe/services/price_service.rbi +2 -2
- data/rbi/stripe/services/product_feature_service.rbi +1 -3
- data/rbi/stripe/services/product_service.rbi +2 -4
- data/rbi/stripe/services/promotion_code_service.rbi +1 -1
- data/rbi/stripe/services/quote_service.rbi +16 -3
- data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +1 -1
- data/rbi/stripe/services/radar/value_list_item_service.rbi +1 -3
- data/rbi/stripe/services/radar/value_list_service.rbi +1 -3
- data/rbi/stripe/services/setup_intent_service.rbi +457 -344
- data/rbi/stripe/services/source_service.rbi +1 -1
- data/rbi/stripe/services/subscription_item_service.rbi +28 -2
- data/rbi/stripe/services/subscription_schedule_service.rbi +119 -10
- data/rbi/stripe/services/subscription_service.rbi +121 -33
- data/rbi/stripe/services/tax/calculation_service.rbi +6 -2
- data/rbi/stripe/services/tax/registration_service.rbi +171 -2
- data/rbi/stripe/services/tax_id_service.rbi +2 -4
- data/rbi/stripe/services/terminal/configuration_service.rbi +1 -3
- data/rbi/stripe/services/terminal/location_service.rbi +4 -6
- data/rbi/stripe/services/terminal/reader_service.rbi +200 -4
- data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +106 -106
- data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +31 -0
- data/rbi/stripe/services/test_helpers/test_clock_service.rbi +1 -3
- data/rbi/stripe/services/token_service.rbi +71 -3
- data/rbi/stripe/services/transfer_service.rbi +1 -1
- data/rbi/stripe/services/treasury/financial_account_service.rbi +6 -2
- data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +1 -3
- data/rbi/stripe/services/v2/billing_service.rbi +1 -1
- data/rbi/stripe/services/v2/core/event_destination_service.rbi +14 -22
- data/rbi/stripe/services/v2/core/event_service.rbi +1 -3
- data/rbi/stripe/services/webhook_endpoint_service.rbi +1 -3
- metadata +5 -2
@@ -648,7 +648,7 @@ module Stripe
|
|
648
648
|
|
649
649
|
# Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
650
650
|
#
|
651
|
-
# This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail.
|
651
|
+
# This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our [payment method guides](https://docs.stripe.com/docs/sources) for more detail.
|
652
652
|
sig {
|
653
653
|
params(source: String, params: T.any(::Stripe::SourceService::UpdateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Source)
|
654
654
|
}
|
@@ -27,6 +27,13 @@ module Stripe
|
|
27
27
|
def initialize(expand: nil); end
|
28
28
|
end
|
29
29
|
class UpdateParams < Stripe::RequestParams
|
30
|
+
class BillingThresholds < Stripe::RequestParams
|
31
|
+
# Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
|
32
|
+
sig { returns(Integer) }
|
33
|
+
attr_accessor :usage_gte
|
34
|
+
sig { params(usage_gte: Integer).void }
|
35
|
+
def initialize(usage_gte: nil); end
|
36
|
+
end
|
30
37
|
class Discount < Stripe::RequestParams
|
31
38
|
# ID of the coupon to create a new discount for.
|
32
39
|
sig { returns(T.nilable(String)) }
|
@@ -83,6 +90,11 @@ module Stripe
|
|
83
90
|
unit_amount_decimal: nil
|
84
91
|
); end
|
85
92
|
end
|
93
|
+
# Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
|
94
|
+
sig {
|
95
|
+
returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionItemService::UpdateParams::BillingThresholds))))
|
96
|
+
}
|
97
|
+
attr_accessor :billing_thresholds
|
86
98
|
# The coupons to redeem into discounts for the subscription item.
|
87
99
|
sig {
|
88
100
|
returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionItemService::UpdateParams::Discount]))))
|
@@ -128,9 +140,10 @@ module Stripe
|
|
128
140
|
sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
|
129
141
|
attr_accessor :tax_rates
|
130
142
|
sig {
|
131
|
-
params(discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionItemService::UpdateParams::Discount]))), expand: T.nilable(T::Array[String]), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), off_session: T.nilable(T::Boolean), payment_behavior: T.nilable(String), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionItemService::UpdateParams::PriceData), proration_behavior: T.nilable(String), proration_date: T.nilable(Integer), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
|
143
|
+
params(billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionItemService::UpdateParams::BillingThresholds))), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionItemService::UpdateParams::Discount]))), expand: T.nilable(T::Array[String]), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), off_session: T.nilable(T::Boolean), payment_behavior: T.nilable(String), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionItemService::UpdateParams::PriceData), proration_behavior: T.nilable(String), proration_date: T.nilable(Integer), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
|
132
144
|
}
|
133
145
|
def initialize(
|
146
|
+
billing_thresholds: nil,
|
134
147
|
discounts: nil,
|
135
148
|
expand: nil,
|
136
149
|
metadata: nil,
|
@@ -173,6 +186,13 @@ module Stripe
|
|
173
186
|
); end
|
174
187
|
end
|
175
188
|
class CreateParams < Stripe::RequestParams
|
189
|
+
class BillingThresholds < Stripe::RequestParams
|
190
|
+
# Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
|
191
|
+
sig { returns(Integer) }
|
192
|
+
attr_accessor :usage_gte
|
193
|
+
sig { params(usage_gte: Integer).void }
|
194
|
+
def initialize(usage_gte: nil); end
|
195
|
+
end
|
176
196
|
class Discount < Stripe::RequestParams
|
177
197
|
# ID of the coupon to create a new discount for.
|
178
198
|
sig { returns(T.nilable(String)) }
|
@@ -229,6 +249,11 @@ module Stripe
|
|
229
249
|
unit_amount_decimal: nil
|
230
250
|
); end
|
231
251
|
end
|
252
|
+
# Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
|
253
|
+
sig {
|
254
|
+
returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionItemService::CreateParams::BillingThresholds))))
|
255
|
+
}
|
256
|
+
attr_accessor :billing_thresholds
|
232
257
|
# The coupons to redeem into discounts for the subscription item.
|
233
258
|
sig {
|
234
259
|
returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionItemService::CreateParams::Discount]))))
|
@@ -274,9 +299,10 @@ module Stripe
|
|
274
299
|
sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
|
275
300
|
attr_accessor :tax_rates
|
276
301
|
sig {
|
277
|
-
params(discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionItemService::CreateParams::Discount]))), expand: T.nilable(T::Array[String]), metadata: T.nilable(T::Hash[String, String]), payment_behavior: T.nilable(String), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionItemService::CreateParams::PriceData), proration_behavior: T.nilable(String), proration_date: T.nilable(Integer), quantity: T.nilable(Integer), subscription: String, tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
|
302
|
+
params(billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionItemService::CreateParams::BillingThresholds))), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionItemService::CreateParams::Discount]))), expand: T.nilable(T::Array[String]), metadata: T.nilable(T::Hash[String, String]), payment_behavior: T.nilable(String), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionItemService::CreateParams::PriceData), proration_behavior: T.nilable(String), proration_date: T.nilable(Integer), quantity: T.nilable(Integer), subscription: String, tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
|
278
303
|
}
|
279
304
|
def initialize(
|
305
|
+
billing_thresholds: nil,
|
280
306
|
discounts: nil,
|
281
307
|
expand: nil,
|
282
308
|
metadata: nil,
|
@@ -132,6 +132,13 @@ module Stripe
|
|
132
132
|
); end
|
133
133
|
end
|
134
134
|
class CreateParams < Stripe::RequestParams
|
135
|
+
class BillingMode < Stripe::RequestParams
|
136
|
+
# Attribute for param field type
|
137
|
+
sig { returns(String) }
|
138
|
+
attr_accessor :type
|
139
|
+
sig { params(type: String).void }
|
140
|
+
def initialize(type: nil); end
|
141
|
+
end
|
135
142
|
class DefaultSettings < Stripe::RequestParams
|
136
143
|
class AutomaticTax < Stripe::RequestParams
|
137
144
|
class Liability < Stripe::RequestParams
|
@@ -157,6 +164,18 @@ module Stripe
|
|
157
164
|
}
|
158
165
|
def initialize(enabled: nil, liability: nil); end
|
159
166
|
end
|
167
|
+
class BillingThresholds < Stripe::RequestParams
|
168
|
+
# Monetary threshold that triggers the subscription to advance to a new billing period
|
169
|
+
sig { returns(T.nilable(Integer)) }
|
170
|
+
attr_accessor :amount_gte
|
171
|
+
# Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
|
172
|
+
sig { returns(T.nilable(T::Boolean)) }
|
173
|
+
attr_accessor :reset_billing_cycle_anchor
|
174
|
+
sig {
|
175
|
+
params(amount_gte: T.nilable(Integer), reset_billing_cycle_anchor: T.nilable(T::Boolean)).void
|
176
|
+
}
|
177
|
+
def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil); end
|
178
|
+
end
|
160
179
|
class InvoiceSettings < Stripe::RequestParams
|
161
180
|
class Issuer < Stripe::RequestParams
|
162
181
|
# The connected account being referenced when `type` is `account`.
|
@@ -205,6 +224,11 @@ module Stripe
|
|
205
224
|
# Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
|
206
225
|
sig { returns(T.nilable(String)) }
|
207
226
|
attr_accessor :billing_cycle_anchor
|
227
|
+
# Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
|
228
|
+
sig {
|
229
|
+
returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionScheduleService::CreateParams::DefaultSettings::BillingThresholds))))
|
230
|
+
}
|
231
|
+
attr_accessor :billing_thresholds
|
208
232
|
# Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.
|
209
233
|
sig { returns(T.nilable(String)) }
|
210
234
|
attr_accessor :collection_method
|
@@ -228,12 +252,13 @@ module Stripe
|
|
228
252
|
}
|
229
253
|
attr_accessor :transfer_data
|
230
254
|
sig {
|
231
|
-
params(application_fee_percent: T.nilable(Float), automatic_tax: T.nilable(::Stripe::SubscriptionScheduleService::CreateParams::DefaultSettings::AutomaticTax), billing_cycle_anchor: T.nilable(String), collection_method: T.nilable(String), default_payment_method: T.nilable(String), description: T.nilable(T.nilable(String)), invoice_settings: T.nilable(::Stripe::SubscriptionScheduleService::CreateParams::DefaultSettings::InvoiceSettings), on_behalf_of: T.nilable(T.nilable(String)), transfer_data: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionScheduleService::CreateParams::DefaultSettings::TransferData)))).void
|
255
|
+
params(application_fee_percent: T.nilable(Float), automatic_tax: T.nilable(::Stripe::SubscriptionScheduleService::CreateParams::DefaultSettings::AutomaticTax), billing_cycle_anchor: T.nilable(String), billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionScheduleService::CreateParams::DefaultSettings::BillingThresholds))), collection_method: T.nilable(String), default_payment_method: T.nilable(String), description: T.nilable(T.nilable(String)), invoice_settings: T.nilable(::Stripe::SubscriptionScheduleService::CreateParams::DefaultSettings::InvoiceSettings), on_behalf_of: T.nilable(T.nilable(String)), transfer_data: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionScheduleService::CreateParams::DefaultSettings::TransferData)))).void
|
232
256
|
}
|
233
257
|
def initialize(
|
234
258
|
application_fee_percent: nil,
|
235
259
|
automatic_tax: nil,
|
236
260
|
billing_cycle_anchor: nil,
|
261
|
+
billing_thresholds: nil,
|
237
262
|
collection_method: nil,
|
238
263
|
default_payment_method: nil,
|
239
264
|
description: nil,
|
@@ -340,6 +365,18 @@ module Stripe
|
|
340
365
|
}
|
341
366
|
def initialize(enabled: nil, liability: nil); end
|
342
367
|
end
|
368
|
+
class BillingThresholds < Stripe::RequestParams
|
369
|
+
# Monetary threshold that triggers the subscription to advance to a new billing period
|
370
|
+
sig { returns(T.nilable(Integer)) }
|
371
|
+
attr_accessor :amount_gte
|
372
|
+
# Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
|
373
|
+
sig { returns(T.nilable(T::Boolean)) }
|
374
|
+
attr_accessor :reset_billing_cycle_anchor
|
375
|
+
sig {
|
376
|
+
params(amount_gte: T.nilable(Integer), reset_billing_cycle_anchor: T.nilable(T::Boolean)).void
|
377
|
+
}
|
378
|
+
def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil); end
|
379
|
+
end
|
343
380
|
class Discount < Stripe::RequestParams
|
344
381
|
# ID of the coupon to create a new discount for.
|
345
382
|
sig { returns(T.nilable(String)) }
|
@@ -383,6 +420,13 @@ module Stripe
|
|
383
420
|
def initialize(account_tax_ids: nil, days_until_due: nil, issuer: nil); end
|
384
421
|
end
|
385
422
|
class Item < Stripe::RequestParams
|
423
|
+
class BillingThresholds < Stripe::RequestParams
|
424
|
+
# Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
|
425
|
+
sig { returns(Integer) }
|
426
|
+
attr_accessor :usage_gte
|
427
|
+
sig { params(usage_gte: Integer).void }
|
428
|
+
def initialize(usage_gte: nil); end
|
429
|
+
end
|
386
430
|
class Discount < Stripe::RequestParams
|
387
431
|
# ID of the coupon to create a new discount for.
|
388
432
|
sig { returns(T.nilable(String)) }
|
@@ -441,6 +485,11 @@ module Stripe
|
|
441
485
|
unit_amount_decimal: nil
|
442
486
|
); end
|
443
487
|
end
|
488
|
+
# Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
|
489
|
+
sig {
|
490
|
+
returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionScheduleService::CreateParams::Phase::Item::BillingThresholds))))
|
491
|
+
}
|
492
|
+
attr_accessor :billing_thresholds
|
444
493
|
# The coupons to redeem into discounts for the subscription item.
|
445
494
|
sig {
|
446
495
|
returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionScheduleService::CreateParams::Phase::Item::Discount]))))
|
@@ -467,9 +516,10 @@ module Stripe
|
|
467
516
|
sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
|
468
517
|
attr_accessor :tax_rates
|
469
518
|
sig {
|
470
|
-
params(discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionScheduleService::CreateParams::Phase::Item::Discount]))), metadata: T.nilable(T::Hash[String, String]), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionScheduleService::CreateParams::Phase::Item::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
|
519
|
+
params(billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionScheduleService::CreateParams::Phase::Item::BillingThresholds))), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionScheduleService::CreateParams::Phase::Item::Discount]))), metadata: T.nilable(T::Hash[String, String]), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionScheduleService::CreateParams::Phase::Item::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
|
471
520
|
}
|
472
521
|
def initialize(
|
522
|
+
billing_thresholds: nil,
|
473
523
|
discounts: nil,
|
474
524
|
metadata: nil,
|
475
525
|
plan: nil,
|
@@ -505,6 +555,11 @@ module Stripe
|
|
505
555
|
# Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
|
506
556
|
sig { returns(T.nilable(String)) }
|
507
557
|
attr_accessor :billing_cycle_anchor
|
558
|
+
# Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
|
559
|
+
sig {
|
560
|
+
returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionScheduleService::CreateParams::Phase::BillingThresholds))))
|
561
|
+
}
|
562
|
+
attr_accessor :billing_thresholds
|
508
563
|
# Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.
|
509
564
|
sig { returns(T.nilable(String)) }
|
510
565
|
attr_accessor :collection_method
|
@@ -545,7 +600,7 @@ module Stripe
|
|
545
600
|
# The account on behalf of which to charge, for each of the associated subscription's invoices.
|
546
601
|
sig { returns(T.nilable(String)) }
|
547
602
|
attr_accessor :on_behalf_of
|
548
|
-
#
|
603
|
+
# Controls whether the subscription schedule should create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration (item price, quantity, etc.) of the current phase.
|
549
604
|
sig { returns(T.nilable(String)) }
|
550
605
|
attr_accessor :proration_behavior
|
551
606
|
# The data with which to automatically create a Transfer for each of the associated subscription's invoices.
|
@@ -560,13 +615,14 @@ module Stripe
|
|
560
615
|
sig { returns(T.nilable(Integer)) }
|
561
616
|
attr_accessor :trial_end
|
562
617
|
sig {
|
563
|
-
params(add_invoice_items: T.nilable(T::Array[::Stripe::SubscriptionScheduleService::CreateParams::Phase::AddInvoiceItem]), application_fee_percent: T.nilable(Float), automatic_tax: T.nilable(::Stripe::SubscriptionScheduleService::CreateParams::Phase::AutomaticTax), billing_cycle_anchor: T.nilable(String), collection_method: T.nilable(String), currency: T.nilable(String), default_payment_method: T.nilable(String), default_tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), description: T.nilable(T.nilable(String)), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionScheduleService::CreateParams::Phase::Discount]))), end_date: T.nilable(Integer), invoice_settings: T.nilable(::Stripe::SubscriptionScheduleService::CreateParams::Phase::InvoiceSettings), items: T::Array[::Stripe::SubscriptionScheduleService::CreateParams::Phase::Item], iterations: T.nilable(Integer), metadata: T.nilable(T::Hash[String, String]), on_behalf_of: T.nilable(String), proration_behavior: T.nilable(String), transfer_data: T.nilable(::Stripe::SubscriptionScheduleService::CreateParams::Phase::TransferData), trial: T.nilable(T::Boolean), trial_end: T.nilable(Integer)).void
|
618
|
+
params(add_invoice_items: T.nilable(T::Array[::Stripe::SubscriptionScheduleService::CreateParams::Phase::AddInvoiceItem]), application_fee_percent: T.nilable(Float), automatic_tax: T.nilable(::Stripe::SubscriptionScheduleService::CreateParams::Phase::AutomaticTax), billing_cycle_anchor: T.nilable(String), billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionScheduleService::CreateParams::Phase::BillingThresholds))), collection_method: T.nilable(String), currency: T.nilable(String), default_payment_method: T.nilable(String), default_tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), description: T.nilable(T.nilable(String)), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionScheduleService::CreateParams::Phase::Discount]))), end_date: T.nilable(Integer), invoice_settings: T.nilable(::Stripe::SubscriptionScheduleService::CreateParams::Phase::InvoiceSettings), items: T::Array[::Stripe::SubscriptionScheduleService::CreateParams::Phase::Item], iterations: T.nilable(Integer), metadata: T.nilable(T::Hash[String, String]), on_behalf_of: T.nilable(String), proration_behavior: T.nilable(String), transfer_data: T.nilable(::Stripe::SubscriptionScheduleService::CreateParams::Phase::TransferData), trial: T.nilable(T::Boolean), trial_end: T.nilable(Integer)).void
|
564
619
|
}
|
565
620
|
def initialize(
|
566
621
|
add_invoice_items: nil,
|
567
622
|
application_fee_percent: nil,
|
568
623
|
automatic_tax: nil,
|
569
624
|
billing_cycle_anchor: nil,
|
625
|
+
billing_thresholds: nil,
|
570
626
|
collection_method: nil,
|
571
627
|
currency: nil,
|
572
628
|
default_payment_method: nil,
|
@@ -585,6 +641,9 @@ module Stripe
|
|
585
641
|
trial_end: nil
|
586
642
|
); end
|
587
643
|
end
|
644
|
+
# Controls how prorations and invoices for subscriptions are calculated and orchestrated.
|
645
|
+
sig { returns(T.nilable(::Stripe::SubscriptionScheduleService::CreateParams::BillingMode)) }
|
646
|
+
attr_accessor :billing_mode
|
588
647
|
# The identifier of the customer to create the subscription schedule for.
|
589
648
|
sig { returns(T.nilable(String)) }
|
590
649
|
attr_accessor :customer
|
@@ -614,9 +673,10 @@ module Stripe
|
|
614
673
|
sig { returns(T.nilable(T.any(Integer, String))) }
|
615
674
|
attr_accessor :start_date
|
616
675
|
sig {
|
617
|
-
params(customer: T.nilable(String), default_settings: T.nilable(::Stripe::SubscriptionScheduleService::CreateParams::DefaultSettings), end_behavior: T.nilable(String), expand: T.nilable(T::Array[String]), from_subscription: T.nilable(String), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), phases: T.nilable(T::Array[::Stripe::SubscriptionScheduleService::CreateParams::Phase]), start_date: T.nilable(T.any(Integer, String))).void
|
676
|
+
params(billing_mode: T.nilable(::Stripe::SubscriptionScheduleService::CreateParams::BillingMode), customer: T.nilable(String), default_settings: T.nilable(::Stripe::SubscriptionScheduleService::CreateParams::DefaultSettings), end_behavior: T.nilable(String), expand: T.nilable(T::Array[String]), from_subscription: T.nilable(String), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), phases: T.nilable(T::Array[::Stripe::SubscriptionScheduleService::CreateParams::Phase]), start_date: T.nilable(T.any(Integer, String))).void
|
618
677
|
}
|
619
678
|
def initialize(
|
679
|
+
billing_mode: nil,
|
620
680
|
customer: nil,
|
621
681
|
default_settings: nil,
|
622
682
|
end_behavior: nil,
|
@@ -660,6 +720,18 @@ module Stripe
|
|
660
720
|
}
|
661
721
|
def initialize(enabled: nil, liability: nil); end
|
662
722
|
end
|
723
|
+
class BillingThresholds < Stripe::RequestParams
|
724
|
+
# Monetary threshold that triggers the subscription to advance to a new billing period
|
725
|
+
sig { returns(T.nilable(Integer)) }
|
726
|
+
attr_accessor :amount_gte
|
727
|
+
# Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
|
728
|
+
sig { returns(T.nilable(T::Boolean)) }
|
729
|
+
attr_accessor :reset_billing_cycle_anchor
|
730
|
+
sig {
|
731
|
+
params(amount_gte: T.nilable(Integer), reset_billing_cycle_anchor: T.nilable(T::Boolean)).void
|
732
|
+
}
|
733
|
+
def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil); end
|
734
|
+
end
|
663
735
|
class InvoiceSettings < Stripe::RequestParams
|
664
736
|
class Issuer < Stripe::RequestParams
|
665
737
|
# The connected account being referenced when `type` is `account`.
|
@@ -708,6 +780,11 @@ module Stripe
|
|
708
780
|
# Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
|
709
781
|
sig { returns(T.nilable(String)) }
|
710
782
|
attr_accessor :billing_cycle_anchor
|
783
|
+
# Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
|
784
|
+
sig {
|
785
|
+
returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionScheduleService::UpdateParams::DefaultSettings::BillingThresholds))))
|
786
|
+
}
|
787
|
+
attr_accessor :billing_thresholds
|
711
788
|
# Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.
|
712
789
|
sig { returns(T.nilable(String)) }
|
713
790
|
attr_accessor :collection_method
|
@@ -731,12 +808,13 @@ module Stripe
|
|
731
808
|
}
|
732
809
|
attr_accessor :transfer_data
|
733
810
|
sig {
|
734
|
-
params(application_fee_percent: T.nilable(Float), automatic_tax: T.nilable(::Stripe::SubscriptionScheduleService::UpdateParams::DefaultSettings::AutomaticTax), billing_cycle_anchor: T.nilable(String), collection_method: T.nilable(String), default_payment_method: T.nilable(String), description: T.nilable(T.nilable(String)), invoice_settings: T.nilable(::Stripe::SubscriptionScheduleService::UpdateParams::DefaultSettings::InvoiceSettings), on_behalf_of: T.nilable(T.nilable(String)), transfer_data: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionScheduleService::UpdateParams::DefaultSettings::TransferData)))).void
|
811
|
+
params(application_fee_percent: T.nilable(Float), automatic_tax: T.nilable(::Stripe::SubscriptionScheduleService::UpdateParams::DefaultSettings::AutomaticTax), billing_cycle_anchor: T.nilable(String), billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionScheduleService::UpdateParams::DefaultSettings::BillingThresholds))), collection_method: T.nilable(String), default_payment_method: T.nilable(String), description: T.nilable(T.nilable(String)), invoice_settings: T.nilable(::Stripe::SubscriptionScheduleService::UpdateParams::DefaultSettings::InvoiceSettings), on_behalf_of: T.nilable(T.nilable(String)), transfer_data: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionScheduleService::UpdateParams::DefaultSettings::TransferData)))).void
|
735
812
|
}
|
736
813
|
def initialize(
|
737
814
|
application_fee_percent: nil,
|
738
815
|
automatic_tax: nil,
|
739
816
|
billing_cycle_anchor: nil,
|
817
|
+
billing_thresholds: nil,
|
740
818
|
collection_method: nil,
|
741
819
|
default_payment_method: nil,
|
742
820
|
description: nil,
|
@@ -843,6 +921,18 @@ module Stripe
|
|
843
921
|
}
|
844
922
|
def initialize(enabled: nil, liability: nil); end
|
845
923
|
end
|
924
|
+
class BillingThresholds < Stripe::RequestParams
|
925
|
+
# Monetary threshold that triggers the subscription to advance to a new billing period
|
926
|
+
sig { returns(T.nilable(Integer)) }
|
927
|
+
attr_accessor :amount_gte
|
928
|
+
# Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
|
929
|
+
sig { returns(T.nilable(T::Boolean)) }
|
930
|
+
attr_accessor :reset_billing_cycle_anchor
|
931
|
+
sig {
|
932
|
+
params(amount_gte: T.nilable(Integer), reset_billing_cycle_anchor: T.nilable(T::Boolean)).void
|
933
|
+
}
|
934
|
+
def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil); end
|
935
|
+
end
|
846
936
|
class Discount < Stripe::RequestParams
|
847
937
|
# ID of the coupon to create a new discount for.
|
848
938
|
sig { returns(T.nilable(String)) }
|
@@ -886,6 +976,13 @@ module Stripe
|
|
886
976
|
def initialize(account_tax_ids: nil, days_until_due: nil, issuer: nil); end
|
887
977
|
end
|
888
978
|
class Item < Stripe::RequestParams
|
979
|
+
class BillingThresholds < Stripe::RequestParams
|
980
|
+
# Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
|
981
|
+
sig { returns(Integer) }
|
982
|
+
attr_accessor :usage_gte
|
983
|
+
sig { params(usage_gte: Integer).void }
|
984
|
+
def initialize(usage_gte: nil); end
|
985
|
+
end
|
889
986
|
class Discount < Stripe::RequestParams
|
890
987
|
# ID of the coupon to create a new discount for.
|
891
988
|
sig { returns(T.nilable(String)) }
|
@@ -944,6 +1041,11 @@ module Stripe
|
|
944
1041
|
unit_amount_decimal: nil
|
945
1042
|
); end
|
946
1043
|
end
|
1044
|
+
# Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
|
1045
|
+
sig {
|
1046
|
+
returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionScheduleService::UpdateParams::Phase::Item::BillingThresholds))))
|
1047
|
+
}
|
1048
|
+
attr_accessor :billing_thresholds
|
947
1049
|
# The coupons to redeem into discounts for the subscription item.
|
948
1050
|
sig {
|
949
1051
|
returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionScheduleService::UpdateParams::Phase::Item::Discount]))))
|
@@ -970,9 +1072,10 @@ module Stripe
|
|
970
1072
|
sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
|
971
1073
|
attr_accessor :tax_rates
|
972
1074
|
sig {
|
973
|
-
params(discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionScheduleService::UpdateParams::Phase::Item::Discount]))), metadata: T.nilable(T::Hash[String, String]), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionScheduleService::UpdateParams::Phase::Item::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
|
1075
|
+
params(billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionScheduleService::UpdateParams::Phase::Item::BillingThresholds))), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionScheduleService::UpdateParams::Phase::Item::Discount]))), metadata: T.nilable(T::Hash[String, String]), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionScheduleService::UpdateParams::Phase::Item::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
|
974
1076
|
}
|
975
1077
|
def initialize(
|
1078
|
+
billing_thresholds: nil,
|
976
1079
|
discounts: nil,
|
977
1080
|
metadata: nil,
|
978
1081
|
plan: nil,
|
@@ -1008,6 +1111,11 @@ module Stripe
|
|
1008
1111
|
# Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
|
1009
1112
|
sig { returns(T.nilable(String)) }
|
1010
1113
|
attr_accessor :billing_cycle_anchor
|
1114
|
+
# Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
|
1115
|
+
sig {
|
1116
|
+
returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionScheduleService::UpdateParams::Phase::BillingThresholds))))
|
1117
|
+
}
|
1118
|
+
attr_accessor :billing_thresholds
|
1011
1119
|
# Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.
|
1012
1120
|
sig { returns(T.nilable(String)) }
|
1013
1121
|
attr_accessor :collection_method
|
@@ -1048,7 +1156,7 @@ module Stripe
|
|
1048
1156
|
# The account on behalf of which to charge, for each of the associated subscription's invoices.
|
1049
1157
|
sig { returns(T.nilable(String)) }
|
1050
1158
|
attr_accessor :on_behalf_of
|
1051
|
-
#
|
1159
|
+
# Controls whether the subscription schedule should create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration (item price, quantity, etc.) of the current phase.
|
1052
1160
|
sig { returns(T.nilable(String)) }
|
1053
1161
|
attr_accessor :proration_behavior
|
1054
1162
|
# The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
|
@@ -1066,13 +1174,14 @@ module Stripe
|
|
1066
1174
|
sig { returns(T.nilable(T.any(Integer, String))) }
|
1067
1175
|
attr_accessor :trial_end
|
1068
1176
|
sig {
|
1069
|
-
params(add_invoice_items: T.nilable(T::Array[::Stripe::SubscriptionScheduleService::UpdateParams::Phase::AddInvoiceItem]), application_fee_percent: T.nilable(Float), automatic_tax: T.nilable(::Stripe::SubscriptionScheduleService::UpdateParams::Phase::AutomaticTax), billing_cycle_anchor: T.nilable(String), collection_method: T.nilable(String), currency: T.nilable(String), default_payment_method: T.nilable(String), default_tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), description: T.nilable(T.nilable(String)), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionScheduleService::UpdateParams::Phase::Discount]))), end_date: T.nilable(T.any(Integer, String)), invoice_settings: T.nilable(::Stripe::SubscriptionScheduleService::UpdateParams::Phase::InvoiceSettings), items: T::Array[::Stripe::SubscriptionScheduleService::UpdateParams::Phase::Item], iterations: T.nilable(Integer), metadata: T.nilable(T::Hash[String, String]), on_behalf_of: T.nilable(String), proration_behavior: T.nilable(String), start_date: T.nilable(T.any(Integer, String)), transfer_data: T.nilable(::Stripe::SubscriptionScheduleService::UpdateParams::Phase::TransferData), trial: T.nilable(T::Boolean), trial_end: T.nilable(T.any(Integer, String))).void
|
1177
|
+
params(add_invoice_items: T.nilable(T::Array[::Stripe::SubscriptionScheduleService::UpdateParams::Phase::AddInvoiceItem]), application_fee_percent: T.nilable(Float), automatic_tax: T.nilable(::Stripe::SubscriptionScheduleService::UpdateParams::Phase::AutomaticTax), billing_cycle_anchor: T.nilable(String), billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionScheduleService::UpdateParams::Phase::BillingThresholds))), collection_method: T.nilable(String), currency: T.nilable(String), default_payment_method: T.nilable(String), default_tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), description: T.nilable(T.nilable(String)), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionScheduleService::UpdateParams::Phase::Discount]))), end_date: T.nilable(T.any(Integer, String)), invoice_settings: T.nilable(::Stripe::SubscriptionScheduleService::UpdateParams::Phase::InvoiceSettings), items: T::Array[::Stripe::SubscriptionScheduleService::UpdateParams::Phase::Item], iterations: T.nilable(Integer), metadata: T.nilable(T::Hash[String, String]), on_behalf_of: T.nilable(String), proration_behavior: T.nilable(String), start_date: T.nilable(T.any(Integer, String)), transfer_data: T.nilable(::Stripe::SubscriptionScheduleService::UpdateParams::Phase::TransferData), trial: T.nilable(T::Boolean), trial_end: T.nilable(T.any(Integer, String))).void
|
1070
1178
|
}
|
1071
1179
|
def initialize(
|
1072
1180
|
add_invoice_items: nil,
|
1073
1181
|
application_fee_percent: nil,
|
1074
1182
|
automatic_tax: nil,
|
1075
1183
|
billing_cycle_anchor: nil,
|
1184
|
+
billing_thresholds: nil,
|
1076
1185
|
collection_method: nil,
|
1077
1186
|
currency: nil,
|
1078
1187
|
default_payment_method: nil,
|
@@ -1111,7 +1220,7 @@ module Stripe
|
|
1111
1220
|
returns(T.nilable(T::Array[::Stripe::SubscriptionScheduleService::UpdateParams::Phase]))
|
1112
1221
|
}
|
1113
1222
|
attr_accessor :phases
|
1114
|
-
# If the update changes the current phase, indicates
|
1223
|
+
# If the update changes the billing configuration (item price, quantity, etc.) of the current phase, indicates how prorations from this change should be handled. The default value is `create_prorations`.
|
1115
1224
|
sig { returns(T.nilable(String)) }
|
1116
1225
|
attr_accessor :proration_behavior
|
1117
1226
|
sig {
|