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
@@ -6,7 +6,7 @@ module Stripe
|
|
6
6
|
attr_reader :transactions
|
7
7
|
|
8
8
|
def initialize(requestor)
|
9
|
-
super
|
9
|
+
super
|
10
10
|
@transactions = Stripe::SourceTransactionService.new(@requestor)
|
11
11
|
end
|
12
12
|
|
@@ -640,7 +640,7 @@ module Stripe
|
|
640
640
|
|
641
641
|
# Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
642
642
|
#
|
643
|
-
# 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.
|
643
|
+
# 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.
|
644
644
|
def update(source, params = {}, opts = {})
|
645
645
|
request(
|
646
646
|
method: :post,
|
@@ -28,6 +28,15 @@ module Stripe
|
|
28
28
|
end
|
29
29
|
|
30
30
|
class UpdateParams < Stripe::RequestParams
|
31
|
+
class BillingThresholds < Stripe::RequestParams
|
32
|
+
# 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))
|
33
|
+
attr_accessor :usage_gte
|
34
|
+
|
35
|
+
def initialize(usage_gte: nil)
|
36
|
+
@usage_gte = usage_gte
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
31
40
|
class Discount < Stripe::RequestParams
|
32
41
|
# ID of the coupon to create a new discount for.
|
33
42
|
attr_accessor :coupon
|
@@ -84,6 +93,8 @@ module Stripe
|
|
84
93
|
@unit_amount_decimal = unit_amount_decimal
|
85
94
|
end
|
86
95
|
end
|
96
|
+
# 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.
|
97
|
+
attr_accessor :billing_thresholds
|
87
98
|
# The coupons to redeem into discounts for the subscription item.
|
88
99
|
attr_accessor :discounts
|
89
100
|
# Specifies which fields in the response should be expanded.
|
@@ -116,6 +127,7 @@ module Stripe
|
|
116
127
|
attr_accessor :tax_rates
|
117
128
|
|
118
129
|
def initialize(
|
130
|
+
billing_thresholds: nil,
|
119
131
|
discounts: nil,
|
120
132
|
expand: nil,
|
121
133
|
metadata: nil,
|
@@ -129,6 +141,7 @@ module Stripe
|
|
129
141
|
quantity: nil,
|
130
142
|
tax_rates: nil
|
131
143
|
)
|
144
|
+
@billing_thresholds = billing_thresholds
|
132
145
|
@discounts = discounts
|
133
146
|
@expand = expand
|
134
147
|
@metadata = metadata
|
@@ -172,6 +185,15 @@ module Stripe
|
|
172
185
|
end
|
173
186
|
|
174
187
|
class CreateParams < Stripe::RequestParams
|
188
|
+
class BillingThresholds < Stripe::RequestParams
|
189
|
+
# 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))
|
190
|
+
attr_accessor :usage_gte
|
191
|
+
|
192
|
+
def initialize(usage_gte: nil)
|
193
|
+
@usage_gte = usage_gte
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
175
197
|
class Discount < Stripe::RequestParams
|
176
198
|
# ID of the coupon to create a new discount for.
|
177
199
|
attr_accessor :coupon
|
@@ -228,6 +250,8 @@ module Stripe
|
|
228
250
|
@unit_amount_decimal = unit_amount_decimal
|
229
251
|
end
|
230
252
|
end
|
253
|
+
# 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.
|
254
|
+
attr_accessor :billing_thresholds
|
231
255
|
# The coupons to redeem into discounts for the subscription item.
|
232
256
|
attr_accessor :discounts
|
233
257
|
# Specifies which fields in the response should be expanded.
|
@@ -260,6 +284,7 @@ module Stripe
|
|
260
284
|
attr_accessor :tax_rates
|
261
285
|
|
262
286
|
def initialize(
|
287
|
+
billing_thresholds: nil,
|
263
288
|
discounts: nil,
|
264
289
|
expand: nil,
|
265
290
|
metadata: nil,
|
@@ -273,6 +298,7 @@ module Stripe
|
|
273
298
|
subscription: nil,
|
274
299
|
tax_rates: nil
|
275
300
|
)
|
301
|
+
@billing_thresholds = billing_thresholds
|
276
302
|
@discounts = discounts
|
277
303
|
@expand = expand
|
278
304
|
@metadata = metadata
|
@@ -122,6 +122,15 @@ module Stripe
|
|
122
122
|
end
|
123
123
|
|
124
124
|
class CreateParams < Stripe::RequestParams
|
125
|
+
class BillingMode < Stripe::RequestParams
|
126
|
+
# Attribute for param field type
|
127
|
+
attr_accessor :type
|
128
|
+
|
129
|
+
def initialize(type: nil)
|
130
|
+
@type = type
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
125
134
|
class DefaultSettings < Stripe::RequestParams
|
126
135
|
class AutomaticTax < Stripe::RequestParams
|
127
136
|
class Liability < Stripe::RequestParams
|
@@ -146,6 +155,18 @@ module Stripe
|
|
146
155
|
end
|
147
156
|
end
|
148
157
|
|
158
|
+
class BillingThresholds < Stripe::RequestParams
|
159
|
+
# Monetary threshold that triggers the subscription to advance to a new billing period
|
160
|
+
attr_accessor :amount_gte
|
161
|
+
# 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.
|
162
|
+
attr_accessor :reset_billing_cycle_anchor
|
163
|
+
|
164
|
+
def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil)
|
165
|
+
@amount_gte = amount_gte
|
166
|
+
@reset_billing_cycle_anchor = reset_billing_cycle_anchor
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
149
170
|
class InvoiceSettings < Stripe::RequestParams
|
150
171
|
class Issuer < Stripe::RequestParams
|
151
172
|
# The connected account being referenced when `type` is `account`.
|
@@ -189,6 +210,8 @@ module Stripe
|
|
189
210
|
attr_accessor :automatic_tax
|
190
211
|
# 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).
|
191
212
|
attr_accessor :billing_cycle_anchor
|
213
|
+
# 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.
|
214
|
+
attr_accessor :billing_thresholds
|
192
215
|
# 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.
|
193
216
|
attr_accessor :collection_method
|
194
217
|
# ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.
|
@@ -206,6 +229,7 @@ module Stripe
|
|
206
229
|
application_fee_percent: nil,
|
207
230
|
automatic_tax: nil,
|
208
231
|
billing_cycle_anchor: nil,
|
232
|
+
billing_thresholds: nil,
|
209
233
|
collection_method: nil,
|
210
234
|
default_payment_method: nil,
|
211
235
|
description: nil,
|
@@ -216,6 +240,7 @@ module Stripe
|
|
216
240
|
@application_fee_percent = application_fee_percent
|
217
241
|
@automatic_tax = automatic_tax
|
218
242
|
@billing_cycle_anchor = billing_cycle_anchor
|
243
|
+
@billing_thresholds = billing_thresholds
|
219
244
|
@collection_method = collection_method
|
220
245
|
@default_payment_method = default_payment_method
|
221
246
|
@description = description
|
@@ -311,6 +336,18 @@ module Stripe
|
|
311
336
|
end
|
312
337
|
end
|
313
338
|
|
339
|
+
class BillingThresholds < Stripe::RequestParams
|
340
|
+
# Monetary threshold that triggers the subscription to advance to a new billing period
|
341
|
+
attr_accessor :amount_gte
|
342
|
+
# 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.
|
343
|
+
attr_accessor :reset_billing_cycle_anchor
|
344
|
+
|
345
|
+
def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil)
|
346
|
+
@amount_gte = amount_gte
|
347
|
+
@reset_billing_cycle_anchor = reset_billing_cycle_anchor
|
348
|
+
end
|
349
|
+
end
|
350
|
+
|
314
351
|
class Discount < Stripe::RequestParams
|
315
352
|
# ID of the coupon to create a new discount for.
|
316
353
|
attr_accessor :coupon
|
@@ -353,6 +390,15 @@ module Stripe
|
|
353
390
|
end
|
354
391
|
|
355
392
|
class Item < Stripe::RequestParams
|
393
|
+
class BillingThresholds < Stripe::RequestParams
|
394
|
+
# 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))
|
395
|
+
attr_accessor :usage_gte
|
396
|
+
|
397
|
+
def initialize(usage_gte: nil)
|
398
|
+
@usage_gte = usage_gte
|
399
|
+
end
|
400
|
+
end
|
401
|
+
|
356
402
|
class Discount < Stripe::RequestParams
|
357
403
|
# ID of the coupon to create a new discount for.
|
358
404
|
attr_accessor :coupon
|
@@ -409,6 +455,8 @@ module Stripe
|
|
409
455
|
@unit_amount_decimal = unit_amount_decimal
|
410
456
|
end
|
411
457
|
end
|
458
|
+
# 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.
|
459
|
+
attr_accessor :billing_thresholds
|
412
460
|
# The coupons to redeem into discounts for the subscription item.
|
413
461
|
attr_accessor :discounts
|
414
462
|
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`.
|
@@ -425,6 +473,7 @@ module Stripe
|
|
425
473
|
attr_accessor :tax_rates
|
426
474
|
|
427
475
|
def initialize(
|
476
|
+
billing_thresholds: nil,
|
428
477
|
discounts: nil,
|
429
478
|
metadata: nil,
|
430
479
|
plan: nil,
|
@@ -433,6 +482,7 @@ module Stripe
|
|
433
482
|
quantity: nil,
|
434
483
|
tax_rates: nil
|
435
484
|
)
|
485
|
+
@billing_thresholds = billing_thresholds
|
436
486
|
@discounts = discounts
|
437
487
|
@metadata = metadata
|
438
488
|
@plan = plan
|
@@ -462,6 +512,8 @@ module Stripe
|
|
462
512
|
attr_accessor :automatic_tax
|
463
513
|
# 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).
|
464
514
|
attr_accessor :billing_cycle_anchor
|
515
|
+
# 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.
|
516
|
+
attr_accessor :billing_thresholds
|
465
517
|
# 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.
|
466
518
|
attr_accessor :collection_method
|
467
519
|
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
@@ -486,7 +538,7 @@ module Stripe
|
|
486
538
|
attr_accessor :metadata
|
487
539
|
# The account on behalf of which to charge, for each of the associated subscription's invoices.
|
488
540
|
attr_accessor :on_behalf_of
|
489
|
-
#
|
541
|
+
# 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.
|
490
542
|
attr_accessor :proration_behavior
|
491
543
|
# The data with which to automatically create a Transfer for each of the associated subscription's invoices.
|
492
544
|
attr_accessor :transfer_data
|
@@ -500,6 +552,7 @@ module Stripe
|
|
500
552
|
application_fee_percent: nil,
|
501
553
|
automatic_tax: nil,
|
502
554
|
billing_cycle_anchor: nil,
|
555
|
+
billing_thresholds: nil,
|
503
556
|
collection_method: nil,
|
504
557
|
currency: nil,
|
505
558
|
default_payment_method: nil,
|
@@ -521,6 +574,7 @@ module Stripe
|
|
521
574
|
@application_fee_percent = application_fee_percent
|
522
575
|
@automatic_tax = automatic_tax
|
523
576
|
@billing_cycle_anchor = billing_cycle_anchor
|
577
|
+
@billing_thresholds = billing_thresholds
|
524
578
|
@collection_method = collection_method
|
525
579
|
@currency = currency
|
526
580
|
@default_payment_method = default_payment_method
|
@@ -539,6 +593,8 @@ module Stripe
|
|
539
593
|
@trial_end = trial_end
|
540
594
|
end
|
541
595
|
end
|
596
|
+
# Controls how prorations and invoices for subscriptions are calculated and orchestrated.
|
597
|
+
attr_accessor :billing_mode
|
542
598
|
# The identifier of the customer to create the subscription schedule for.
|
543
599
|
attr_accessor :customer
|
544
600
|
# Object representing the subscription schedule's default settings.
|
@@ -557,6 +613,7 @@ module Stripe
|
|
557
613
|
attr_accessor :start_date
|
558
614
|
|
559
615
|
def initialize(
|
616
|
+
billing_mode: nil,
|
560
617
|
customer: nil,
|
561
618
|
default_settings: nil,
|
562
619
|
end_behavior: nil,
|
@@ -566,6 +623,7 @@ module Stripe
|
|
566
623
|
phases: nil,
|
567
624
|
start_date: nil
|
568
625
|
)
|
626
|
+
@billing_mode = billing_mode
|
569
627
|
@customer = customer
|
570
628
|
@default_settings = default_settings
|
571
629
|
@end_behavior = end_behavior
|
@@ -611,6 +669,18 @@ module Stripe
|
|
611
669
|
end
|
612
670
|
end
|
613
671
|
|
672
|
+
class BillingThresholds < Stripe::RequestParams
|
673
|
+
# Monetary threshold that triggers the subscription to advance to a new billing period
|
674
|
+
attr_accessor :amount_gte
|
675
|
+
# 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.
|
676
|
+
attr_accessor :reset_billing_cycle_anchor
|
677
|
+
|
678
|
+
def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil)
|
679
|
+
@amount_gte = amount_gte
|
680
|
+
@reset_billing_cycle_anchor = reset_billing_cycle_anchor
|
681
|
+
end
|
682
|
+
end
|
683
|
+
|
614
684
|
class InvoiceSettings < Stripe::RequestParams
|
615
685
|
class Issuer < Stripe::RequestParams
|
616
686
|
# The connected account being referenced when `type` is `account`.
|
@@ -654,6 +724,8 @@ module Stripe
|
|
654
724
|
attr_accessor :automatic_tax
|
655
725
|
# 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).
|
656
726
|
attr_accessor :billing_cycle_anchor
|
727
|
+
# 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.
|
728
|
+
attr_accessor :billing_thresholds
|
657
729
|
# 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.
|
658
730
|
attr_accessor :collection_method
|
659
731
|
# ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.
|
@@ -671,6 +743,7 @@ module Stripe
|
|
671
743
|
application_fee_percent: nil,
|
672
744
|
automatic_tax: nil,
|
673
745
|
billing_cycle_anchor: nil,
|
746
|
+
billing_thresholds: nil,
|
674
747
|
collection_method: nil,
|
675
748
|
default_payment_method: nil,
|
676
749
|
description: nil,
|
@@ -681,6 +754,7 @@ module Stripe
|
|
681
754
|
@application_fee_percent = application_fee_percent
|
682
755
|
@automatic_tax = automatic_tax
|
683
756
|
@billing_cycle_anchor = billing_cycle_anchor
|
757
|
+
@billing_thresholds = billing_thresholds
|
684
758
|
@collection_method = collection_method
|
685
759
|
@default_payment_method = default_payment_method
|
686
760
|
@description = description
|
@@ -776,6 +850,18 @@ module Stripe
|
|
776
850
|
end
|
777
851
|
end
|
778
852
|
|
853
|
+
class BillingThresholds < Stripe::RequestParams
|
854
|
+
# Monetary threshold that triggers the subscription to advance to a new billing period
|
855
|
+
attr_accessor :amount_gte
|
856
|
+
# 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.
|
857
|
+
attr_accessor :reset_billing_cycle_anchor
|
858
|
+
|
859
|
+
def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil)
|
860
|
+
@amount_gte = amount_gte
|
861
|
+
@reset_billing_cycle_anchor = reset_billing_cycle_anchor
|
862
|
+
end
|
863
|
+
end
|
864
|
+
|
779
865
|
class Discount < Stripe::RequestParams
|
780
866
|
# ID of the coupon to create a new discount for.
|
781
867
|
attr_accessor :coupon
|
@@ -818,6 +904,15 @@ module Stripe
|
|
818
904
|
end
|
819
905
|
|
820
906
|
class Item < Stripe::RequestParams
|
907
|
+
class BillingThresholds < Stripe::RequestParams
|
908
|
+
# 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))
|
909
|
+
attr_accessor :usage_gte
|
910
|
+
|
911
|
+
def initialize(usage_gte: nil)
|
912
|
+
@usage_gte = usage_gte
|
913
|
+
end
|
914
|
+
end
|
915
|
+
|
821
916
|
class Discount < Stripe::RequestParams
|
822
917
|
# ID of the coupon to create a new discount for.
|
823
918
|
attr_accessor :coupon
|
@@ -874,6 +969,8 @@ module Stripe
|
|
874
969
|
@unit_amount_decimal = unit_amount_decimal
|
875
970
|
end
|
876
971
|
end
|
972
|
+
# 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.
|
973
|
+
attr_accessor :billing_thresholds
|
877
974
|
# The coupons to redeem into discounts for the subscription item.
|
878
975
|
attr_accessor :discounts
|
879
976
|
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`.
|
@@ -890,6 +987,7 @@ module Stripe
|
|
890
987
|
attr_accessor :tax_rates
|
891
988
|
|
892
989
|
def initialize(
|
990
|
+
billing_thresholds: nil,
|
893
991
|
discounts: nil,
|
894
992
|
metadata: nil,
|
895
993
|
plan: nil,
|
@@ -898,6 +996,7 @@ module Stripe
|
|
898
996
|
quantity: nil,
|
899
997
|
tax_rates: nil
|
900
998
|
)
|
999
|
+
@billing_thresholds = billing_thresholds
|
901
1000
|
@discounts = discounts
|
902
1001
|
@metadata = metadata
|
903
1002
|
@plan = plan
|
@@ -927,6 +1026,8 @@ module Stripe
|
|
927
1026
|
attr_accessor :automatic_tax
|
928
1027
|
# 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).
|
929
1028
|
attr_accessor :billing_cycle_anchor
|
1029
|
+
# 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.
|
1030
|
+
attr_accessor :billing_thresholds
|
930
1031
|
# 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.
|
931
1032
|
attr_accessor :collection_method
|
932
1033
|
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
@@ -951,7 +1052,7 @@ module Stripe
|
|
951
1052
|
attr_accessor :metadata
|
952
1053
|
# The account on behalf of which to charge, for each of the associated subscription's invoices.
|
953
1054
|
attr_accessor :on_behalf_of
|
954
|
-
#
|
1055
|
+
# 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.
|
955
1056
|
attr_accessor :proration_behavior
|
956
1057
|
# The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
|
957
1058
|
attr_accessor :start_date
|
@@ -967,6 +1068,7 @@ module Stripe
|
|
967
1068
|
application_fee_percent: nil,
|
968
1069
|
automatic_tax: nil,
|
969
1070
|
billing_cycle_anchor: nil,
|
1071
|
+
billing_thresholds: nil,
|
970
1072
|
collection_method: nil,
|
971
1073
|
currency: nil,
|
972
1074
|
default_payment_method: nil,
|
@@ -989,6 +1091,7 @@ module Stripe
|
|
989
1091
|
@application_fee_percent = application_fee_percent
|
990
1092
|
@automatic_tax = automatic_tax
|
991
1093
|
@billing_cycle_anchor = billing_cycle_anchor
|
1094
|
+
@billing_thresholds = billing_thresholds
|
992
1095
|
@collection_method = collection_method
|
993
1096
|
@currency = currency
|
994
1097
|
@default_payment_method = default_payment_method
|
@@ -1018,7 +1121,7 @@ module Stripe
|
|
1018
1121
|
attr_accessor :metadata
|
1019
1122
|
# List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. Note that past phases can be omitted.
|
1020
1123
|
attr_accessor :phases
|
1021
|
-
# If the update changes the current phase, indicates
|
1124
|
+
# 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`.
|
1022
1125
|
attr_accessor :proration_behavior
|
1023
1126
|
|
1024
1127
|
def initialize(
|