stripe 15.2.0.pre.beta.1 → 15.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +718 -1556
- data/CONTRIBUTING.md +25 -0
- data/OPENAPI_VERSION +1 -1
- data/README.md +10 -7
- data/VERSION +1 -1
- data/lib/stripe/api_requestor.rb +0 -28
- data/lib/stripe/api_version.rb +1 -1
- data/lib/stripe/errors.rb +0 -54
- data/lib/stripe/event_types.rb +0 -89
- data/lib/stripe/object_types.rb +0 -52
- data/lib/stripe/resources/account.rb +32 -657
- data/lib/stripe/resources/account_session.rb +59 -253
- 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/credit_balance_summary.rb +0 -2
- data/lib/stripe/resources/billing/credit_balance_transaction.rb +0 -4
- data/lib/stripe/resources/billing/credit_grant.rb +0 -10
- data/lib/stripe/resources/billing_portal/session.rb +1 -7
- data/lib/stripe/resources/capability.rb +1 -1
- data/lib/stripe/resources/card.rb +0 -2
- data/lib/stripe/resources/cash_balance.rb +0 -2
- data/lib/stripe/resources/charge.rb +13 -1475
- data/lib/stripe/resources/checkout/session.rb +21 -333
- data/lib/stripe/resources/confirmation_token.rb +33 -263
- data/lib/stripe/resources/country_spec.rb +1 -1
- data/lib/stripe/resources/coupon.rb +2 -32
- data/lib/stripe/resources/credit_note.rb +10 -17
- data/lib/stripe/resources/credit_note_line_item.rb +0 -9
- data/lib/stripe/resources/customer.rb +2 -6
- data/lib/stripe/resources/customer_balance_transaction.rb +0 -2
- data/lib/stripe/resources/customer_cash_balance_transaction.rb +0 -2
- data/lib/stripe/resources/customer_session.rb +4 -9
- data/lib/stripe/resources/discount.rb +0 -2
- data/lib/stripe/resources/dispute.rb +2 -2
- data/lib/stripe/resources/event.rb +1 -32
- data/lib/stripe/resources/file.rb +1 -1
- data/lib/stripe/resources/financial_connections/account.rb +1 -20
- data/lib/stripe/resources/financial_connections/session.rb +2 -62
- data/lib/stripe/resources/identity/verification_report.rb +6 -0
- data/lib/stripe/resources/identity/verification_session.rb +17 -21
- data/lib/stripe/resources/invoice.rb +79 -1106
- data/lib/stripe/resources/invoice_item.rb +4 -81
- data/lib/stripe/resources/invoice_line_item.rb +2 -56
- data/lib/stripe/resources/invoice_payment.rb +62 -4
- data/lib/stripe/resources/issuing/authorization.rb +8 -8
- data/lib/stripe/resources/issuing/card.rb +1 -1
- data/lib/stripe/resources/issuing/cardholder.rb +1 -2
- data/lib/stripe/resources/issuing/dispute.rb +3 -3
- data/lib/stripe/resources/issuing/transaction.rb +0 -6
- data/lib/stripe/resources/line_item.rb +0 -37
- data/lib/stripe/resources/mandate.rb +0 -24
- data/lib/stripe/resources/payment_intent.rb +1912 -6840
- data/lib/stripe/resources/payment_method.rb +47 -301
- data/lib/stripe/resources/payment_method_configuration.rb +112 -112
- data/lib/stripe/resources/payment_method_domain.rb +2 -2
- data/lib/stripe/resources/payout.rb +4 -10
- data/lib/stripe/resources/person.rb +2 -2
- data/lib/stripe/resources/plan.rb +2 -3
- data/lib/stripe/resources/price.rb +1 -31
- data/lib/stripe/resources/product.rb +1 -61
- data/lib/stripe/resources/promotion_code.rb +0 -10
- data/lib/stripe/resources/quote.rb +6 -2046
- 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 +6 -10
- data/lib/stripe/resources/reversal.rb +1 -1
- data/lib/stripe/resources/review.rb +1 -1
- data/lib/stripe/resources/setup_attempt.rb +0 -21
- data/lib/stripe/resources/setup_intent.rb +120 -877
- data/lib/stripe/resources/source.rb +1 -30
- data/lib/stripe/resources/subscription.rb +97 -326
- data/lib/stripe/resources/subscription_item.rb +32 -80
- data/lib/stripe/resources/subscription_schedule.rb +127 -1015
- data/lib/stripe/resources/tax/calculation.rb +4 -0
- data/lib/stripe/resources/tax/calculation_line_item.rb +2 -0
- data/lib/stripe/resources/tax/registration.rb +1 -1
- data/lib/stripe/resources/tax_id.rb +3 -14
- data/lib/stripe/resources/tax_rate.rb +2 -2
- data/lib/stripe/resources/terminal/configuration.rb +1 -2
- data/lib/stripe/resources/terminal/location.rb +2 -3
- data/lib/stripe/resources/terminal/reader.rb +8 -142
- data/lib/stripe/resources/test_helpers/test_clock.rb +1 -2
- data/lib/stripe/resources/token.rb +2 -2
- data/lib/stripe/resources/transfer.rb +1 -7
- data/lib/stripe/resources/treasury/financial_account.rb +3 -22
- data/lib/stripe/resources/treasury/financial_account_features.rb +0 -2
- data/lib/stripe/resources/treasury/outbound_transfer.rb +0 -37
- data/lib/stripe/resources/treasury/received_credit.rb +1 -38
- data/lib/stripe/resources/treasury/received_debit.rb +1 -40
- data/lib/stripe/resources/webhook_endpoint.rb +1 -2
- data/lib/stripe/resources.rb +0 -99
- data/lib/stripe/services/account_external_account_service.rb +2 -3
- data/lib/stripe/services/account_login_link_service.rb +1 -1
- data/lib/stripe/services/account_person_service.rb +1 -2
- data/lib/stripe/services/account_service.rb +23 -559
- data/lib/stripe/services/account_session_service.rb +29 -229
- data/lib/stripe/services/apple_pay_domain_service.rb +1 -2
- data/lib/stripe/services/balance_service.rb +1 -1
- data/lib/stripe/services/billing/credit_balance_summary_service.rb +1 -4
- data/lib/stripe/services/billing/credit_balance_transaction_service.rb +0 -4
- data/lib/stripe/services/billing/credit_grant_service.rb +0 -8
- data/lib/stripe/services/billing_portal/session_service.rb +0 -4
- data/lib/stripe/services/charge_service.rb +4 -1354
- data/lib/stripe/services/checkout/session_service.rb +13 -250
- data/lib/stripe/services/coupon_service.rb +2 -19
- data/lib/stripe/services/credit_note_service.rb +7 -12
- 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_source_service.rb +1 -1
- data/lib/stripe/services/customer_service.rb +3 -5
- data/lib/stripe/services/customer_session_service.rb +1 -4
- data/lib/stripe/services/customer_tax_id_service.rb +1 -2
- data/lib/stripe/services/dispute_service.rb +1 -1
- data/lib/stripe/services/file_service.rb +1 -1
- data/lib/stripe/services/financial_connections/account_service.rb +2 -7
- data/lib/stripe/services/financial_connections/session_service.rb +2 -34
- data/lib/stripe/services/financial_connections_service.rb +1 -2
- data/lib/stripe/services/identity/verification_session_service.rb +5 -13
- data/lib/stripe/services/invoice_item_service.rb +3 -76
- data/lib/stripe/services/invoice_line_item_service.rb +1 -33
- data/lib/stripe/services/invoice_payment_service.rb +83 -0
- data/lib/stripe/services/invoice_service.rb +74 -1049
- 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/cardholder_service.rb +1 -2
- data/lib/stripe/services/issuing/dispute_service.rb +2 -2
- data/lib/stripe/services/issuing/transaction_service.rb +0 -4
- data/lib/stripe/services/issuing_service.rb +1 -5
- data/lib/stripe/services/payment_intent_service.rb +439 -4928
- data/lib/stripe/services/payment_method_configuration_service.rb +82 -82
- data/lib/stripe/services/payment_method_domain_service.rb +1 -1
- data/lib/stripe/services/payment_method_service.rb +44 -226
- data/lib/stripe/services/payout_service.rb +2 -6
- data/lib/stripe/services/plan_service.rb +2 -3
- data/lib/stripe/services/price_service.rb +2 -21
- data/lib/stripe/services/product_feature_service.rb +1 -2
- data/lib/stripe/services/product_service.rb +2 -41
- data/lib/stripe/services/promotion_code_service.rb +1 -9
- data/lib/stripe/services/quote_service.rb +7 -1730
- 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/setup_intent_service.rb +119 -836
- data/lib/stripe/services/source_service.rb +1 -1
- data/lib/stripe/services/subscription_item_service.rb +27 -73
- data/lib/stripe/services/subscription_schedule_service.rb +101 -916
- data/lib/stripe/services/subscription_service.rb +85 -282
- data/lib/stripe/services/tax/calculation_service.rb +4 -0
- data/lib/stripe/services/tax/registration_service.rb +1 -1
- data/lib/stripe/services/tax_id_service.rb +3 -10
- data/lib/stripe/services/tax_service.rb +1 -3
- 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 +5 -81
- data/lib/stripe/services/terminal_service.rb +1 -2
- data/lib/stripe/services/test_helpers/confirmation_token_service.rb +33 -190
- data/lib/stripe/services/test_helpers/test_clock_service.rb +1 -2
- data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +1 -25
- data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +1 -25
- data/lib/stripe/services/token_service.rb +1 -1
- data/lib/stripe/services/transfer_service.rb +1 -5
- data/lib/stripe/services/treasury/financial_account_features_service.rb +1 -4
- data/lib/stripe/services/treasury/financial_account_service.rb +2 -16
- data/lib/stripe/services/treasury/outbound_transfer_service.rb +0 -24
- data/lib/stripe/services/v1_services.rb +2 -12
- data/lib/stripe/services/v2/billing/meter_event_session_service.rb +1 -2
- data/lib/stripe/services/v2/core/event_destination_service.rb +4 -10
- data/lib/stripe/services/v2/core/event_service.rb +1 -2
- data/lib/stripe/services/v2/core_service.rb +1 -4
- data/lib/stripe/services/v2_services.rb +2 -4
- data/lib/stripe/services/webhook_endpoint_service.rb +1 -2
- data/lib/stripe/services.rb +1 -54
- data/lib/stripe/stripe_configuration.rb +1 -3
- data/lib/stripe/stripe_object.rb +1 -1
- data/lib/stripe/util.rb +1 -7
- data/lib/stripe/version.rb +1 -1
- data/lib/stripe.rb +0 -53
- data/rbi/stripe/resources/account.rbi +4926 -0
- data/rbi/stripe/resources/account_link.rbi +74 -0
- data/rbi/stripe/resources/account_session.rbi +1013 -0
- data/rbi/stripe/resources/apple_pay_domain.rbi +88 -0
- data/rbi/stripe/resources/application.rbi +20 -0
- data/rbi/stripe/resources/application_fee.rbi +118 -0
- data/rbi/stripe/resources/application_fee_refund.rbi +37 -0
- data/rbi/stripe/resources/apps/secret.rbi +195 -0
- data/rbi/stripe/resources/balance.rbi +235 -0
- data/rbi/stripe/resources/balance_transaction.rbi +147 -0
- data/rbi/stripe/resources/bank_account.rbi +127 -0
- data/rbi/stripe/resources/billing/alert.rbi +201 -0
- data/rbi/stripe/resources/billing/alert_triggered.rbi +28 -0
- data/rbi/stripe/resources/billing/credit_balance_summary.rbi +63 -0
- data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +147 -0
- data/rbi/stripe/resources/billing/credit_grant.rbi +291 -0
- data/rbi/stripe/resources/billing/meter.rbi +226 -0
- data/rbi/stripe/resources/billing/meter_event.rbi +64 -0
- data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +64 -0
- data/rbi/stripe/resources/billing/meter_event_summary.rbi +35 -0
- data/rbi/stripe/resources/billing_portal/configuration.rbi +645 -0
- data/rbi/stripe/resources/billing_portal/session.rbi +345 -0
- data/rbi/stripe/resources/capability.rbi +125 -0
- data/rbi/stripe/resources/card.rbi +125 -0
- data/rbi/stripe/resources/cash_balance.rbi +32 -0
- data/rbi/stripe/resources/charge.rbi +2069 -0
- data/rbi/stripe/resources/checkout/session.rbi +4004 -0
- data/rbi/stripe/resources/climate/order.rbi +245 -0
- data/rbi/stripe/resources/climate/product.rbi +75 -0
- data/rbi/stripe/resources/climate/supplier.rbi +72 -0
- data/rbi/stripe/resources/confirmation_token.rbi +1807 -0
- data/rbi/stripe/resources/connect_collection_transfer.rbi +26 -0
- data/rbi/stripe/resources/country_spec.rbi +85 -0
- data/rbi/stripe/resources/coupon.rbi +250 -0
- data/rbi/stripe/resources/credit_note.rbi +752 -0
- data/rbi/stripe/resources/credit_note_line_item.rbi +101 -0
- data/rbi/stripe/resources/customer.rbi +1005 -0
- data/rbi/stripe/resources/customer_balance_transaction.rbi +56 -0
- data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +151 -0
- data/rbi/stripe/resources/customer_session.rbi +200 -0
- data/rbi/stripe/resources/discount.rbi +53 -0
- data/rbi/stripe/resources/dispute.rbi +761 -0
- data/rbi/stripe/resources/entitlements/active_entitlement.rbi +58 -0
- data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +23 -0
- data/rbi/stripe/resources/entitlements/feature.rbi +117 -0
- data/rbi/stripe/resources/ephemeral_key.rbi +44 -0
- data/rbi/stripe/resources/event.rbi +149 -0
- data/rbi/stripe/resources/exchange_rate.rbi +66 -0
- data/rbi/stripe/resources/file.rbi +143 -0
- data/rbi/stripe/resources/file_link.rbi +141 -0
- data/rbi/stripe/resources/financial_connections/account.rbi +339 -0
- data/rbi/stripe/resources/financial_connections/account_owner.rbi +35 -0
- data/rbi/stripe/resources/financial_connections/account_ownership.rbi +23 -0
- data/rbi/stripe/resources/financial_connections/session.rbi +123 -0
- data/rbi/stripe/resources/financial_connections/transaction.rbi +124 -0
- data/rbi/stripe/resources/forwarding/request.rbi +216 -0
- data/rbi/stripe/resources/funding_instructions.rbi +437 -0
- data/rbi/stripe/resources/identity/verification_report.rbi +360 -0
- data/rbi/stripe/resources/identity/verification_session.rbi +526 -0
- data/rbi/stripe/resources/invoice.rbi +3812 -0
- data/rbi/stripe/resources/invoice_item.rbi +473 -0
- data/rbi/stripe/resources/invoice_line_item.rbi +432 -0
- data/rbi/stripe/resources/invoice_payment.rbi +121 -0
- data/rbi/stripe/resources/invoice_rendering_template.rbi +104 -0
- data/rbi/stripe/resources/issuing/authorization.rbi +1283 -0
- data/rbi/stripe/resources/issuing/card.rbi +741 -0
- data/rbi/stripe/resources/issuing/cardholder.rbi +744 -0
- data/rbi/stripe/resources/issuing/dispute.rbi +913 -0
- data/rbi/stripe/resources/issuing/personalization_design.rbi +338 -0
- data/rbi/stripe/resources/issuing/physical_bundle.rbi +79 -0
- data/rbi/stripe/resources/issuing/token.rbi +226 -0
- data/rbi/stripe/resources/issuing/transaction.rbi +1061 -0
- data/rbi/stripe/resources/line_item.rbi +72 -0
- data/rbi/stripe/resources/login_link.rbi +19 -0
- data/rbi/stripe/resources/mandate.rbi +187 -0
- data/rbi/stripe/resources/payment_intent.rbi +9647 -0
- data/rbi/stripe/resources/payment_link.rbi +1801 -0
- data/rbi/stripe/resources/payment_method.rbi +1761 -0
- data/rbi/stripe/resources/payment_method_configuration.rbi +3550 -0
- data/rbi/stripe/resources/payment_method_domain.rbi +228 -0
- data/rbi/stripe/resources/payout.rbi +300 -0
- data/rbi/stripe/resources/person.rbi +401 -0
- data/rbi/stripe/resources/plan.rbi +371 -0
- data/rbi/stripe/resources/price.rbi +694 -0
- data/rbi/stripe/resources/product.rbi +555 -0
- data/rbi/stripe/resources/product_feature.rbi +26 -0
- data/rbi/stripe/resources/promotion_code.rbi +261 -0
- data/rbi/stripe/resources/quote.rbi +1126 -0
- data/rbi/stripe/resources/radar/early_fraud_warning.rbi +98 -0
- data/rbi/stripe/resources/radar/value_list.rbi +168 -0
- data/rbi/stripe/resources/radar/value_list_item.rbi +129 -0
- data/rbi/stripe/resources/refund.rbi +523 -0
- data/rbi/stripe/resources/reporting/report_run.rbi +191 -0
- data/rbi/stripe/resources/reporting/report_type.rbi +57 -0
- data/rbi/stripe/resources/reserve_transaction.rbi +23 -0
- data/rbi/stripe/resources/reversal.rbi +51 -0
- data/rbi/stripe/resources/review.rbi +154 -0
- data/rbi/stripe/resources/setup_attempt.rbi +477 -0
- data/rbi/stripe/resources/setup_intent.rbi +3655 -0
- data/rbi/stripe/resources/shipping_rate.rbi +305 -0
- data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +75 -0
- data/rbi/stripe/resources/source.rbi +1496 -0
- data/rbi/stripe/resources/source_mandate_notification.rbi +77 -0
- data/rbi/stripe/resources/source_transaction.rbi +127 -0
- data/rbi/stripe/resources/subscription.rbi +2027 -0
- data/rbi/stripe/resources/subscription_item.rbi +404 -0
- data/rbi/stripe/resources/subscription_schedule.rbi +1623 -0
- data/rbi/stripe/resources/tax/calculation.rbi +478 -0
- data/rbi/stripe/resources/tax/calculation_line_item.rbi +91 -0
- data/rbi/stripe/resources/tax/registration.rbi +2713 -0
- data/rbi/stripe/resources/tax/settings.rbi +141 -0
- data/rbi/stripe/resources/tax/transaction.rbi +351 -0
- data/rbi/stripe/resources/tax/transaction_line_item.rbi +54 -0
- data/rbi/stripe/resources/tax_code.rbi +44 -0
- data/rbi/stripe/resources/tax_deducted_at_source.rbi +23 -0
- data/rbi/stripe/resources/tax_id.rbi +165 -0
- data/rbi/stripe/resources/tax_rate.rbi +239 -0
- data/rbi/stripe/resources/terminal/configuration.rbi +1386 -0
- data/rbi/stripe/resources/terminal/connection_token.rbi +37 -0
- data/rbi/stripe/resources/terminal/location.rbi +222 -0
- data/rbi/stripe/resources/terminal/reader.rbi +847 -0
- data/rbi/stripe/resources/test_helpers/test_clock.rbi +132 -0
- data/rbi/stripe/resources/token.rbi +1283 -0
- data/rbi/stripe/resources/topup.rbi +222 -0
- data/rbi/stripe/resources/transfer.rbi +199 -0
- data/rbi/stripe/resources/treasury/credit_reversal.rbi +119 -0
- data/rbi/stripe/resources/treasury/debit_reversal.rbi +131 -0
- data/rbi/stripe/resources/treasury/financial_account.rbi +865 -0
- data/rbi/stripe/resources/treasury/financial_account_features.rbi +260 -0
- data/rbi/stripe/resources/treasury/inbound_transfer.rbi +295 -0
- data/rbi/stripe/resources/treasury/outbound_payment.rbi +592 -0
- data/rbi/stripe/resources/treasury/outbound_transfer.rbi +431 -0
- data/rbi/stripe/resources/treasury/received_credit.rbi +302 -0
- data/rbi/stripe/resources/treasury/received_debit.rbi +256 -0
- data/rbi/stripe/resources/treasury/transaction.rbi +215 -0
- data/rbi/stripe/resources/treasury/transaction_entry.rbi +192 -0
- data/rbi/stripe/resources/v2/amount.rbi +14 -0
- data/rbi/stripe/resources/v2/billing/meter_event.rbi +37 -0
- data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +41 -0
- data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +31 -0
- data/rbi/stripe/resources/v2/event.rbi +48 -0
- data/rbi/stripe/resources/v2/event_destination.rbi +91 -0
- data/rbi/stripe/resources/webhook_endpoint.rbi +168 -0
- data/rbi/stripe/services/account_capability_service.rbi +51 -0
- data/{lib/stripe/services/external_account_service.rb → rbi/stripe/services/account_external_account_service.rbi} +124 -138
- data/rbi/stripe/services/account_link_service.rbi +58 -0
- data/rbi/stripe/services/account_login_link_service.rbi +22 -0
- data/rbi/stripe/services/account_person_service.rbi +1011 -0
- data/rbi/stripe/services/account_service.rbi +4213 -0
- data/rbi/stripe/services/account_session_service.rbi +646 -0
- data/rbi/stripe/services/apple_pay_domain_service.rbi +76 -0
- data/rbi/stripe/services/application_fee_refund_service.rbi +93 -0
- data/rbi/stripe/services/application_fee_service.rbi +78 -0
- data/rbi/stripe/services/apps/secret_service.rbi +151 -0
- data/rbi/stripe/services/apps_service.rbi +9 -0
- data/rbi/stripe/services/balance_service.rbi +21 -0
- data/rbi/stripe/services/balance_transaction_service.rbi +93 -0
- data/rbi/stripe/services/billing/alert_service.rbi +152 -0
- data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +68 -0
- data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +59 -0
- data/rbi/stripe/services/billing/credit_grant_service.rbi +211 -0
- data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +42 -0
- data/rbi/stripe/services/billing/meter_event_service.rbi +42 -0
- data/rbi/stripe/services/billing/meter_event_summary_service.rbi +54 -0
- data/rbi/stripe/services/billing/meter_service.rbi +163 -0
- data/rbi/stripe/services/billing_portal/configuration_service.rbi +511 -0
- data/rbi/stripe/services/billing_portal/session_service.rbi +204 -0
- data/rbi/stripe/services/billing_portal_service.rbi +10 -0
- data/rbi/stripe/services/billing_service.rbi +15 -0
- data/rbi/stripe/services/charge_service.rbi +448 -0
- data/rbi/stripe/services/checkout/session_line_item_service.rbi +33 -0
- data/rbi/stripe/services/checkout/session_service.rbi +2614 -0
- data/rbi/stripe/services/checkout_service.rbi +9 -0
- data/rbi/stripe/services/climate/order_service.rbi +142 -0
- data/rbi/stripe/services/climate/product_service.rbi +46 -0
- data/{lib/stripe/services/financial_connections/institution_service.rb → rbi/stripe/services/climate/supplier_service.rbi} +25 -36
- data/rbi/stripe/services/climate_service.rbi +11 -0
- data/rbi/stripe/services/confirmation_token_service.rbi +20 -0
- data/rbi/stripe/services/country_spec_service.rbi +44 -0
- data/rbi/stripe/services/coupon_service.rbi +194 -0
- data/{lib/stripe/services/quote_preview_invoice_service.rb → rbi/stripe/services/credit_note_line_item_service.rbi} +16 -20
- data/rbi/stripe/services/credit_note_preview_lines_service.rbi +167 -0
- data/rbi/stripe/services/credit_note_service.rbi +415 -0
- data/rbi/stripe/services/customer_balance_transaction_service.rbi +92 -0
- data/rbi/stripe/services/customer_cash_balance_service.rbi +45 -0
- data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +44 -0
- data/rbi/stripe/services/customer_funding_instructions_service.rbi +59 -0
- data/rbi/stripe/services/customer_payment_method_service.rbi +57 -0
- data/rbi/stripe/services/customer_payment_source_service.rbi +232 -0
- data/rbi/stripe/services/customer_service.rbi +647 -0
- data/rbi/stripe/services/customer_session_service.rbi +116 -0
- data/rbi/stripe/services/customer_tax_id_service.rbi +70 -0
- data/rbi/stripe/services/dispute_service.rbi +424 -0
- data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +55 -0
- data/rbi/stripe/services/entitlements/feature_service.rbi +107 -0
- data/rbi/stripe/services/entitlements_service.rbi +10 -0
- data/rbi/stripe/services/ephemeral_key_service.rbi +53 -0
- data/rbi/stripe/services/event_service.rbi +83 -0
- data/rbi/stripe/services/exchange_rate_service.rbi +44 -0
- data/rbi/stripe/services/file_link_service.rbi +124 -0
- data/rbi/stripe/services/file_service.rbi +116 -0
- data/rbi/stripe/services/financial_connections/account_owner_service.rbi +42 -0
- data/rbi/stripe/services/financial_connections/account_service.rbi +133 -0
- data/rbi/stripe/services/financial_connections/session_service.rbi +88 -0
- data/rbi/stripe/services/financial_connections/transaction_service.rbi +92 -0
- data/rbi/stripe/services/financial_connections_service.rbi +11 -0
- data/rbi/stripe/services/forwarding/request_service.rbi +134 -0
- data/rbi/stripe/services/forwarding_service.rbi +9 -0
- data/rbi/stripe/services/identity/verification_report_service.rbi +87 -0
- data/rbi/stripe/services/identity/verification_session_service.rbi +323 -0
- data/rbi/stripe/services/identity_service.rbi +10 -0
- data/rbi/stripe/services/invoice_item_service.rbi +366 -0
- data/rbi/stripe/services/invoice_line_item_service.rbi +259 -0
- data/rbi/stripe/services/invoice_payment_service.rbi +71 -0
- data/rbi/stripe/services/invoice_rendering_template_service.rbi +82 -0
- data/rbi/stripe/services/invoice_service.rbi +2981 -0
- data/rbi/stripe/services/issuing/authorization_service.rbi +146 -0
- data/rbi/stripe/services/issuing/card_service.rbi +495 -0
- data/rbi/stripe/services/issuing/cardholder_service.rbi +587 -0
- data/rbi/stripe/services/issuing/dispute_service.rbi +707 -0
- data/rbi/stripe/services/issuing/personalization_design_service.rbi +243 -0
- data/rbi/stripe/services/issuing/physical_bundle_service.rbi +59 -0
- data/rbi/stripe/services/issuing/token_service.rbi +99 -0
- data/rbi/stripe/services/issuing/transaction_service.rbi +105 -0
- data/rbi/stripe/services/issuing_service.rbi +16 -0
- data/rbi/stripe/services/mandate_service.rbi +20 -0
- data/rbi/stripe/services/payment_intent_service.rbi +7659 -0
- data/{lib/stripe/services/payment_intent_amount_details_line_item_service.rb → rbi/stripe/services/payment_link_line_item_service.rbi} +16 -20
- data/rbi/stripe/services/payment_link_service.rbi +1352 -0
- data/rbi/stripe/services/payment_method_configuration_service.rbi +2487 -0
- data/rbi/stripe/services/payment_method_domain_service.rbi +112 -0
- data/rbi/stripe/services/payment_method_service.rbi +776 -0
- data/rbi/stripe/services/payout_service.rbi +205 -0
- data/rbi/stripe/services/plan_service.rbi +282 -0
- data/rbi/stripe/services/price_service.rbi +546 -0
- data/rbi/stripe/services/product_feature_service.rbi +67 -0
- data/rbi/stripe/services/product_service.rbi +477 -0
- data/rbi/stripe/services/promotion_code_service.rbi +214 -0
- data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +31 -0
- data/{lib/stripe/services/order_line_item_service.rb → rbi/stripe/services/quote_line_item_service.rbi} +16 -20
- data/rbi/stripe/services/quote_service.rbi +686 -0
- data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +85 -0
- data/rbi/stripe/services/radar/value_list_item_service.rbi +109 -0
- data/rbi/stripe/services/radar/value_list_service.rbi +141 -0
- data/rbi/stripe/services/radar_service.rbi +11 -0
- data/rbi/stripe/services/refund_service.rbi +185 -0
- data/rbi/stripe/services/reporting/report_run_service.rbi +135 -0
- data/rbi/stripe/services/reporting/report_type_service.rbi +35 -0
- data/rbi/stripe/services/reporting_service.rbi +10 -0
- data/rbi/stripe/services/review_service.rbi +84 -0
- data/rbi/stripe/services/setup_attempt_service.rbi +65 -0
- data/rbi/stripe/services/setup_intent_service.rbi +3391 -0
- data/rbi/stripe/services/shipping_rate_service.rbi +241 -0
- data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +46 -0
- data/rbi/stripe/services/sigma_service.rbi +9 -0
- data/rbi/stripe/services/source_service.rbi +663 -0
- data/{lib/stripe/services/quote_line_service.rb → rbi/stripe/services/source_transaction_service.rbi} +16 -20
- data/rbi/stripe/services/subscription_item_service.rbi +350 -0
- data/rbi/stripe/services/subscription_schedule_service.rbi +1290 -0
- data/rbi/stripe/services/subscription_service.rbi +1648 -0
- data/{lib/stripe/services/financial_connections/account_inferred_balance_service.rb → rbi/stripe/services/tax/calculation_line_item_service.rbi} +17 -21
- data/rbi/stripe/services/tax/calculation_service.rbi +234 -0
- data/rbi/stripe/services/tax/registration_service.rbi +1845 -0
- data/rbi/stripe/services/tax/settings_service.rbi +93 -0
- data/{lib/stripe/services/privacy/redaction_job_validation_error_service.rb → rbi/stripe/services/tax/transaction_line_item_service.rbi} +17 -21
- data/rbi/stripe/services/tax/transaction_service.rbi +146 -0
- data/rbi/stripe/services/tax_code_service.rbi +44 -0
- data/rbi/stripe/services/tax_id_service.rbi +110 -0
- data/rbi/stripe/services/tax_rate_service.rbi +185 -0
- data/rbi/stripe/services/tax_service.rbi +12 -0
- data/rbi/stripe/services/terminal/configuration_service.rbi +1118 -0
- data/rbi/stripe/services/terminal/connection_token_service.rbi +25 -0
- data/rbi/stripe/services/terminal/location_service.rbi +182 -0
- data/rbi/stripe/services/terminal/reader_service.rbi +455 -0
- data/rbi/stripe/services/terminal_service.rbi +12 -0
- data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +739 -0
- data/rbi/stripe/services/test_helpers/customer_service.rbi +33 -0
- data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +848 -0
- data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +76 -0
- data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +69 -0
- data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +711 -0
- data/rbi/stripe/services/test_helpers/issuing_service.rbi +14 -0
- data/rbi/stripe/services/test_helpers/refund_service.rbi +22 -0
- data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +93 -0
- data/rbi/stripe/services/test_helpers/terminal_service.rbi +11 -0
- data/rbi/stripe/services/test_helpers/test_clock_service.rbi +90 -0
- data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +64 -0
- data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +125 -0
- data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +125 -0
- data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +87 -0
- data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +87 -0
- data/rbi/stripe/services/test_helpers/treasury_service.rbi +15 -0
- data/rbi/stripe/services/test_helpers_service.rbi +15 -0
- data/rbi/stripe/services/token_service.rbi +1257 -0
- data/rbi/stripe/services/topup_service.rbi +176 -0
- data/rbi/stripe/services/transfer_reversal_service.rbi +101 -0
- data/rbi/stripe/services/transfer_service.rbi +152 -0
- data/rbi/stripe/services/treasury/credit_reversal_service.rbi +84 -0
- data/rbi/stripe/services/treasury/debit_reversal_service.rbi +88 -0
- data/rbi/stripe/services/treasury/financial_account_features_service.rbi +198 -0
- data/rbi/stripe/services/treasury/financial_account_service.rbi +562 -0
- data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +117 -0
- data/rbi/stripe/services/treasury/outbound_payment_service.rbi +304 -0
- data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +157 -0
- data/rbi/stripe/services/treasury/received_credit_service.rbi +72 -0
- data/rbi/stripe/services/treasury/received_debit_service.rbi +59 -0
- data/rbi/stripe/services/treasury/transaction_entry_service.rbi +111 -0
- data/rbi/stripe/services/treasury/transaction_service.rbi +122 -0
- data/rbi/stripe/services/treasury_service.rbi +18 -0
- data/rbi/stripe/services/v1_services.rbi +77 -0
- data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +39 -0
- data/rbi/stripe/services/v2/billing/meter_event_service.rbi +42 -0
- data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +18 -0
- data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +55 -0
- data/rbi/stripe/services/v2/billing_service.rbi +14 -0
- data/rbi/stripe/services/v2/core/event_destination_service.rbi +192 -0
- data/rbi/stripe/services/v2/core/event_service.rbi +36 -0
- data/rbi/stripe/services/v2/core_service.rbi +12 -0
- data/rbi/stripe/services/v2_services.rbi +10 -0
- data/rbi/stripe/services/webhook_endpoint_service.rbi +129 -0
- data/stripe.gemspec +1 -4
- metadata +326 -158
- data/lib/stripe/events/v2_core_account_closed_event.rb +0 -21
- data/lib/stripe/events/v2_core_account_created_event.rb +0 -21
- data/lib/stripe/events/v2_core_account_including_configuration_customer_capability_status_updated_event.rb +0 -23
- data/lib/stripe/events/v2_core_account_including_configuration_customer_updated_event.rb +0 -21
- data/lib/stripe/events/v2_core_account_including_configuration_merchant_capability_status_updated_event.rb +0 -23
- data/lib/stripe/events/v2_core_account_including_configuration_merchant_updated_event.rb +0 -21
- data/lib/stripe/events/v2_core_account_including_configuration_recipient_capability_status_updated_event.rb +0 -23
- data/lib/stripe/events/v2_core_account_including_configuration_recipient_updated_event.rb +0 -21
- data/lib/stripe/events/v2_core_account_including_defaults_updated_event.rb +0 -21
- data/lib/stripe/events/v2_core_account_including_identity_updated_event.rb +0 -21
- data/lib/stripe/events/v2_core_account_including_requirements_updated_event.rb +0 -21
- data/lib/stripe/events/v2_core_account_link_completed_event.rb +0 -13
- data/lib/stripe/events/v2_core_account_person_created_event.rb +0 -23
- data/lib/stripe/events/v2_core_account_person_deleted_event.rb +0 -23
- data/lib/stripe/events/v2_core_account_person_updated_event.rb +0 -23
- data/lib/stripe/events/v2_core_account_updated_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_adjustment_created_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_financial_account_created_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_financial_account_updated_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_financial_address_activated_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_financial_address_failed_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_inbound_transfer_available_event.rb +0 -23
- data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_failed_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_processing_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_queued_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_returned_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_succeeded_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_outbound_payment_canceled_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_outbound_payment_created_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_outbound_payment_failed_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_outbound_payment_posted_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_outbound_payment_returned_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_outbound_payment_updated_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_outbound_transfer_canceled_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_outbound_transfer_created_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_outbound_transfer_failed_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_outbound_transfer_posted_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_outbound_transfer_returned_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_outbound_transfer_updated_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_received_credit_available_event.rb +0 -23
- data/lib/stripe/events/v2_money_management_received_credit_failed_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_received_credit_returned_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_received_credit_succeeded_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_received_debit_canceled_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_received_debit_failed_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_received_debit_pending_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_received_debit_succeeded_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_received_debit_updated_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_transaction_created_event.rb +0 -21
- data/lib/stripe/events/v2_money_management_transaction_updated_event.rb +0 -21
- data/lib/stripe/resources/account_notice.rb +0 -123
- data/lib/stripe/resources/balance_settings.rb +0 -105
- data/lib/stripe/resources/billing/meter_error_report.rb +0 -59
- data/lib/stripe/resources/capital/financing_offer.rb +0 -179
- data/lib/stripe/resources/capital/financing_summary.rb +0 -55
- data/lib/stripe/resources/capital/financing_transaction.rb +0 -114
- data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +0 -27
- data/lib/stripe/resources/financial_connections/institution.rb +0 -90
- data/lib/stripe/resources/fx_quote.rb +0 -184
- data/lib/stripe/resources/gift_cards/card.rb +0 -208
- data/lib/stripe/resources/gift_cards/transaction.rb +0 -272
- data/lib/stripe/resources/issuing/credit_underwriting_record.rb +0 -602
- data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +0 -82
- data/lib/stripe/resources/issuing/fraud_liability_debit.rb +0 -86
- data/lib/stripe/resources/issuing/settlement.rb +0 -53
- data/lib/stripe/resources/margin.rb +0 -115
- data/lib/stripe/resources/order.rb +0 -2859
- data/lib/stripe/resources/payment_attempt_record.rb +0 -1078
- data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +0 -65
- data/lib/stripe/resources/payment_record.rb +0 -1607
- data/lib/stripe/resources/privacy/redaction_job.rb +0 -275
- data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +0 -25
- data/lib/stripe/resources/quote_line.rb +0 -274
- data/lib/stripe/resources/quote_preview_invoice.rb +0 -663
- data/lib/stripe/resources/quote_preview_subscription_schedule.rb +0 -339
- data/lib/stripe/resources/tax/association.rb +0 -89
- data/lib/stripe/resources/tax/form.rb +0 -211
- data/lib/stripe/resources/terminal/reader_collected_data.rb +0 -31
- data/lib/stripe/resources/v2/core/account.rb +0 -1746
- data/lib/stripe/resources/v2/core/account_link.rb +0 -56
- data/lib/stripe/resources/v2/core/person.rb +0 -276
- data/lib/stripe/resources/v2/core/vault/gb_bank_account.rb +0 -74
- data/lib/stripe/resources/v2/core/vault/us_bank_account.rb +0 -39
- data/lib/stripe/resources/v2/financial_address_credit_simulation.rb +0 -20
- data/lib/stripe/resources/v2/financial_address_generated_microdeposits.rb +0 -22
- data/lib/stripe/resources/v2/money_management/adjustment.rb +0 -51
- data/lib/stripe/resources/v2/money_management/financial_account.rb +0 -58
- data/lib/stripe/resources/v2/money_management/financial_address.rb +0 -68
- data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +0 -94
- data/lib/stripe/resources/v2/money_management/outbound_payment.rb +0 -129
- data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +0 -82
- data/lib/stripe/resources/v2/money_management/outbound_setup_intent.rb +0 -45
- data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +0 -117
- data/lib/stripe/resources/v2/money_management/payout_method.rb +0 -75
- data/lib/stripe/resources/v2/money_management/payout_methods_bank_account_spec.rb +0 -49
- data/lib/stripe/resources/v2/money_management/received_credit.rb +0 -136
- data/lib/stripe/resources/v2/money_management/received_debit.rb +0 -108
- data/lib/stripe/resources/v2/money_management/transaction.rb +0 -78
- data/lib/stripe/resources/v2/money_management/transaction_entry.rb +0 -68
- data/lib/stripe/services/account_notice_service.rb +0 -101
- data/lib/stripe/services/balance_settings_service.rb +0 -96
- data/lib/stripe/services/capital/financing_offer_service.rb +0 -112
- data/lib/stripe/services/capital/financing_summary_service.rb +0 -28
- data/lib/stripe/services/capital/financing_transaction_service.rb +0 -79
- data/lib/stripe/services/capital_service.rb +0 -15
- data/lib/stripe/services/fx_quote_service.rb +0 -123
- data/lib/stripe/services/gift_cards/card_service.rb +0 -170
- data/lib/stripe/services/gift_cards/transaction_service.rb +0 -209
- data/lib/stripe/services/gift_cards_service.rb +0 -14
- data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +0 -504
- data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +0 -66
- data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +0 -83
- data/lib/stripe/services/margin_service.rb +0 -119
- data/lib/stripe/services/order_service.rb +0 -2268
- data/lib/stripe/services/payment_attempt_record_service.rb +0 -49
- data/lib/stripe/services/payment_record_service.rb +0 -542
- data/lib/stripe/services/privacy/redaction_job_service.rb +0 -231
- data/lib/stripe/services/privacy_service.rb +0 -13
- data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +0 -35
- data/lib/stripe/services/tax/association_service.rb +0 -31
- data/lib/stripe/services/tax/form_service.rb +0 -100
- data/lib/stripe/services/terminal/reader_collected_data_service.rb +0 -28
- data/lib/stripe/services/v2/core/account_link_service.rb +0 -76
- data/lib/stripe/services/v2/core/account_service.rb +0 -4138
- data/lib/stripe/services/v2/core/accounts/person_service.rb +0 -1048
- data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +0 -135
- data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +0 -109
- data/lib/stripe/services/v2/core/vault_service.rb +0 -18
- data/lib/stripe/services/v2/money_management/adjustment_service.rb +0 -75
- data/lib/stripe/services/v2/money_management/financial_account_service.rb +0 -44
- data/lib/stripe/services/v2/money_management/financial_address_service.rb +0 -81
- data/lib/stripe/services/v2/money_management/inbound_transfer_service.rb +0 -126
- data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +0 -96
- data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +0 -202
- data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +0 -237
- data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +0 -174
- data/lib/stripe/services/v2/money_management/payout_method_service.rb +0 -95
- data/lib/stripe/services/v2/money_management/payout_methods_bank_account_spec_service.rb +0 -32
- data/lib/stripe/services/v2/money_management/received_credit_service.rb +0 -71
- data/lib/stripe/services/v2/money_management/received_debit_service.rb +0 -44
- data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +0 -70
- data/lib/stripe/services/v2/money_management/transaction_service.rb +0 -74
- data/lib/stripe/services/v2/money_management_service.rb +0 -31
- data/lib/stripe/services/v2/test_helper_service.rb +0 -15
- data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +0 -50
- data/rbi/stripe.rbi +0 -191867
@@ -38,6 +38,13 @@ module Stripe
|
|
38
38
|
attr_reader :liability
|
39
39
|
end
|
40
40
|
|
41
|
+
class BillingThresholds < Stripe::StripeObject
|
42
|
+
# Monetary threshold that triggers the subscription to create an invoice
|
43
|
+
attr_reader :amount_gte
|
44
|
+
# 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. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`.
|
45
|
+
attr_reader :reset_billing_cycle_anchor
|
46
|
+
end
|
47
|
+
|
41
48
|
class InvoiceSettings < Stripe::StripeObject
|
42
49
|
class Issuer < Stripe::StripeObject
|
43
50
|
# The connected account being referenced when `type` is `account`.
|
@@ -65,6 +72,8 @@ module Stripe
|
|
65
72
|
attr_reader :automatic_tax
|
66
73
|
# Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
|
67
74
|
attr_reader :billing_cycle_anchor
|
75
|
+
# Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
|
76
|
+
attr_reader :billing_thresholds
|
68
77
|
# 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`.
|
69
78
|
attr_reader :collection_method
|
70
79
|
# ID of the default payment method for the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.
|
@@ -79,36 +88,13 @@ module Stripe
|
|
79
88
|
attr_reader :transfer_data
|
80
89
|
end
|
81
90
|
|
82
|
-
class LastPriceMigrationError < Stripe::StripeObject
|
83
|
-
class FailedTransition < Stripe::StripeObject
|
84
|
-
# The original price to be migrated.
|
85
|
-
attr_reader :source_price
|
86
|
-
# The intended resulting price of the migration.
|
87
|
-
attr_reader :target_price
|
88
|
-
end
|
89
|
-
# The time at which the price migration encountered an error.
|
90
|
-
attr_reader :errored_at
|
91
|
-
# The involved price pairs in each failed transition.
|
92
|
-
attr_reader :failed_transitions
|
93
|
-
# The type of error encountered by the price migration.
|
94
|
-
attr_reader :type
|
95
|
-
end
|
96
|
-
|
97
91
|
class Phase < Stripe::StripeObject
|
98
92
|
class AddInvoiceItem < Stripe::StripeObject
|
99
93
|
class Discount < Stripe::StripeObject
|
100
|
-
class DiscountEnd < Stripe::StripeObject
|
101
|
-
# The discount end timestamp.
|
102
|
-
attr_reader :timestamp
|
103
|
-
# The discount end type.
|
104
|
-
attr_reader :type
|
105
|
-
end
|
106
94
|
# ID of the coupon to create a new discount for.
|
107
95
|
attr_reader :coupon
|
108
96
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
109
97
|
attr_reader :discount
|
110
|
-
# Details to determine how long the discount should be applied for.
|
111
|
-
attr_reader :discount_end
|
112
98
|
# ID of the promotion code to create a new discount for.
|
113
99
|
attr_reader :promotion_code
|
114
100
|
end
|
@@ -137,19 +123,18 @@ module Stripe
|
|
137
123
|
attr_reader :liability
|
138
124
|
end
|
139
125
|
|
126
|
+
class BillingThresholds < Stripe::StripeObject
|
127
|
+
# Monetary threshold that triggers the subscription to create an invoice
|
128
|
+
attr_reader :amount_gte
|
129
|
+
# 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. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`.
|
130
|
+
attr_reader :reset_billing_cycle_anchor
|
131
|
+
end
|
132
|
+
|
140
133
|
class Discount < Stripe::StripeObject
|
141
|
-
class DiscountEnd < Stripe::StripeObject
|
142
|
-
# The discount end timestamp.
|
143
|
-
attr_reader :timestamp
|
144
|
-
# The discount end type.
|
145
|
-
attr_reader :type
|
146
|
-
end
|
147
134
|
# ID of the coupon to create a new discount for.
|
148
135
|
attr_reader :coupon
|
149
136
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
150
137
|
attr_reader :discount
|
151
|
-
# Details to determine how long the discount should be applied for.
|
152
|
-
attr_reader :discount_end
|
153
138
|
# ID of the promotion code to create a new discount for.
|
154
139
|
attr_reader :promotion_code
|
155
140
|
end
|
@@ -170,29 +155,21 @@ module Stripe
|
|
170
155
|
end
|
171
156
|
|
172
157
|
class Item < Stripe::StripeObject
|
158
|
+
class BillingThresholds < Stripe::StripeObject
|
159
|
+
# Usage threshold that triggers the subscription to create an invoice
|
160
|
+
attr_reader :usage_gte
|
161
|
+
end
|
162
|
+
|
173
163
|
class Discount < Stripe::StripeObject
|
174
|
-
class DiscountEnd < Stripe::StripeObject
|
175
|
-
# The discount end timestamp.
|
176
|
-
attr_reader :timestamp
|
177
|
-
# The discount end type.
|
178
|
-
attr_reader :type
|
179
|
-
end
|
180
164
|
# ID of the coupon to create a new discount for.
|
181
165
|
attr_reader :coupon
|
182
166
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
183
167
|
attr_reader :discount
|
184
|
-
# Details to determine how long the discount should be applied for.
|
185
|
-
attr_reader :discount_end
|
186
168
|
# ID of the promotion code to create a new discount for.
|
187
169
|
attr_reader :promotion_code
|
188
170
|
end
|
189
|
-
|
190
|
-
|
191
|
-
# List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial.
|
192
|
-
attr_reader :converts_to
|
193
|
-
# Determines the type of trial for this item.
|
194
|
-
attr_reader :type
|
195
|
-
end
|
171
|
+
# Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period
|
172
|
+
attr_reader :billing_thresholds
|
196
173
|
# The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount.
|
197
174
|
attr_reader :discounts
|
198
175
|
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered.
|
@@ -205,13 +182,6 @@ module Stripe
|
|
205
182
|
attr_reader :quantity
|
206
183
|
# The tax rates which apply to this `phase_item`. When set, the `default_tax_rates` on the phase do not apply to this `phase_item`.
|
207
184
|
attr_reader :tax_rates
|
208
|
-
# Options that configure the trial on the subscription item.
|
209
|
-
attr_reader :trial
|
210
|
-
end
|
211
|
-
|
212
|
-
class PauseCollection < Stripe::StripeObject
|
213
|
-
# The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
214
|
-
attr_reader :behavior
|
215
185
|
end
|
216
186
|
|
217
187
|
class TransferData < Stripe::StripeObject
|
@@ -220,15 +190,6 @@ module Stripe
|
|
220
190
|
# The account where funds from the payment will be transferred to upon payment success.
|
221
191
|
attr_reader :destination
|
222
192
|
end
|
223
|
-
|
224
|
-
class TrialSettings < Stripe::StripeObject
|
225
|
-
class EndBehavior < Stripe::StripeObject
|
226
|
-
# Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
227
|
-
attr_reader :prorate_up_front
|
228
|
-
end
|
229
|
-
# Defines how the subscription should behave when a trial ends.
|
230
|
-
attr_reader :end_behavior
|
231
|
-
end
|
232
193
|
# A list of prices and quantities that will generate invoice items appended to the next invoice for this phase.
|
233
194
|
attr_reader :add_invoice_items
|
234
195
|
# A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule.
|
@@ -237,6 +198,8 @@ module Stripe
|
|
237
198
|
attr_reader :automatic_tax
|
238
199
|
# Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
|
239
200
|
attr_reader :billing_cycle_anchor
|
201
|
+
# Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
|
202
|
+
attr_reader :billing_thresholds
|
240
203
|
# 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`.
|
241
204
|
attr_reader :collection_method
|
242
205
|
# 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).
|
@@ -259,31 +222,14 @@ module Stripe
|
|
259
222
|
attr_reader :metadata
|
260
223
|
# The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details.
|
261
224
|
attr_reader :on_behalf_of
|
262
|
-
#
|
263
|
-
attr_reader :pause_collection
|
264
|
-
# If the subscription schedule will prorate when transitioning to this phase. Possible values are `create_prorations` and `none`.
|
225
|
+
# When transitioning phases, controls how prorations are handled (if any). Possible values are `create_prorations`, `none`, and `always_invoice`.
|
265
226
|
attr_reader :proration_behavior
|
266
227
|
# The start of this phase of the subscription schedule.
|
267
228
|
attr_reader :start_date
|
268
229
|
# The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.
|
269
230
|
attr_reader :transfer_data
|
270
|
-
# Specify behavior of the trial when crossing schedule phase boundaries
|
271
|
-
attr_reader :trial_continuation
|
272
231
|
# When the trial ends within the phase.
|
273
232
|
attr_reader :trial_end
|
274
|
-
# Settings related to any trials on the subscription during this phase.
|
275
|
-
attr_reader :trial_settings
|
276
|
-
end
|
277
|
-
|
278
|
-
class Prebilling < Stripe::StripeObject
|
279
|
-
# ID of the prebilling invoice.
|
280
|
-
attr_reader :invoice
|
281
|
-
# The end of the last period for which the invoice pre-bills.
|
282
|
-
attr_reader :period_end
|
283
|
-
# The start of the first period for which the invoice pre-bills.
|
284
|
-
attr_reader :period_start
|
285
|
-
# Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period.
|
286
|
-
attr_reader :update_behavior
|
287
233
|
end
|
288
234
|
|
289
235
|
class ListParams < Stripe::RequestParams
|
@@ -366,8 +312,6 @@ module Stripe
|
|
366
312
|
attr_accessor :created
|
367
313
|
# Only return subscription schedules for the given customer.
|
368
314
|
attr_accessor :customer
|
369
|
-
# Only return subscription schedules for the given account.
|
370
|
-
attr_accessor :customer_account
|
371
315
|
# A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
|
372
316
|
attr_accessor :ending_before
|
373
317
|
# Specifies which fields in the response should be expanded.
|
@@ -386,7 +330,6 @@ module Stripe
|
|
386
330
|
completed_at: nil,
|
387
331
|
created: nil,
|
388
332
|
customer: nil,
|
389
|
-
customer_account: nil,
|
390
333
|
ending_before: nil,
|
391
334
|
expand: nil,
|
392
335
|
limit: nil,
|
@@ -398,7 +341,6 @@ module Stripe
|
|
398
341
|
@completed_at = completed_at
|
399
342
|
@created = created
|
400
343
|
@customer = customer
|
401
|
-
@customer_account = customer_account
|
402
344
|
@ending_before = ending_before
|
403
345
|
@expand = expand
|
404
346
|
@limit = limit
|
@@ -433,6 +375,18 @@ module Stripe
|
|
433
375
|
end
|
434
376
|
end
|
435
377
|
|
378
|
+
class BillingThresholds < Stripe::RequestParams
|
379
|
+
# Monetary threshold that triggers the subscription to advance to a new billing period
|
380
|
+
attr_accessor :amount_gte
|
381
|
+
# 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.
|
382
|
+
attr_accessor :reset_billing_cycle_anchor
|
383
|
+
|
384
|
+
def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil)
|
385
|
+
@amount_gte = amount_gte
|
386
|
+
@reset_billing_cycle_anchor = reset_billing_cycle_anchor
|
387
|
+
end
|
388
|
+
end
|
389
|
+
|
436
390
|
class InvoiceSettings < Stripe::RequestParams
|
437
391
|
class Issuer < Stripe::RequestParams
|
438
392
|
# The connected account being referenced when `type` is `account`.
|
@@ -476,6 +430,8 @@ module Stripe
|
|
476
430
|
attr_accessor :automatic_tax
|
477
431
|
# 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).
|
478
432
|
attr_accessor :billing_cycle_anchor
|
433
|
+
# 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.
|
434
|
+
attr_accessor :billing_thresholds
|
479
435
|
# 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.
|
480
436
|
attr_accessor :collection_method
|
481
437
|
# 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.
|
@@ -493,6 +449,7 @@ module Stripe
|
|
493
449
|
application_fee_percent: nil,
|
494
450
|
automatic_tax: nil,
|
495
451
|
billing_cycle_anchor: nil,
|
452
|
+
billing_thresholds: nil,
|
496
453
|
collection_method: nil,
|
497
454
|
default_payment_method: nil,
|
498
455
|
description: nil,
|
@@ -503,6 +460,7 @@ module Stripe
|
|
503
460
|
@application_fee_percent = application_fee_percent
|
504
461
|
@automatic_tax = automatic_tax
|
505
462
|
@billing_cycle_anchor = billing_cycle_anchor
|
463
|
+
@billing_thresholds = billing_thresholds
|
506
464
|
@collection_method = collection_method
|
507
465
|
@default_payment_method = default_payment_method
|
508
466
|
@description = description
|
@@ -515,44 +473,16 @@ module Stripe
|
|
515
473
|
class Phase < Stripe::RequestParams
|
516
474
|
class AddInvoiceItem < Stripe::RequestParams
|
517
475
|
class Discount < Stripe::RequestParams
|
518
|
-
class DiscountEnd < Stripe::RequestParams
|
519
|
-
class Duration < Stripe::RequestParams
|
520
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
521
|
-
attr_accessor :interval
|
522
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
523
|
-
attr_accessor :interval_count
|
524
|
-
|
525
|
-
def initialize(interval: nil, interval_count: nil)
|
526
|
-
@interval = interval
|
527
|
-
@interval_count = interval_count
|
528
|
-
end
|
529
|
-
end
|
530
|
-
# Time span for the redeemed discount.
|
531
|
-
attr_accessor :duration
|
532
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
533
|
-
attr_accessor :timestamp
|
534
|
-
# The type of calculation made to determine when the discount ends.
|
535
|
-
attr_accessor :type
|
536
|
-
|
537
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
538
|
-
@duration = duration
|
539
|
-
@timestamp = timestamp
|
540
|
-
@type = type
|
541
|
-
end
|
542
|
-
end
|
543
476
|
# ID of the coupon to create a new discount for.
|
544
477
|
attr_accessor :coupon
|
545
478
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
546
479
|
attr_accessor :discount
|
547
|
-
# Details to determine how long the discount should be applied for.
|
548
|
-
attr_accessor :discount_end
|
549
480
|
# ID of the promotion code to create a new discount for.
|
550
481
|
attr_accessor :promotion_code
|
551
482
|
|
552
|
-
def initialize(coupon: nil, discount: nil,
|
483
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
553
484
|
@coupon = coupon
|
554
485
|
@discount = discount
|
555
|
-
@discount_end = discount_end
|
556
486
|
@promotion_code = promotion_code
|
557
487
|
end
|
558
488
|
end
|
@@ -626,45 +556,29 @@ module Stripe
|
|
626
556
|
end
|
627
557
|
end
|
628
558
|
|
629
|
-
class
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
635
|
-
attr_accessor :interval_count
|
559
|
+
class BillingThresholds < Stripe::RequestParams
|
560
|
+
# Monetary threshold that triggers the subscription to advance to a new billing period
|
561
|
+
attr_accessor :amount_gte
|
562
|
+
# 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.
|
563
|
+
attr_accessor :reset_billing_cycle_anchor
|
636
564
|
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
end
|
641
|
-
end
|
642
|
-
# Time span for the redeemed discount.
|
643
|
-
attr_accessor :duration
|
644
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
645
|
-
attr_accessor :timestamp
|
646
|
-
# The type of calculation made to determine when the discount ends.
|
647
|
-
attr_accessor :type
|
648
|
-
|
649
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
650
|
-
@duration = duration
|
651
|
-
@timestamp = timestamp
|
652
|
-
@type = type
|
653
|
-
end
|
565
|
+
def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil)
|
566
|
+
@amount_gte = amount_gte
|
567
|
+
@reset_billing_cycle_anchor = reset_billing_cycle_anchor
|
654
568
|
end
|
569
|
+
end
|
570
|
+
|
571
|
+
class Discount < Stripe::RequestParams
|
655
572
|
# ID of the coupon to create a new discount for.
|
656
573
|
attr_accessor :coupon
|
657
574
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
658
575
|
attr_accessor :discount
|
659
|
-
# Details to determine how long the discount should be applied for.
|
660
|
-
attr_accessor :discount_end
|
661
576
|
# ID of the promotion code to create a new discount for.
|
662
577
|
attr_accessor :promotion_code
|
663
578
|
|
664
|
-
def initialize(coupon: nil, discount: nil,
|
579
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
665
580
|
@coupon = coupon
|
666
581
|
@discount = discount
|
667
|
-
@discount_end = discount_end
|
668
582
|
@promotion_code = promotion_code
|
669
583
|
end
|
670
584
|
end
|
@@ -696,45 +610,26 @@ module Stripe
|
|
696
610
|
end
|
697
611
|
|
698
612
|
class Item < Stripe::RequestParams
|
699
|
-
class
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
attr_accessor :interval_count
|
706
|
-
|
707
|
-
def initialize(interval: nil, interval_count: nil)
|
708
|
-
@interval = interval
|
709
|
-
@interval_count = interval_count
|
710
|
-
end
|
711
|
-
end
|
712
|
-
# Time span for the redeemed discount.
|
713
|
-
attr_accessor :duration
|
714
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
715
|
-
attr_accessor :timestamp
|
716
|
-
# The type of calculation made to determine when the discount ends.
|
717
|
-
attr_accessor :type
|
718
|
-
|
719
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
720
|
-
@duration = duration
|
721
|
-
@timestamp = timestamp
|
722
|
-
@type = type
|
723
|
-
end
|
613
|
+
class BillingThresholds < Stripe::RequestParams
|
614
|
+
# 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))
|
615
|
+
attr_accessor :usage_gte
|
616
|
+
|
617
|
+
def initialize(usage_gte: nil)
|
618
|
+
@usage_gte = usage_gte
|
724
619
|
end
|
620
|
+
end
|
621
|
+
|
622
|
+
class Discount < Stripe::RequestParams
|
725
623
|
# ID of the coupon to create a new discount for.
|
726
624
|
attr_accessor :coupon
|
727
625
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
728
626
|
attr_accessor :discount
|
729
|
-
# Details to determine how long the discount should be applied for.
|
730
|
-
attr_accessor :discount_end
|
731
627
|
# ID of the promotion code to create a new discount for.
|
732
628
|
attr_accessor :promotion_code
|
733
629
|
|
734
|
-
def initialize(coupon: nil, discount: nil,
|
630
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
735
631
|
@coupon = coupon
|
736
632
|
@discount = discount
|
737
|
-
@discount_end = discount_end
|
738
633
|
@promotion_code = promotion_code
|
739
634
|
end
|
740
635
|
end
|
@@ -780,18 +675,8 @@ module Stripe
|
|
780
675
|
@unit_amount_decimal = unit_amount_decimal
|
781
676
|
end
|
782
677
|
end
|
783
|
-
|
784
|
-
|
785
|
-
# List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
|
786
|
-
attr_accessor :converts_to
|
787
|
-
# Determines the type of trial for this item.
|
788
|
-
attr_accessor :type
|
789
|
-
|
790
|
-
def initialize(converts_to: nil, type: nil)
|
791
|
-
@converts_to = converts_to
|
792
|
-
@type = type
|
793
|
-
end
|
794
|
-
end
|
678
|
+
# 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.
|
679
|
+
attr_accessor :billing_thresholds
|
795
680
|
# The coupons to redeem into discounts for the subscription item.
|
796
681
|
attr_accessor :discounts
|
797
682
|
# 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`.
|
@@ -806,19 +691,18 @@ module Stripe
|
|
806
691
|
attr_accessor :quantity
|
807
692
|
# A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
|
808
693
|
attr_accessor :tax_rates
|
809
|
-
# Options that configure the trial on the subscription item.
|
810
|
-
attr_accessor :trial
|
811
694
|
|
812
695
|
def initialize(
|
696
|
+
billing_thresholds: nil,
|
813
697
|
discounts: nil,
|
814
698
|
metadata: nil,
|
815
699
|
plan: nil,
|
816
700
|
price: nil,
|
817
701
|
price_data: nil,
|
818
702
|
quantity: nil,
|
819
|
-
tax_rates: nil
|
820
|
-
trial: nil
|
703
|
+
tax_rates: nil
|
821
704
|
)
|
705
|
+
@billing_thresholds = billing_thresholds
|
822
706
|
@discounts = discounts
|
823
707
|
@metadata = metadata
|
824
708
|
@plan = plan
|
@@ -826,16 +710,6 @@ module Stripe
|
|
826
710
|
@price_data = price_data
|
827
711
|
@quantity = quantity
|
828
712
|
@tax_rates = tax_rates
|
829
|
-
@trial = trial
|
830
|
-
end
|
831
|
-
end
|
832
|
-
|
833
|
-
class PauseCollection < Stripe::RequestParams
|
834
|
-
# The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
835
|
-
attr_accessor :behavior
|
836
|
-
|
837
|
-
def initialize(behavior: nil)
|
838
|
-
@behavior = behavior
|
839
713
|
end
|
840
714
|
end
|
841
715
|
|
@@ -850,23 +724,6 @@ module Stripe
|
|
850
724
|
@destination = destination
|
851
725
|
end
|
852
726
|
end
|
853
|
-
|
854
|
-
class TrialSettings < Stripe::RequestParams
|
855
|
-
class EndBehavior < Stripe::RequestParams
|
856
|
-
# Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
857
|
-
attr_accessor :prorate_up_front
|
858
|
-
|
859
|
-
def initialize(prorate_up_front: nil)
|
860
|
-
@prorate_up_front = prorate_up_front
|
861
|
-
end
|
862
|
-
end
|
863
|
-
# Defines how the subscription should behave when a trial ends.
|
864
|
-
attr_accessor :end_behavior
|
865
|
-
|
866
|
-
def initialize(end_behavior: nil)
|
867
|
-
@end_behavior = end_behavior
|
868
|
-
end
|
869
|
-
end
|
870
727
|
# A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items.
|
871
728
|
attr_accessor :add_invoice_items
|
872
729
|
# A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
|
@@ -875,6 +732,8 @@ module Stripe
|
|
875
732
|
attr_accessor :automatic_tax
|
876
733
|
# 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).
|
877
734
|
attr_accessor :billing_cycle_anchor
|
735
|
+
# 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.
|
736
|
+
attr_accessor :billing_thresholds
|
878
737
|
# 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.
|
879
738
|
attr_accessor :collection_method
|
880
739
|
# 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).
|
@@ -899,26 +758,21 @@ module Stripe
|
|
899
758
|
attr_accessor :metadata
|
900
759
|
# The account on behalf of which to charge, for each of the associated subscription's invoices.
|
901
760
|
attr_accessor :on_behalf_of
|
902
|
-
#
|
903
|
-
attr_accessor :pause_collection
|
904
|
-
# Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. 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 of the current phase.
|
761
|
+
# 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.
|
905
762
|
attr_accessor :proration_behavior
|
906
763
|
# The data with which to automatically create a Transfer for each of the associated subscription's invoices.
|
907
764
|
attr_accessor :transfer_data
|
908
765
|
# If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
|
909
766
|
attr_accessor :trial
|
910
|
-
# Specify trial behavior when crossing phase boundaries
|
911
|
-
attr_accessor :trial_continuation
|
912
767
|
# Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial`
|
913
768
|
attr_accessor :trial_end
|
914
|
-
# Settings related to subscription trials.
|
915
|
-
attr_accessor :trial_settings
|
916
769
|
|
917
770
|
def initialize(
|
918
771
|
add_invoice_items: nil,
|
919
772
|
application_fee_percent: nil,
|
920
773
|
automatic_tax: nil,
|
921
774
|
billing_cycle_anchor: nil,
|
775
|
+
billing_thresholds: nil,
|
922
776
|
collection_method: nil,
|
923
777
|
currency: nil,
|
924
778
|
default_payment_method: nil,
|
@@ -931,18 +785,16 @@ module Stripe
|
|
931
785
|
iterations: nil,
|
932
786
|
metadata: nil,
|
933
787
|
on_behalf_of: nil,
|
934
|
-
pause_collection: nil,
|
935
788
|
proration_behavior: nil,
|
936
789
|
transfer_data: nil,
|
937
790
|
trial: nil,
|
938
|
-
|
939
|
-
trial_end: nil,
|
940
|
-
trial_settings: nil
|
791
|
+
trial_end: nil
|
941
792
|
)
|
942
793
|
@add_invoice_items = add_invoice_items
|
943
794
|
@application_fee_percent = application_fee_percent
|
944
795
|
@automatic_tax = automatic_tax
|
945
796
|
@billing_cycle_anchor = billing_cycle_anchor
|
797
|
+
@billing_thresholds = billing_thresholds
|
946
798
|
@collection_method = collection_method
|
947
799
|
@currency = currency
|
948
800
|
@default_payment_method = default_payment_method
|
@@ -955,35 +807,14 @@ module Stripe
|
|
955
807
|
@iterations = iterations
|
956
808
|
@metadata = metadata
|
957
809
|
@on_behalf_of = on_behalf_of
|
958
|
-
@pause_collection = pause_collection
|
959
810
|
@proration_behavior = proration_behavior
|
960
811
|
@transfer_data = transfer_data
|
961
812
|
@trial = trial
|
962
|
-
@trial_continuation = trial_continuation
|
963
813
|
@trial_end = trial_end
|
964
|
-
@trial_settings = trial_settings
|
965
|
-
end
|
966
|
-
end
|
967
|
-
|
968
|
-
class Prebilling < Stripe::RequestParams
|
969
|
-
# This is used to determine the number of billing cycles to prebill.
|
970
|
-
attr_accessor :iterations
|
971
|
-
# Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
|
972
|
-
attr_accessor :update_behavior
|
973
|
-
|
974
|
-
def initialize(iterations: nil, update_behavior: nil)
|
975
|
-
@iterations = iterations
|
976
|
-
@update_behavior = update_behavior
|
977
814
|
end
|
978
815
|
end
|
979
|
-
# Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front.
|
980
|
-
attr_accessor :billing_behavior
|
981
|
-
# Configure billing_mode to opt in improved credit proration behavior.When the schedule creates a subscription, the subscription's `billing_mode` will be set to the same value as the schedule's `billing_mode`.
|
982
|
-
attr_accessor :billing_mode
|
983
816
|
# The identifier of the customer to create the subscription schedule for.
|
984
817
|
attr_accessor :customer
|
985
|
-
# The identifier of the account to create the subscription schedule for.
|
986
|
-
attr_accessor :customer_account
|
987
818
|
# Object representing the subscription schedule's default settings.
|
988
819
|
attr_accessor :default_settings
|
989
820
|
# Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
|
@@ -996,36 +827,26 @@ module Stripe
|
|
996
827
|
attr_accessor :metadata
|
997
828
|
# 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.
|
998
829
|
attr_accessor :phases
|
999
|
-
# If specified, the invoicing for the given billing cycle iterations will be processed now.
|
1000
|
-
attr_accessor :prebilling
|
1001
830
|
# When the subscription schedule starts. We recommend using `now` so that it starts the subscription immediately. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on.
|
1002
831
|
attr_accessor :start_date
|
1003
832
|
|
1004
833
|
def initialize(
|
1005
|
-
billing_behavior: nil,
|
1006
|
-
billing_mode: nil,
|
1007
834
|
customer: nil,
|
1008
|
-
customer_account: nil,
|
1009
835
|
default_settings: nil,
|
1010
836
|
end_behavior: nil,
|
1011
837
|
expand: nil,
|
1012
838
|
from_subscription: nil,
|
1013
839
|
metadata: nil,
|
1014
840
|
phases: nil,
|
1015
|
-
prebilling: nil,
|
1016
841
|
start_date: nil
|
1017
842
|
)
|
1018
|
-
@billing_behavior = billing_behavior
|
1019
|
-
@billing_mode = billing_mode
|
1020
843
|
@customer = customer
|
1021
|
-
@customer_account = customer_account
|
1022
844
|
@default_settings = default_settings
|
1023
845
|
@end_behavior = end_behavior
|
1024
846
|
@expand = expand
|
1025
847
|
@from_subscription = from_subscription
|
1026
848
|
@metadata = metadata
|
1027
849
|
@phases = phases
|
1028
|
-
@prebilling = prebilling
|
1029
850
|
@start_date = start_date
|
1030
851
|
end
|
1031
852
|
end
|
@@ -1055,6 +876,18 @@ module Stripe
|
|
1055
876
|
end
|
1056
877
|
end
|
1057
878
|
|
879
|
+
class BillingThresholds < Stripe::RequestParams
|
880
|
+
# Monetary threshold that triggers the subscription to advance to a new billing period
|
881
|
+
attr_accessor :amount_gte
|
882
|
+
# 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.
|
883
|
+
attr_accessor :reset_billing_cycle_anchor
|
884
|
+
|
885
|
+
def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil)
|
886
|
+
@amount_gte = amount_gte
|
887
|
+
@reset_billing_cycle_anchor = reset_billing_cycle_anchor
|
888
|
+
end
|
889
|
+
end
|
890
|
+
|
1058
891
|
class InvoiceSettings < Stripe::RequestParams
|
1059
892
|
class Issuer < Stripe::RequestParams
|
1060
893
|
# The connected account being referenced when `type` is `account`.
|
@@ -1098,6 +931,8 @@ module Stripe
|
|
1098
931
|
attr_accessor :automatic_tax
|
1099
932
|
# 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).
|
1100
933
|
attr_accessor :billing_cycle_anchor
|
934
|
+
# 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.
|
935
|
+
attr_accessor :billing_thresholds
|
1101
936
|
# 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.
|
1102
937
|
attr_accessor :collection_method
|
1103
938
|
# 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.
|
@@ -1115,6 +950,7 @@ module Stripe
|
|
1115
950
|
application_fee_percent: nil,
|
1116
951
|
automatic_tax: nil,
|
1117
952
|
billing_cycle_anchor: nil,
|
953
|
+
billing_thresholds: nil,
|
1118
954
|
collection_method: nil,
|
1119
955
|
default_payment_method: nil,
|
1120
956
|
description: nil,
|
@@ -1125,6 +961,7 @@ module Stripe
|
|
1125
961
|
@application_fee_percent = application_fee_percent
|
1126
962
|
@automatic_tax = automatic_tax
|
1127
963
|
@billing_cycle_anchor = billing_cycle_anchor
|
964
|
+
@billing_thresholds = billing_thresholds
|
1128
965
|
@collection_method = collection_method
|
1129
966
|
@default_payment_method = default_payment_method
|
1130
967
|
@description = description
|
@@ -1137,44 +974,16 @@ module Stripe
|
|
1137
974
|
class Phase < Stripe::RequestParams
|
1138
975
|
class AddInvoiceItem < Stripe::RequestParams
|
1139
976
|
class Discount < Stripe::RequestParams
|
1140
|
-
class DiscountEnd < Stripe::RequestParams
|
1141
|
-
class Duration < Stripe::RequestParams
|
1142
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1143
|
-
attr_accessor :interval
|
1144
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1145
|
-
attr_accessor :interval_count
|
1146
|
-
|
1147
|
-
def initialize(interval: nil, interval_count: nil)
|
1148
|
-
@interval = interval
|
1149
|
-
@interval_count = interval_count
|
1150
|
-
end
|
1151
|
-
end
|
1152
|
-
# Time span for the redeemed discount.
|
1153
|
-
attr_accessor :duration
|
1154
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1155
|
-
attr_accessor :timestamp
|
1156
|
-
# The type of calculation made to determine when the discount ends.
|
1157
|
-
attr_accessor :type
|
1158
|
-
|
1159
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
1160
|
-
@duration = duration
|
1161
|
-
@timestamp = timestamp
|
1162
|
-
@type = type
|
1163
|
-
end
|
1164
|
-
end
|
1165
977
|
# ID of the coupon to create a new discount for.
|
1166
978
|
attr_accessor :coupon
|
1167
979
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
1168
980
|
attr_accessor :discount
|
1169
|
-
# Details to determine how long the discount should be applied for.
|
1170
|
-
attr_accessor :discount_end
|
1171
981
|
# ID of the promotion code to create a new discount for.
|
1172
982
|
attr_accessor :promotion_code
|
1173
983
|
|
1174
|
-
def initialize(coupon: nil, discount: nil,
|
984
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1175
985
|
@coupon = coupon
|
1176
986
|
@discount = discount
|
1177
|
-
@discount_end = discount_end
|
1178
987
|
@promotion_code = promotion_code
|
1179
988
|
end
|
1180
989
|
end
|
@@ -1248,45 +1057,29 @@ module Stripe
|
|
1248
1057
|
end
|
1249
1058
|
end
|
1250
1059
|
|
1251
|
-
class
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1255
|
-
|
1256
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1257
|
-
attr_accessor :interval_count
|
1258
|
-
|
1259
|
-
def initialize(interval: nil, interval_count: nil)
|
1260
|
-
@interval = interval
|
1261
|
-
@interval_count = interval_count
|
1262
|
-
end
|
1263
|
-
end
|
1264
|
-
# Time span for the redeemed discount.
|
1265
|
-
attr_accessor :duration
|
1266
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1267
|
-
attr_accessor :timestamp
|
1268
|
-
# The type of calculation made to determine when the discount ends.
|
1269
|
-
attr_accessor :type
|
1060
|
+
class BillingThresholds < Stripe::RequestParams
|
1061
|
+
# Monetary threshold that triggers the subscription to advance to a new billing period
|
1062
|
+
attr_accessor :amount_gte
|
1063
|
+
# 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.
|
1064
|
+
attr_accessor :reset_billing_cycle_anchor
|
1270
1065
|
|
1271
|
-
|
1272
|
-
|
1273
|
-
|
1274
|
-
@type = type
|
1275
|
-
end
|
1066
|
+
def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil)
|
1067
|
+
@amount_gte = amount_gte
|
1068
|
+
@reset_billing_cycle_anchor = reset_billing_cycle_anchor
|
1276
1069
|
end
|
1070
|
+
end
|
1071
|
+
|
1072
|
+
class Discount < Stripe::RequestParams
|
1277
1073
|
# ID of the coupon to create a new discount for.
|
1278
1074
|
attr_accessor :coupon
|
1279
1075
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
1280
1076
|
attr_accessor :discount
|
1281
|
-
# Details to determine how long the discount should be applied for.
|
1282
|
-
attr_accessor :discount_end
|
1283
1077
|
# ID of the promotion code to create a new discount for.
|
1284
1078
|
attr_accessor :promotion_code
|
1285
1079
|
|
1286
|
-
def initialize(coupon: nil, discount: nil,
|
1080
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1287
1081
|
@coupon = coupon
|
1288
1082
|
@discount = discount
|
1289
|
-
@discount_end = discount_end
|
1290
1083
|
@promotion_code = promotion_code
|
1291
1084
|
end
|
1292
1085
|
end
|
@@ -1318,45 +1111,26 @@ module Stripe
|
|
1318
1111
|
end
|
1319
1112
|
|
1320
1113
|
class Item < Stripe::RequestParams
|
1321
|
-
class
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
attr_accessor :interval_count
|
1328
|
-
|
1329
|
-
def initialize(interval: nil, interval_count: nil)
|
1330
|
-
@interval = interval
|
1331
|
-
@interval_count = interval_count
|
1332
|
-
end
|
1333
|
-
end
|
1334
|
-
# Time span for the redeemed discount.
|
1335
|
-
attr_accessor :duration
|
1336
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1337
|
-
attr_accessor :timestamp
|
1338
|
-
# The type of calculation made to determine when the discount ends.
|
1339
|
-
attr_accessor :type
|
1340
|
-
|
1341
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
1342
|
-
@duration = duration
|
1343
|
-
@timestamp = timestamp
|
1344
|
-
@type = type
|
1345
|
-
end
|
1114
|
+
class BillingThresholds < Stripe::RequestParams
|
1115
|
+
# 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))
|
1116
|
+
attr_accessor :usage_gte
|
1117
|
+
|
1118
|
+
def initialize(usage_gte: nil)
|
1119
|
+
@usage_gte = usage_gte
|
1346
1120
|
end
|
1121
|
+
end
|
1122
|
+
|
1123
|
+
class Discount < Stripe::RequestParams
|
1347
1124
|
# ID of the coupon to create a new discount for.
|
1348
1125
|
attr_accessor :coupon
|
1349
1126
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
1350
1127
|
attr_accessor :discount
|
1351
|
-
# Details to determine how long the discount should be applied for.
|
1352
|
-
attr_accessor :discount_end
|
1353
1128
|
# ID of the promotion code to create a new discount for.
|
1354
1129
|
attr_accessor :promotion_code
|
1355
1130
|
|
1356
|
-
def initialize(coupon: nil, discount: nil,
|
1131
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1357
1132
|
@coupon = coupon
|
1358
1133
|
@discount = discount
|
1359
|
-
@discount_end = discount_end
|
1360
1134
|
@promotion_code = promotion_code
|
1361
1135
|
end
|
1362
1136
|
end
|
@@ -1402,18 +1176,8 @@ module Stripe
|
|
1402
1176
|
@unit_amount_decimal = unit_amount_decimal
|
1403
1177
|
end
|
1404
1178
|
end
|
1405
|
-
|
1406
|
-
|
1407
|
-
# List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
|
1408
|
-
attr_accessor :converts_to
|
1409
|
-
# Determines the type of trial for this item.
|
1410
|
-
attr_accessor :type
|
1411
|
-
|
1412
|
-
def initialize(converts_to: nil, type: nil)
|
1413
|
-
@converts_to = converts_to
|
1414
|
-
@type = type
|
1415
|
-
end
|
1416
|
-
end
|
1179
|
+
# 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.
|
1180
|
+
attr_accessor :billing_thresholds
|
1417
1181
|
# The coupons to redeem into discounts for the subscription item.
|
1418
1182
|
attr_accessor :discounts
|
1419
1183
|
# 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`.
|
@@ -1428,19 +1192,18 @@ module Stripe
|
|
1428
1192
|
attr_accessor :quantity
|
1429
1193
|
# A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
|
1430
1194
|
attr_accessor :tax_rates
|
1431
|
-
# Options that configure the trial on the subscription item.
|
1432
|
-
attr_accessor :trial
|
1433
1195
|
|
1434
1196
|
def initialize(
|
1197
|
+
billing_thresholds: nil,
|
1435
1198
|
discounts: nil,
|
1436
1199
|
metadata: nil,
|
1437
1200
|
plan: nil,
|
1438
1201
|
price: nil,
|
1439
1202
|
price_data: nil,
|
1440
1203
|
quantity: nil,
|
1441
|
-
tax_rates: nil
|
1442
|
-
trial: nil
|
1204
|
+
tax_rates: nil
|
1443
1205
|
)
|
1206
|
+
@billing_thresholds = billing_thresholds
|
1444
1207
|
@discounts = discounts
|
1445
1208
|
@metadata = metadata
|
1446
1209
|
@plan = plan
|
@@ -1448,16 +1211,6 @@ module Stripe
|
|
1448
1211
|
@price_data = price_data
|
1449
1212
|
@quantity = quantity
|
1450
1213
|
@tax_rates = tax_rates
|
1451
|
-
@trial = trial
|
1452
|
-
end
|
1453
|
-
end
|
1454
|
-
|
1455
|
-
class PauseCollection < Stripe::RequestParams
|
1456
|
-
# The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
1457
|
-
attr_accessor :behavior
|
1458
|
-
|
1459
|
-
def initialize(behavior: nil)
|
1460
|
-
@behavior = behavior
|
1461
1214
|
end
|
1462
1215
|
end
|
1463
1216
|
|
@@ -1472,23 +1225,6 @@ module Stripe
|
|
1472
1225
|
@destination = destination
|
1473
1226
|
end
|
1474
1227
|
end
|
1475
|
-
|
1476
|
-
class TrialSettings < Stripe::RequestParams
|
1477
|
-
class EndBehavior < Stripe::RequestParams
|
1478
|
-
# Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
1479
|
-
attr_accessor :prorate_up_front
|
1480
|
-
|
1481
|
-
def initialize(prorate_up_front: nil)
|
1482
|
-
@prorate_up_front = prorate_up_front
|
1483
|
-
end
|
1484
|
-
end
|
1485
|
-
# Defines how the subscription should behave when a trial ends.
|
1486
|
-
attr_accessor :end_behavior
|
1487
|
-
|
1488
|
-
def initialize(end_behavior: nil)
|
1489
|
-
@end_behavior = end_behavior
|
1490
|
-
end
|
1491
|
-
end
|
1492
1228
|
# A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items.
|
1493
1229
|
attr_accessor :add_invoice_items
|
1494
1230
|
# A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
|
@@ -1497,6 +1233,8 @@ module Stripe
|
|
1497
1233
|
attr_accessor :automatic_tax
|
1498
1234
|
# 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).
|
1499
1235
|
attr_accessor :billing_cycle_anchor
|
1236
|
+
# 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.
|
1237
|
+
attr_accessor :billing_thresholds
|
1500
1238
|
# 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.
|
1501
1239
|
attr_accessor :collection_method
|
1502
1240
|
# 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).
|
@@ -1521,9 +1259,7 @@ module Stripe
|
|
1521
1259
|
attr_accessor :metadata
|
1522
1260
|
# The account on behalf of which to charge, for each of the associated subscription's invoices.
|
1523
1261
|
attr_accessor :on_behalf_of
|
1524
|
-
#
|
1525
|
-
attr_accessor :pause_collection
|
1526
|
-
# Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. 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 of the current phase.
|
1262
|
+
# 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.
|
1527
1263
|
attr_accessor :proration_behavior
|
1528
1264
|
# The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
|
1529
1265
|
attr_accessor :start_date
|
@@ -1531,18 +1267,15 @@ module Stripe
|
|
1531
1267
|
attr_accessor :transfer_data
|
1532
1268
|
# If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
|
1533
1269
|
attr_accessor :trial
|
1534
|
-
# Specify trial behavior when crossing phase boundaries
|
1535
|
-
attr_accessor :trial_continuation
|
1536
1270
|
# Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial`
|
1537
1271
|
attr_accessor :trial_end
|
1538
|
-
# Settings related to subscription trials.
|
1539
|
-
attr_accessor :trial_settings
|
1540
1272
|
|
1541
1273
|
def initialize(
|
1542
1274
|
add_invoice_items: nil,
|
1543
1275
|
application_fee_percent: nil,
|
1544
1276
|
automatic_tax: nil,
|
1545
1277
|
billing_cycle_anchor: nil,
|
1278
|
+
billing_thresholds: nil,
|
1546
1279
|
collection_method: nil,
|
1547
1280
|
currency: nil,
|
1548
1281
|
default_payment_method: nil,
|
@@ -1555,19 +1288,17 @@ module Stripe
|
|
1555
1288
|
iterations: nil,
|
1556
1289
|
metadata: nil,
|
1557
1290
|
on_behalf_of: nil,
|
1558
|
-
pause_collection: nil,
|
1559
1291
|
proration_behavior: nil,
|
1560
1292
|
start_date: nil,
|
1561
1293
|
transfer_data: nil,
|
1562
1294
|
trial: nil,
|
1563
|
-
|
1564
|
-
trial_end: nil,
|
1565
|
-
trial_settings: nil
|
1295
|
+
trial_end: nil
|
1566
1296
|
)
|
1567
1297
|
@add_invoice_items = add_invoice_items
|
1568
1298
|
@application_fee_percent = application_fee_percent
|
1569
1299
|
@automatic_tax = automatic_tax
|
1570
1300
|
@billing_cycle_anchor = billing_cycle_anchor
|
1301
|
+
@billing_thresholds = billing_thresholds
|
1571
1302
|
@collection_method = collection_method
|
1572
1303
|
@currency = currency
|
1573
1304
|
@default_payment_method = default_payment_method
|
@@ -1580,30 +1311,13 @@ module Stripe
|
|
1580
1311
|
@iterations = iterations
|
1581
1312
|
@metadata = metadata
|
1582
1313
|
@on_behalf_of = on_behalf_of
|
1583
|
-
@pause_collection = pause_collection
|
1584
1314
|
@proration_behavior = proration_behavior
|
1585
1315
|
@start_date = start_date
|
1586
1316
|
@transfer_data = transfer_data
|
1587
1317
|
@trial = trial
|
1588
|
-
@trial_continuation = trial_continuation
|
1589
1318
|
@trial_end = trial_end
|
1590
|
-
@trial_settings = trial_settings
|
1591
1319
|
end
|
1592
1320
|
end
|
1593
|
-
|
1594
|
-
class Prebilling < Stripe::RequestParams
|
1595
|
-
# This is used to determine the number of billing cycles to prebill.
|
1596
|
-
attr_accessor :iterations
|
1597
|
-
# Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
|
1598
|
-
attr_accessor :update_behavior
|
1599
|
-
|
1600
|
-
def initialize(iterations: nil, update_behavior: nil)
|
1601
|
-
@iterations = iterations
|
1602
|
-
@update_behavior = update_behavior
|
1603
|
-
end
|
1604
|
-
end
|
1605
|
-
# Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front.
|
1606
|
-
attr_accessor :billing_behavior
|
1607
1321
|
# Object representing the subscription schedule's default settings.
|
1608
1322
|
attr_accessor :default_settings
|
1609
1323
|
# Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
|
@@ -1614,595 +1328,23 @@ module Stripe
|
|
1614
1328
|
attr_accessor :metadata
|
1615
1329
|
# 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.
|
1616
1330
|
attr_accessor :phases
|
1617
|
-
# If
|
1618
|
-
attr_accessor :prebilling
|
1619
|
-
# If the update changes the current phase, indicates whether the changes should be prorated. The default value is `create_prorations`.
|
1331
|
+
# 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`.
|
1620
1332
|
attr_accessor :proration_behavior
|
1621
1333
|
|
1622
1334
|
def initialize(
|
1623
|
-
billing_behavior: nil,
|
1624
1335
|
default_settings: nil,
|
1625
1336
|
end_behavior: nil,
|
1626
1337
|
expand: nil,
|
1627
1338
|
metadata: nil,
|
1628
1339
|
phases: nil,
|
1629
|
-
prebilling: nil,
|
1630
1340
|
proration_behavior: nil
|
1631
1341
|
)
|
1632
|
-
@billing_behavior = billing_behavior
|
1633
1342
|
@default_settings = default_settings
|
1634
1343
|
@end_behavior = end_behavior
|
1635
1344
|
@expand = expand
|
1636
1345
|
@metadata = metadata
|
1637
1346
|
@phases = phases
|
1638
|
-
@prebilling = prebilling
|
1639
|
-
@proration_behavior = proration_behavior
|
1640
|
-
end
|
1641
|
-
end
|
1642
|
-
|
1643
|
-
class AmendParams < Stripe::RequestParams
|
1644
|
-
class Amendment < Stripe::RequestParams
|
1645
|
-
class AmendmentEnd < Stripe::RequestParams
|
1646
|
-
class DiscountEnd < Stripe::RequestParams
|
1647
|
-
# The ID of a specific discount.
|
1648
|
-
attr_accessor :discount
|
1649
|
-
|
1650
|
-
def initialize(discount: nil)
|
1651
|
-
@discount = discount
|
1652
|
-
end
|
1653
|
-
end
|
1654
|
-
|
1655
|
-
class Duration < Stripe::RequestParams
|
1656
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1657
|
-
attr_accessor :interval
|
1658
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1659
|
-
attr_accessor :interval_count
|
1660
|
-
|
1661
|
-
def initialize(interval: nil, interval_count: nil)
|
1662
|
-
@interval = interval
|
1663
|
-
@interval_count = interval_count
|
1664
|
-
end
|
1665
|
-
end
|
1666
|
-
# Use the `end` time of a given discount.
|
1667
|
-
attr_accessor :discount_end
|
1668
|
-
# Time span for the amendment starting from the `amendment_start`.
|
1669
|
-
attr_accessor :duration
|
1670
|
-
# A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
|
1671
|
-
attr_accessor :timestamp
|
1672
|
-
# Select one of three ways to pass the `amendment_end`.
|
1673
|
-
attr_accessor :type
|
1674
|
-
|
1675
|
-
def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
|
1676
|
-
@discount_end = discount_end
|
1677
|
-
@duration = duration
|
1678
|
-
@timestamp = timestamp
|
1679
|
-
@type = type
|
1680
|
-
end
|
1681
|
-
end
|
1682
|
-
|
1683
|
-
class AmendmentStart < Stripe::RequestParams
|
1684
|
-
class AmendmentEnd < Stripe::RequestParams
|
1685
|
-
# The position of the previous amendment in the `amendments` array after which this amendment should begin. Indexes start from 0 and must be less than the index of the current amendment in the array.
|
1686
|
-
attr_accessor :index
|
1687
|
-
|
1688
|
-
def initialize(index: nil)
|
1689
|
-
@index = index
|
1690
|
-
end
|
1691
|
-
end
|
1692
|
-
|
1693
|
-
class DiscountEnd < Stripe::RequestParams
|
1694
|
-
# The ID of a specific discount.
|
1695
|
-
attr_accessor :discount
|
1696
|
-
|
1697
|
-
def initialize(discount: nil)
|
1698
|
-
@discount = discount
|
1699
|
-
end
|
1700
|
-
end
|
1701
|
-
# Details of another amendment in the same array, immediately after which this amendment should begin.
|
1702
|
-
attr_accessor :amendment_end
|
1703
|
-
# Use the `end` time of a given discount.
|
1704
|
-
attr_accessor :discount_end
|
1705
|
-
# A precise Unix timestamp for the amendment to start.
|
1706
|
-
attr_accessor :timestamp
|
1707
|
-
# Select one of three ways to pass the `amendment_start`.
|
1708
|
-
attr_accessor :type
|
1709
|
-
|
1710
|
-
def initialize(amendment_end: nil, discount_end: nil, timestamp: nil, type: nil)
|
1711
|
-
@amendment_end = amendment_end
|
1712
|
-
@discount_end = discount_end
|
1713
|
-
@timestamp = timestamp
|
1714
|
-
@type = type
|
1715
|
-
end
|
1716
|
-
end
|
1717
|
-
|
1718
|
-
class DiscountAction < Stripe::RequestParams
|
1719
|
-
class Add < Stripe::RequestParams
|
1720
|
-
class DiscountEnd < Stripe::RequestParams
|
1721
|
-
# The type of calculation made to determine when the discount ends.
|
1722
|
-
attr_accessor :type
|
1723
|
-
|
1724
|
-
def initialize(type: nil)
|
1725
|
-
@type = type
|
1726
|
-
end
|
1727
|
-
end
|
1728
|
-
# The coupon code to redeem.
|
1729
|
-
attr_accessor :coupon
|
1730
|
-
# An ID of an existing discount for a coupon that was already redeemed.
|
1731
|
-
attr_accessor :discount
|
1732
|
-
# Details to determine how long the discount should be applied for.
|
1733
|
-
attr_accessor :discount_end
|
1734
|
-
# The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array.
|
1735
|
-
attr_accessor :index
|
1736
|
-
# The promotion code to redeem.
|
1737
|
-
attr_accessor :promotion_code
|
1738
|
-
|
1739
|
-
def initialize(
|
1740
|
-
coupon: nil,
|
1741
|
-
discount: nil,
|
1742
|
-
discount_end: nil,
|
1743
|
-
index: nil,
|
1744
|
-
promotion_code: nil
|
1745
|
-
)
|
1746
|
-
@coupon = coupon
|
1747
|
-
@discount = discount
|
1748
|
-
@discount_end = discount_end
|
1749
|
-
@index = index
|
1750
|
-
@promotion_code = promotion_code
|
1751
|
-
end
|
1752
|
-
end
|
1753
|
-
|
1754
|
-
class Remove < Stripe::RequestParams
|
1755
|
-
# The coupon code to remove from the `discounts` array.
|
1756
|
-
attr_accessor :coupon
|
1757
|
-
# The ID of a discount to remove from the `discounts` array.
|
1758
|
-
attr_accessor :discount
|
1759
|
-
# The ID of a promotion code to remove from the `discounts` array.
|
1760
|
-
attr_accessor :promotion_code
|
1761
|
-
|
1762
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1763
|
-
@coupon = coupon
|
1764
|
-
@discount = discount
|
1765
|
-
@promotion_code = promotion_code
|
1766
|
-
end
|
1767
|
-
end
|
1768
|
-
|
1769
|
-
class Set < Stripe::RequestParams
|
1770
|
-
# The coupon code to replace the `discounts` array with.
|
1771
|
-
attr_accessor :coupon
|
1772
|
-
# An ID of an existing discount to replace the `discounts` array with.
|
1773
|
-
attr_accessor :discount
|
1774
|
-
# An ID of an existing promotion code to replace the `discounts` array with.
|
1775
|
-
attr_accessor :promotion_code
|
1776
|
-
|
1777
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1778
|
-
@coupon = coupon
|
1779
|
-
@discount = discount
|
1780
|
-
@promotion_code = promotion_code
|
1781
|
-
end
|
1782
|
-
end
|
1783
|
-
# Details of the discount to add.
|
1784
|
-
attr_accessor :add
|
1785
|
-
# Details of the discount to remove.
|
1786
|
-
attr_accessor :remove
|
1787
|
-
# Details of the discount to replace the existing discounts with.
|
1788
|
-
attr_accessor :set
|
1789
|
-
# Determines the type of discount action.
|
1790
|
-
attr_accessor :type
|
1791
|
-
|
1792
|
-
def initialize(add: nil, remove: nil, set: nil, type: nil)
|
1793
|
-
@add = add
|
1794
|
-
@remove = remove
|
1795
|
-
@set = set
|
1796
|
-
@type = type
|
1797
|
-
end
|
1798
|
-
end
|
1799
|
-
|
1800
|
-
class ItemAction < Stripe::RequestParams
|
1801
|
-
class Add < Stripe::RequestParams
|
1802
|
-
class Discount < Stripe::RequestParams
|
1803
|
-
class DiscountEnd < Stripe::RequestParams
|
1804
|
-
class Duration < Stripe::RequestParams
|
1805
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1806
|
-
attr_accessor :interval
|
1807
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1808
|
-
attr_accessor :interval_count
|
1809
|
-
|
1810
|
-
def initialize(interval: nil, interval_count: nil)
|
1811
|
-
@interval = interval
|
1812
|
-
@interval_count = interval_count
|
1813
|
-
end
|
1814
|
-
end
|
1815
|
-
# Time span for the redeemed discount.
|
1816
|
-
attr_accessor :duration
|
1817
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1818
|
-
attr_accessor :timestamp
|
1819
|
-
# The type of calculation made to determine when the discount ends.
|
1820
|
-
attr_accessor :type
|
1821
|
-
|
1822
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
1823
|
-
@duration = duration
|
1824
|
-
@timestamp = timestamp
|
1825
|
-
@type = type
|
1826
|
-
end
|
1827
|
-
end
|
1828
|
-
# ID of the coupon to create a new discount for.
|
1829
|
-
attr_accessor :coupon
|
1830
|
-
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
1831
|
-
attr_accessor :discount
|
1832
|
-
# Details to determine how long the discount should be applied for.
|
1833
|
-
attr_accessor :discount_end
|
1834
|
-
# ID of the promotion code to create a new discount for.
|
1835
|
-
attr_accessor :promotion_code
|
1836
|
-
|
1837
|
-
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
1838
|
-
@coupon = coupon
|
1839
|
-
@discount = discount
|
1840
|
-
@discount_end = discount_end
|
1841
|
-
@promotion_code = promotion_code
|
1842
|
-
end
|
1843
|
-
end
|
1844
|
-
|
1845
|
-
class Trial < Stripe::RequestParams
|
1846
|
-
# List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
|
1847
|
-
attr_accessor :converts_to
|
1848
|
-
# Determines the type of trial for this item.
|
1849
|
-
attr_accessor :type
|
1850
|
-
|
1851
|
-
def initialize(converts_to: nil, type: nil)
|
1852
|
-
@converts_to = converts_to
|
1853
|
-
@type = type
|
1854
|
-
end
|
1855
|
-
end
|
1856
|
-
# The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
|
1857
|
-
attr_accessor :discounts
|
1858
|
-
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
1859
|
-
attr_accessor :metadata
|
1860
|
-
# The ID of the price object.
|
1861
|
-
attr_accessor :price
|
1862
|
-
# Quantity for this item.
|
1863
|
-
attr_accessor :quantity
|
1864
|
-
# The tax rates that apply to this subscription item. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`.
|
1865
|
-
attr_accessor :tax_rates
|
1866
|
-
# Options that configure the trial on the subscription item.
|
1867
|
-
attr_accessor :trial
|
1868
|
-
|
1869
|
-
def initialize(
|
1870
|
-
discounts: nil,
|
1871
|
-
metadata: nil,
|
1872
|
-
price: nil,
|
1873
|
-
quantity: nil,
|
1874
|
-
tax_rates: nil,
|
1875
|
-
trial: nil
|
1876
|
-
)
|
1877
|
-
@discounts = discounts
|
1878
|
-
@metadata = metadata
|
1879
|
-
@price = price
|
1880
|
-
@quantity = quantity
|
1881
|
-
@tax_rates = tax_rates
|
1882
|
-
@trial = trial
|
1883
|
-
end
|
1884
|
-
end
|
1885
|
-
|
1886
|
-
class Remove < Stripe::RequestParams
|
1887
|
-
# ID of a price to remove.
|
1888
|
-
attr_accessor :price
|
1889
|
-
|
1890
|
-
def initialize(price: nil)
|
1891
|
-
@price = price
|
1892
|
-
end
|
1893
|
-
end
|
1894
|
-
|
1895
|
-
class Set < Stripe::RequestParams
|
1896
|
-
class Discount < Stripe::RequestParams
|
1897
|
-
class DiscountEnd < Stripe::RequestParams
|
1898
|
-
class Duration < Stripe::RequestParams
|
1899
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1900
|
-
attr_accessor :interval
|
1901
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1902
|
-
attr_accessor :interval_count
|
1903
|
-
|
1904
|
-
def initialize(interval: nil, interval_count: nil)
|
1905
|
-
@interval = interval
|
1906
|
-
@interval_count = interval_count
|
1907
|
-
end
|
1908
|
-
end
|
1909
|
-
# Time span for the redeemed discount.
|
1910
|
-
attr_accessor :duration
|
1911
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1912
|
-
attr_accessor :timestamp
|
1913
|
-
# The type of calculation made to determine when the discount ends.
|
1914
|
-
attr_accessor :type
|
1915
|
-
|
1916
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
1917
|
-
@duration = duration
|
1918
|
-
@timestamp = timestamp
|
1919
|
-
@type = type
|
1920
|
-
end
|
1921
|
-
end
|
1922
|
-
# ID of the coupon to create a new discount for.
|
1923
|
-
attr_accessor :coupon
|
1924
|
-
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
1925
|
-
attr_accessor :discount
|
1926
|
-
# Details to determine how long the discount should be applied for.
|
1927
|
-
attr_accessor :discount_end
|
1928
|
-
# ID of the promotion code to create a new discount for.
|
1929
|
-
attr_accessor :promotion_code
|
1930
|
-
|
1931
|
-
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
1932
|
-
@coupon = coupon
|
1933
|
-
@discount = discount
|
1934
|
-
@discount_end = discount_end
|
1935
|
-
@promotion_code = promotion_code
|
1936
|
-
end
|
1937
|
-
end
|
1938
|
-
|
1939
|
-
class Trial < Stripe::RequestParams
|
1940
|
-
# List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
|
1941
|
-
attr_accessor :converts_to
|
1942
|
-
# Determines the type of trial for this item.
|
1943
|
-
attr_accessor :type
|
1944
|
-
|
1945
|
-
def initialize(converts_to: nil, type: nil)
|
1946
|
-
@converts_to = converts_to
|
1947
|
-
@type = type
|
1948
|
-
end
|
1949
|
-
end
|
1950
|
-
# If an item with the `price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`.
|
1951
|
-
attr_accessor :discounts
|
1952
|
-
# If an item with the `price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`.
|
1953
|
-
attr_accessor :metadata
|
1954
|
-
# The ID of the price object.
|
1955
|
-
attr_accessor :price
|
1956
|
-
# If an item with the `price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`.
|
1957
|
-
attr_accessor :quantity
|
1958
|
-
# If an item with the `price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`.
|
1959
|
-
attr_accessor :tax_rates
|
1960
|
-
# If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`.
|
1961
|
-
attr_accessor :trial
|
1962
|
-
|
1963
|
-
def initialize(
|
1964
|
-
discounts: nil,
|
1965
|
-
metadata: nil,
|
1966
|
-
price: nil,
|
1967
|
-
quantity: nil,
|
1968
|
-
tax_rates: nil,
|
1969
|
-
trial: nil
|
1970
|
-
)
|
1971
|
-
@discounts = discounts
|
1972
|
-
@metadata = metadata
|
1973
|
-
@price = price
|
1974
|
-
@quantity = quantity
|
1975
|
-
@tax_rates = tax_rates
|
1976
|
-
@trial = trial
|
1977
|
-
end
|
1978
|
-
end
|
1979
|
-
# Details of the subscription item to add. If an item with the same `price` exists, it will be replaced by this new item. Otherwise, it adds the new item.
|
1980
|
-
attr_accessor :add
|
1981
|
-
# Details of the subscription item to remove.
|
1982
|
-
attr_accessor :remove
|
1983
|
-
# Details of the subscription item to replace the existing items with. If an item with the `set[price]` already exists, the `items` array is not cleared. Instead, all of the other `set` properties that are passed in this request will replace the existing values for the configuration item.
|
1984
|
-
attr_accessor :set
|
1985
|
-
# Determines the type of item action.
|
1986
|
-
attr_accessor :type
|
1987
|
-
|
1988
|
-
def initialize(add: nil, remove: nil, set: nil, type: nil)
|
1989
|
-
@add = add
|
1990
|
-
@remove = remove
|
1991
|
-
@set = set
|
1992
|
-
@type = type
|
1993
|
-
end
|
1994
|
-
end
|
1995
|
-
|
1996
|
-
class MetadataAction < Stripe::RequestParams
|
1997
|
-
# Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
|
1998
|
-
attr_accessor :add
|
1999
|
-
# Keys to remove from schedule phase metadata.
|
2000
|
-
attr_accessor :remove
|
2001
|
-
# Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
|
2002
|
-
attr_accessor :set
|
2003
|
-
# Select one of three ways to update phase-level `metadata` on subscription schedules.
|
2004
|
-
attr_accessor :type
|
2005
|
-
|
2006
|
-
def initialize(add: nil, remove: nil, set: nil, type: nil)
|
2007
|
-
@add = add
|
2008
|
-
@remove = remove
|
2009
|
-
@set = set
|
2010
|
-
@type = type
|
2011
|
-
end
|
2012
|
-
end
|
2013
|
-
|
2014
|
-
class SetPauseCollection < Stripe::RequestParams
|
2015
|
-
class Set < Stripe::RequestParams
|
2016
|
-
# The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
2017
|
-
attr_accessor :behavior
|
2018
|
-
|
2019
|
-
def initialize(behavior: nil)
|
2020
|
-
@behavior = behavior
|
2021
|
-
end
|
2022
|
-
end
|
2023
|
-
# Details of the pause_collection behavior to apply to the amendment.
|
2024
|
-
attr_accessor :set
|
2025
|
-
# Determines the type of the pause_collection amendment.
|
2026
|
-
attr_accessor :type
|
2027
|
-
|
2028
|
-
def initialize(set: nil, type: nil)
|
2029
|
-
@set = set
|
2030
|
-
@type = type
|
2031
|
-
end
|
2032
|
-
end
|
2033
|
-
|
2034
|
-
class TrialSettings < Stripe::RequestParams
|
2035
|
-
class EndBehavior < Stripe::RequestParams
|
2036
|
-
# Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
2037
|
-
attr_accessor :prorate_up_front
|
2038
|
-
|
2039
|
-
def initialize(prorate_up_front: nil)
|
2040
|
-
@prorate_up_front = prorate_up_front
|
2041
|
-
end
|
2042
|
-
end
|
2043
|
-
# Defines how the subscription should behave when a trial ends.
|
2044
|
-
attr_accessor :end_behavior
|
2045
|
-
|
2046
|
-
def initialize(end_behavior: nil)
|
2047
|
-
@end_behavior = end_behavior
|
2048
|
-
end
|
2049
|
-
end
|
2050
|
-
# Details to identify the end of the time range modified by the proposed change. If not supplied, the amendment is considered a point-in-time operation that only affects the exact timestamp at `amendment_start`, and a restricted set of attributes is supported on the amendment.
|
2051
|
-
attr_accessor :amendment_end
|
2052
|
-
# Details to identify the earliest timestamp where the proposed change should take effect.
|
2053
|
-
attr_accessor :amendment_start
|
2054
|
-
# For point-in-time amendments (having no `amendment_end`), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the `amendment_start` timestamp.For time-span based amendments (having both `amendment_start` and `amendment_end`), the only value valid is `automatic`, which removes any previously configured billing cycle anchor resets scheduled to occur during the window of time spanned by the amendment.
|
2055
|
-
attr_accessor :billing_cycle_anchor
|
2056
|
-
# Changes to the coupons being redeemed or discounts being applied during the amendment time span.
|
2057
|
-
attr_accessor :discount_actions
|
2058
|
-
# Changes to the subscription items during the amendment time span.
|
2059
|
-
attr_accessor :item_actions
|
2060
|
-
# Instructions for how to modify phase metadata
|
2061
|
-
attr_accessor :metadata_actions
|
2062
|
-
# Changes to how Stripe handles prorations during the amendment time span. Affects if and how prorations are created when a future phase starts. In cases where the amendment changes the currently active phase, it is used to determine whether or how to prorate now, at the time of the request. Also supported as a point-in-time operation when `amendment_end` is `null`.
|
2063
|
-
attr_accessor :proration_behavior
|
2064
|
-
# Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
|
2065
|
-
attr_accessor :set_pause_collection
|
2066
|
-
# Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
|
2067
|
-
attr_accessor :set_schedule_end
|
2068
|
-
# Settings related to subscription trials.
|
2069
|
-
attr_accessor :trial_settings
|
2070
|
-
|
2071
|
-
def initialize(
|
2072
|
-
amendment_end: nil,
|
2073
|
-
amendment_start: nil,
|
2074
|
-
billing_cycle_anchor: nil,
|
2075
|
-
discount_actions: nil,
|
2076
|
-
item_actions: nil,
|
2077
|
-
metadata_actions: nil,
|
2078
|
-
proration_behavior: nil,
|
2079
|
-
set_pause_collection: nil,
|
2080
|
-
set_schedule_end: nil,
|
2081
|
-
trial_settings: nil
|
2082
|
-
)
|
2083
|
-
@amendment_end = amendment_end
|
2084
|
-
@amendment_start = amendment_start
|
2085
|
-
@billing_cycle_anchor = billing_cycle_anchor
|
2086
|
-
@discount_actions = discount_actions
|
2087
|
-
@item_actions = item_actions
|
2088
|
-
@metadata_actions = metadata_actions
|
2089
|
-
@proration_behavior = proration_behavior
|
2090
|
-
@set_pause_collection = set_pause_collection
|
2091
|
-
@set_schedule_end = set_schedule_end
|
2092
|
-
@trial_settings = trial_settings
|
2093
|
-
end
|
2094
|
-
end
|
2095
|
-
|
2096
|
-
class Prebilling < Stripe::RequestParams
|
2097
|
-
class BillFrom < Stripe::RequestParams
|
2098
|
-
class AmendmentStart < Stripe::RequestParams
|
2099
|
-
# The position of the amendment in the `amendments` array with which prebilling should begin. Indexes start from 0 and must be less than the total number of supplied amendments.
|
2100
|
-
attr_accessor :index
|
2101
|
-
|
2102
|
-
def initialize(index: nil)
|
2103
|
-
@index = index
|
2104
|
-
end
|
2105
|
-
end
|
2106
|
-
# Start the prebilled period when a specified amendment begins.
|
2107
|
-
attr_accessor :amendment_start
|
2108
|
-
# Start the prebilled period at a precise integer timestamp, starting from the Unix epoch.
|
2109
|
-
attr_accessor :timestamp
|
2110
|
-
# Select one of several ways to pass the `bill_from` value.
|
2111
|
-
attr_accessor :type
|
2112
|
-
|
2113
|
-
def initialize(amendment_start: nil, timestamp: nil, type: nil)
|
2114
|
-
@amendment_start = amendment_start
|
2115
|
-
@timestamp = timestamp
|
2116
|
-
@type = type
|
2117
|
-
end
|
2118
|
-
end
|
2119
|
-
|
2120
|
-
class BillUntil < Stripe::RequestParams
|
2121
|
-
class AmendmentEnd < Stripe::RequestParams
|
2122
|
-
# The position of the amendment in the `amendments` array at which prebilling should end. Indexes start from 0 and must be less than the total number of supplied amendments.
|
2123
|
-
attr_accessor :index
|
2124
|
-
|
2125
|
-
def initialize(index: nil)
|
2126
|
-
@index = index
|
2127
|
-
end
|
2128
|
-
end
|
2129
|
-
|
2130
|
-
class Duration < Stripe::RequestParams
|
2131
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
2132
|
-
attr_accessor :interval
|
2133
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
2134
|
-
attr_accessor :interval_count
|
2135
|
-
|
2136
|
-
def initialize(interval: nil, interval_count: nil)
|
2137
|
-
@interval = interval
|
2138
|
-
@interval_count = interval_count
|
2139
|
-
end
|
2140
|
-
end
|
2141
|
-
# End the prebilled period when a specified amendment ends.
|
2142
|
-
attr_accessor :amendment_end
|
2143
|
-
# Time span for prebilling, starting from `bill_from`.
|
2144
|
-
attr_accessor :duration
|
2145
|
-
# End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
|
2146
|
-
attr_accessor :timestamp
|
2147
|
-
# Select one of several ways to pass the `bill_until` value.
|
2148
|
-
attr_accessor :type
|
2149
|
-
|
2150
|
-
def initialize(amendment_end: nil, duration: nil, timestamp: nil, type: nil)
|
2151
|
-
@amendment_end = amendment_end
|
2152
|
-
@duration = duration
|
2153
|
-
@timestamp = timestamp
|
2154
|
-
@type = type
|
2155
|
-
end
|
2156
|
-
end
|
2157
|
-
# The beginning of the prebilled time period. The default value is `now`.
|
2158
|
-
attr_accessor :bill_from
|
2159
|
-
# The end of the prebilled time period.
|
2160
|
-
attr_accessor :bill_until
|
2161
|
-
# When the prebilling invoice should be created. The default value is `now`.
|
2162
|
-
attr_accessor :invoice_at
|
2163
|
-
# Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
|
2164
|
-
attr_accessor :update_behavior
|
2165
|
-
|
2166
|
-
def initialize(bill_from: nil, bill_until: nil, invoice_at: nil, update_behavior: nil)
|
2167
|
-
@bill_from = bill_from
|
2168
|
-
@bill_until = bill_until
|
2169
|
-
@invoice_at = invoice_at
|
2170
|
-
@update_behavior = update_behavior
|
2171
|
-
end
|
2172
|
-
end
|
2173
|
-
|
2174
|
-
class ScheduleSettings < Stripe::RequestParams
|
2175
|
-
# Behavior of the subscription schedule and underlying subscription when it ends.
|
2176
|
-
attr_accessor :end_behavior
|
2177
|
-
|
2178
|
-
def initialize(end_behavior: nil)
|
2179
|
-
@end_behavior = end_behavior
|
2180
|
-
end
|
2181
|
-
end
|
2182
|
-
# Changes to apply to the phases of the subscription schedule, in the order provided.
|
2183
|
-
attr_accessor :amendments
|
2184
|
-
# Specifies which fields in the response should be expanded.
|
2185
|
-
attr_accessor :expand
|
2186
|
-
# Provide any time periods to bill in advance.
|
2187
|
-
attr_accessor :prebilling
|
2188
|
-
# In cases where the amendment changes the currently active phase,
|
2189
|
-
# specifies if and how to prorate at the time of the request.
|
2190
|
-
attr_accessor :proration_behavior
|
2191
|
-
# Changes to apply to the subscription schedule.
|
2192
|
-
attr_accessor :schedule_settings
|
2193
|
-
|
2194
|
-
def initialize(
|
2195
|
-
amendments: nil,
|
2196
|
-
expand: nil,
|
2197
|
-
prebilling: nil,
|
2198
|
-
proration_behavior: nil,
|
2199
|
-
schedule_settings: nil
|
2200
|
-
)
|
2201
|
-
@amendments = amendments
|
2202
|
-
@expand = expand
|
2203
|
-
@prebilling = prebilling
|
2204
1347
|
@proration_behavior = proration_behavior
|
2205
|
-
@schedule_settings = schedule_settings
|
2206
1348
|
end
|
2207
1349
|
end
|
2208
1350
|
|
@@ -2234,10 +1376,6 @@ module Stripe
|
|
2234
1376
|
end
|
2235
1377
|
# ID of the Connect Application that created the schedule.
|
2236
1378
|
attr_reader :application
|
2237
|
-
# Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front.
|
2238
|
-
attr_reader :billing_behavior
|
2239
|
-
# The [billing mode](/api/subscriptions/create#create_subscription-billing_mode) that will be used to process all future operations for the subscription schedule.
|
2240
|
-
attr_reader :billing_mode
|
2241
1379
|
# Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch.
|
2242
1380
|
attr_reader :canceled_at
|
2243
1381
|
# Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch.
|
@@ -2248,16 +1386,12 @@ module Stripe
|
|
2248
1386
|
attr_reader :current_phase
|
2249
1387
|
# ID of the customer who owns the subscription schedule.
|
2250
1388
|
attr_reader :customer
|
2251
|
-
# ID of the account who owns the subscription schedule.
|
2252
|
-
attr_reader :customer_account
|
2253
1389
|
# Attribute for field default_settings
|
2254
1390
|
attr_reader :default_settings
|
2255
1391
|
# Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
|
2256
1392
|
attr_reader :end_behavior
|
2257
1393
|
# Unique identifier for the object.
|
2258
1394
|
attr_reader :id
|
2259
|
-
# Details of the most recent price migration that failed for the subscription schedule.
|
2260
|
-
attr_reader :last_price_migration_error
|
2261
1395
|
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
|
2262
1396
|
attr_reader :livemode
|
2263
1397
|
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
@@ -2266,8 +1400,6 @@ module Stripe
|
|
2266
1400
|
attr_reader :object
|
2267
1401
|
# Configuration for the subscription schedule's phases.
|
2268
1402
|
attr_reader :phases
|
2269
|
-
# Time period and invoice for a Subscription billed in advance.
|
2270
|
-
attr_reader :prebilling
|
2271
1403
|
# Time at which the subscription schedule was released. Measured in seconds since the Unix epoch.
|
2272
1404
|
attr_reader :released_at
|
2273
1405
|
# ID of the subscription once managed by the subscription schedule (if it is released).
|
@@ -2279,26 +1411,6 @@ module Stripe
|
|
2279
1411
|
# ID of the test clock this subscription schedule belongs to.
|
2280
1412
|
attr_reader :test_clock
|
2281
1413
|
|
2282
|
-
# Amends an existing subscription schedule.
|
2283
|
-
def amend(params = {}, opts = {})
|
2284
|
-
request_stripe_object(
|
2285
|
-
method: :post,
|
2286
|
-
path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(self["id"]) }),
|
2287
|
-
params: params,
|
2288
|
-
opts: opts
|
2289
|
-
)
|
2290
|
-
end
|
2291
|
-
|
2292
|
-
# Amends an existing subscription schedule.
|
2293
|
-
def self.amend(schedule, params = {}, opts = {})
|
2294
|
-
request_stripe_object(
|
2295
|
-
method: :post,
|
2296
|
-
path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(schedule) }),
|
2297
|
-
params: params,
|
2298
|
-
opts: opts
|
2299
|
-
)
|
2300
|
-
end
|
2301
|
-
|
2302
1414
|
# Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active.
|
2303
1415
|
def cancel(params = {}, opts = {})
|
2304
1416
|
request_stripe_object(
|