stripe 15.5.0 → 15.6.0.pre.beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/API_VERSION +1 -1
- data/CHANGELOG.md +1670 -659
- data/README.md +4 -6
- data/VERSION +1 -1
- data/lib/stripe/api_requestor.rb +32 -0
- data/lib/stripe/api_version.rb +1 -2
- data/lib/stripe/errors.rb +60 -0
- data/lib/stripe/event_types.rb +102 -0
- data/lib/stripe/events/v2_core_account_closed_event.rb +21 -0
- data/lib/stripe/events/v2_core_account_created_event.rb +21 -0
- data/lib/stripe/events/v2_core_account_including_configuration_customer_capability_status_updated_event.rb +23 -0
- data/lib/stripe/events/v2_core_account_including_configuration_customer_updated_event.rb +21 -0
- data/lib/stripe/events/v2_core_account_including_configuration_merchant_capability_status_updated_event.rb +23 -0
- data/lib/stripe/events/v2_core_account_including_configuration_merchant_updated_event.rb +21 -0
- data/lib/stripe/events/v2_core_account_including_configuration_recipient_capability_status_updated_event.rb +23 -0
- data/lib/stripe/events/v2_core_account_including_configuration_recipient_updated_event.rb +21 -0
- data/lib/stripe/events/v2_core_account_including_configuration_storer_capability_status_updated_event.rb +23 -0
- data/lib/stripe/events/v2_core_account_including_configuration_storer_updated_event.rb +21 -0
- data/lib/stripe/events/v2_core_account_including_defaults_updated_event.rb +21 -0
- data/lib/stripe/events/v2_core_account_including_identity_updated_event.rb +21 -0
- data/lib/stripe/events/v2_core_account_including_requirements_updated_event.rb +21 -0
- data/lib/stripe/events/v2_core_account_link_returned_event.rb +13 -0
- data/lib/stripe/events/v2_core_account_person_created_event.rb +23 -0
- data/lib/stripe/events/v2_core_account_person_deleted_event.rb +23 -0
- data/lib/stripe/events/v2_core_account_person_updated_event.rb +23 -0
- data/lib/stripe/events/v2_core_account_updated_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_adjustment_created_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_financial_account_created_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_financial_account_updated_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_financial_address_activated_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_financial_address_failed_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_inbound_transfer_available_event.rb +23 -0
- data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_failed_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_processing_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_queued_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_returned_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_succeeded_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_outbound_payment_canceled_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_outbound_payment_created_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_outbound_payment_failed_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_outbound_payment_posted_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_outbound_payment_returned_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_outbound_payment_updated_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_outbound_transfer_canceled_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_outbound_transfer_created_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_outbound_transfer_failed_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_outbound_transfer_posted_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_outbound_transfer_returned_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_outbound_transfer_updated_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_payout_method_updated_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_received_credit_available_event.rb +23 -0
- data/lib/stripe/events/v2_money_management_received_credit_failed_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_received_credit_returned_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_received_credit_succeeded_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_received_debit_canceled_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_received_debit_failed_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_received_debit_pending_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_received_debit_succeeded_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_received_debit_updated_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_transaction_created_event.rb +21 -0
- data/lib/stripe/events/v2_money_management_transaction_updated_event.rb +21 -0
- data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_failed_event.rb +21 -0
- data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_started_event.rb +22 -0
- data/lib/stripe/events/v2_payments_off_session_payment_canceled_event.rb +21 -0
- data/lib/stripe/events/v2_payments_off_session_payment_created_event.rb +21 -0
- data/lib/stripe/events/v2_payments_off_session_payment_failed_event.rb +21 -0
- data/lib/stripe/events/v2_payments_off_session_payment_succeeded_event.rb +21 -0
- data/lib/stripe/object_types.rb +53 -0
- data/lib/stripe/resources/account.rb +653 -1
- data/lib/stripe/resources/account_notice.rb +123 -0
- data/lib/stripe/resources/account_session.rb +256 -1
- data/lib/stripe/resources/balance_settings.rb +112 -0
- data/lib/stripe/resources/billing/credit_balance_summary.rb +2 -0
- data/lib/stripe/resources/billing/credit_balance_transaction.rb +4 -0
- data/lib/stripe/resources/billing/credit_grant.rb +10 -0
- data/lib/stripe/resources/billing/meter_usage.rb +23 -0
- data/lib/stripe/resources/billing/meter_usage_row.rb +28 -0
- data/lib/stripe/resources/billing_portal/session.rb +6 -0
- data/lib/stripe/resources/capital/financing_offer.rb +179 -0
- data/lib/stripe/resources/capital/financing_summary.rb +55 -0
- data/lib/stripe/resources/capital/financing_transaction.rb +114 -0
- data/lib/stripe/resources/card.rb +2 -0
- data/lib/stripe/resources/cash_balance.rb +2 -0
- data/lib/stripe/resources/charge.rb +1540 -0
- data/lib/stripe/resources/checkout/session.rb +495 -4
- data/lib/stripe/resources/confirmation_token.rb +170 -0
- data/lib/stripe/resources/coupon.rb +30 -1
- data/lib/stripe/resources/credit_note.rb +6 -0
- data/lib/stripe/resources/credit_note_line_item.rb +9 -0
- data/lib/stripe/resources/customer.rb +2 -0
- data/lib/stripe/resources/customer_balance_transaction.rb +2 -0
- data/lib/stripe/resources/customer_cash_balance_transaction.rb +2 -0
- data/lib/stripe/resources/customer_session.rb +6 -1
- data/lib/stripe/resources/discount.rb +2 -0
- data/lib/stripe/resources/dispute.rb +11 -0
- data/lib/stripe/resources/event.rb +31 -0
- data/lib/stripe/resources/financial_connections/account.rb +22 -1
- data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +27 -0
- data/lib/stripe/resources/financial_connections/institution.rb +92 -0
- data/lib/stripe/resources/financial_connections/session.rb +62 -2
- data/lib/stripe/resources/fx_quote.rb +186 -0
- data/lib/stripe/resources/identity/verification_session.rb +10 -0
- data/lib/stripe/resources/invoice.rb +1140 -16
- data/lib/stripe/resources/invoice_item.rb +78 -2
- data/lib/stripe/resources/invoice_line_item.rb +55 -1
- data/lib/stripe/resources/invoice_payment.rb +6 -1
- data/lib/stripe/resources/issuing/cardholder.rb +2 -1
- data/lib/stripe/resources/issuing/credit_underwriting_record.rb +602 -0
- data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +82 -0
- data/lib/stripe/resources/issuing/fraud_liability_debit.rb +86 -0
- data/lib/stripe/resources/issuing/settlement.rb +53 -0
- data/lib/stripe/resources/issuing/transaction.rb +6 -0
- data/lib/stripe/resources/line_item.rb +37 -0
- data/lib/stripe/resources/mandate.rb +89 -1
- data/lib/stripe/resources/margin.rb +115 -0
- data/lib/stripe/resources/order.rb +2958 -0
- data/lib/stripe/resources/payment_attempt_record.rb +1181 -0
- data/lib/stripe/resources/payment_intent.rb +6448 -545
- data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +72 -0
- data/lib/stripe/resources/payment_method.rb +194 -1
- data/lib/stripe/resources/payment_method_configuration.rb +295 -0
- data/lib/stripe/resources/payment_record.rb +1727 -0
- data/lib/stripe/resources/price.rb +30 -0
- data/lib/stripe/resources/privacy/redaction_job.rb +298 -0
- data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +33 -0
- data/lib/stripe/resources/promotion_code.rb +10 -0
- data/lib/stripe/resources/quote.rb +2038 -7
- data/lib/stripe/resources/quote_line.rb +274 -0
- data/lib/stripe/resources/quote_preview_invoice.rb +680 -0
- data/lib/stripe/resources/quote_preview_subscription_schedule.rb +395 -0
- data/lib/stripe/resources/refund.rb +9 -0
- data/lib/stripe/resources/setup_attempt.rb +24 -0
- data/lib/stripe/resources/setup_intent.rb +771 -9
- data/lib/stripe/resources/source.rb +29 -0
- data/lib/stripe/resources/subscription.rb +365 -9
- data/lib/stripe/resources/subscription_item.rb +84 -3
- data/lib/stripe/resources/subscription_schedule.rb +1007 -10
- data/lib/stripe/resources/tax/association.rb +66 -0
- data/lib/stripe/resources/tax/form.rb +211 -0
- data/lib/stripe/resources/tax_id.rb +12 -2
- data/lib/stripe/resources/terminal/configuration.rb +33 -0
- data/lib/stripe/resources/terminal/onboarding_link.rb +84 -0
- data/lib/stripe/resources/terminal/reader.rb +8 -0
- data/lib/stripe/resources/terminal/reader_collected_data.rb +31 -0
- data/lib/stripe/resources/transfer.rb +6 -0
- data/lib/stripe/resources/treasury/financial_account.rb +22 -3
- data/lib/stripe/resources/treasury/financial_account_features.rb +2 -0
- data/lib/stripe/resources/treasury/outbound_transfer.rb +37 -0
- data/lib/stripe/resources/treasury/received_credit.rb +38 -1
- data/lib/stripe/resources/treasury/received_debit.rb +40 -1
- data/lib/stripe/resources/v2/core/account.rb +1938 -0
- data/lib/stripe/resources/v2/core/account_link.rb +72 -0
- data/lib/stripe/resources/v2/core/person.rb +276 -0
- data/lib/stripe/resources/v2/core/vault/gb_bank_account.rb +74 -0
- data/lib/stripe/resources/v2/core/vault/us_bank_account.rb +39 -0
- data/lib/stripe/resources/v2/financial_address_credit_simulation.rb +20 -0
- data/lib/stripe/resources/v2/financial_address_generated_microdeposits.rb +22 -0
- data/lib/stripe/resources/v2/money_management/adjustment.rb +51 -0
- data/lib/stripe/resources/v2/money_management/financial_account.rb +79 -0
- data/lib/stripe/resources/v2/money_management/financial_address.rb +68 -0
- data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +94 -0
- data/lib/stripe/resources/v2/money_management/outbound_payment.rb +129 -0
- data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +82 -0
- data/lib/stripe/resources/v2/money_management/outbound_setup_intent.rb +45 -0
- data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +117 -0
- data/lib/stripe/resources/v2/money_management/payout_method.rb +77 -0
- data/lib/stripe/resources/v2/money_management/payout_methods_bank_account_spec.rb +49 -0
- data/lib/stripe/resources/v2/money_management/received_credit.rb +122 -0
- data/lib/stripe/resources/v2/money_management/received_debit.rb +84 -0
- data/lib/stripe/resources/v2/money_management/transaction.rb +80 -0
- data/lib/stripe/resources/v2/money_management/transaction_entry.rb +70 -0
- data/lib/stripe/resources/v2/payments/off_session_payment.rb +89 -0
- data/lib/stripe/resources.rb +109 -0
- data/lib/stripe/services/account_notice_service.rb +101 -0
- data/lib/stripe/services/account_service.rb +562 -1
- data/lib/stripe/services/account_session_service.rb +226 -1
- data/lib/stripe/services/balance_settings_service.rb +99 -0
- data/lib/stripe/services/billing/credit_balance_summary_service.rb +4 -1
- data/lib/stripe/services/billing/credit_balance_transaction_service.rb +4 -0
- data/lib/stripe/services/billing/credit_grant_service.rb +8 -0
- data/lib/stripe/services/billing/meter_usage_service.rb +76 -0
- data/lib/stripe/services/billing_portal/session_service.rb +4 -0
- data/lib/stripe/services/billing_service.rb +2 -1
- data/lib/stripe/services/capital/financing_offer_service.rb +112 -0
- data/lib/stripe/services/capital/financing_summary_service.rb +28 -0
- data/lib/stripe/services/capital/financing_transaction_service.rb +79 -0
- data/lib/stripe/services/capital_service.rb +15 -0
- data/lib/stripe/services/charge_service.rb +1418 -0
- data/lib/stripe/services/checkout/session_service.rb +392 -4
- data/lib/stripe/services/coupon_service.rb +17 -1
- data/lib/stripe/services/credit_note_service.rb +4 -0
- data/lib/stripe/services/customer_session_service.rb +4 -1
- data/{rbi/stripe/services/account_external_account_service.rbi → lib/stripe/services/external_account_service.rb} +135 -122
- data/{rbi/stripe/services/tax/transaction_line_item_service.rbi → lib/stripe/services/financial_connections/account_inferred_balance_service.rb} +21 -17
- data/lib/stripe/services/financial_connections/account_service.rb +7 -2
- data/{rbi/stripe/services/climate/supplier_service.rbi → lib/stripe/services/financial_connections/institution_service.rb} +36 -25
- data/lib/stripe/services/financial_connections/session_service.rb +34 -2
- data/lib/stripe/services/financial_connections_service.rb +2 -1
- data/lib/stripe/services/fx_quote_service.rb +123 -0
- data/lib/stripe/services/identity/verification_session_service.rb +8 -0
- data/lib/stripe/services/invoice_item_service.rb +74 -2
- data/lib/stripe/services/invoice_line_item_service.rb +33 -1
- data/lib/stripe/services/invoice_payment_service.rb +4 -1
- data/lib/stripe/services/invoice_service.rb +1074 -16
- data/lib/stripe/services/issuing/cardholder_service.rb +2 -1
- data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +504 -0
- data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +66 -0
- data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +83 -0
- data/lib/stripe/services/issuing/transaction_service.rb +4 -0
- data/lib/stripe/services/issuing_service.rb +5 -1
- data/lib/stripe/services/mandate_service.rb +40 -0
- data/lib/stripe/services/margin_service.rb +119 -0
- data/{rbi/stripe/services/source_transaction_service.rbi → lib/stripe/services/order_line_item_service.rb} +20 -16
- data/lib/stripe/services/order_service.rb +2388 -0
- data/lib/stripe/services/payment_attempt_record_service.rb +52 -0
- data/{rbi/stripe/services/quote_line_item_service.rbi → lib/stripe/services/payment_intent_amount_details_line_item_service.rb} +20 -16
- data/lib/stripe/services/payment_intent_service.rb +7630 -2215
- data/lib/stripe/services/payment_method_configuration_service.rb +210 -0
- data/lib/stripe/services/payment_method_service.rb +120 -1
- data/lib/stripe/services/payment_record_service.rb +562 -0
- data/lib/stripe/services/price_service.rb +19 -0
- data/lib/stripe/services/privacy/redaction_job_service.rb +240 -0
- data/{rbi/stripe/services/tax/calculation_line_item_service.rbi → lib/stripe/services/privacy/redaction_job_validation_error_service.rb} +21 -17
- data/lib/stripe/services/privacy_service.rb +13 -0
- data/lib/stripe/services/promotion_code_service.rb +8 -0
- data/{rbi/stripe/services/credit_note_line_item_service.rbi → lib/stripe/services/quote_line_service.rb} +20 -16
- data/{rbi/stripe/services/payment_link_line_item_service.rbi → lib/stripe/services/quote_preview_invoice_service.rb} +20 -16
- data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +35 -0
- data/lib/stripe/services/quote_service.rb +1723 -8
- data/lib/stripe/services/setup_intent_service.rb +691 -9
- data/lib/stripe/services/subscription_item_service.rb +75 -3
- data/lib/stripe/services/subscription_schedule_service.rb +911 -10
- data/lib/stripe/services/subscription_service.rb +309 -9
- data/lib/stripe/services/tax/association_service.rb +31 -0
- data/lib/stripe/services/tax/form_service.rb +100 -0
- data/lib/stripe/services/tax_id_service.rb +8 -2
- data/lib/stripe/services/tax_service.rb +3 -1
- data/lib/stripe/services/terminal/configuration_service.rb +26 -0
- data/lib/stripe/services/terminal/onboarding_link_service.rb +56 -0
- data/lib/stripe/services/terminal/reader_collected_data_service.rb +28 -0
- data/lib/stripe/services/terminal_service.rb +3 -1
- data/lib/stripe/services/test_helpers/confirmation_token_service.rb +97 -0
- data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +25 -1
- data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +25 -1
- data/lib/stripe/services/transfer_service.rb +4 -0
- data/lib/stripe/services/treasury/financial_account_features_service.rb +4 -1
- data/lib/stripe/services/treasury/financial_account_service.rb +16 -2
- data/lib/stripe/services/treasury/outbound_transfer_service.rb +24 -0
- data/lib/stripe/services/v1_services.rb +11 -1
- data/lib/stripe/services/v2/core/account_link_service.rb +114 -0
- data/lib/stripe/services/v2/core/account_service.rb +4536 -0
- data/lib/stripe/services/v2/core/accounts/person_service.rb +1045 -0
- data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +130 -0
- data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +107 -0
- data/lib/stripe/services/v2/core/vault_service.rb +18 -0
- data/lib/stripe/services/v2/core_service.rb +4 -1
- data/lib/stripe/services/v2/money_management/adjustment_service.rb +74 -0
- data/lib/stripe/services/v2/money_management/financial_account_service.rb +119 -0
- data/lib/stripe/services/v2/money_management/financial_address_service.rb +82 -0
- data/lib/stripe/services/v2/money_management/inbound_transfer_service.rb +125 -0
- data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +95 -0
- data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +199 -0
- data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +235 -0
- data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +172 -0
- data/lib/stripe/services/v2/money_management/payout_method_service.rb +90 -0
- data/lib/stripe/services/v2/money_management/payout_methods_bank_account_spec_service.rb +32 -0
- data/lib/stripe/services/v2/money_management/received_credit_service.rb +70 -0
- data/lib/stripe/services/v2/money_management/received_debit_service.rb +43 -0
- data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +69 -0
- data/lib/stripe/services/v2/money_management/transaction_service.rb +73 -0
- data/lib/stripe/services/v2/money_management_service.rb +31 -0
- data/lib/stripe/services/v2/payment_service.rb +15 -0
- data/lib/stripe/services/v2/payments/off_session_payment_service.rb +152 -0
- data/lib/stripe/services/v2/test_helper_service.rb +15 -0
- data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +53 -0
- data/lib/stripe/services/v2_services.rb +4 -1
- data/lib/stripe/services.rb +55 -0
- data/lib/stripe/stripe_configuration.rb +3 -1
- data/lib/stripe/stripe_object.rb +1 -1
- data/lib/stripe/util.rb +7 -1
- data/lib/stripe/version.rb +1 -1
- data/lib/stripe.rb +53 -0
- data/rbi/stripe.rbi +201354 -0
- data/stripe.gemspec +4 -1
- metadata +168 -323
- data/rbi/stripe/resources/account.rbi +0 -4991
- data/rbi/stripe/resources/account_link.rbi +0 -76
- data/rbi/stripe/resources/account_session.rbi +0 -1173
- data/rbi/stripe/resources/apple_pay_domain.rbi +0 -88
- data/rbi/stripe/resources/application.rbi +0 -20
- data/rbi/stripe/resources/application_fee.rbi +0 -118
- data/rbi/stripe/resources/application_fee_refund.rbi +0 -37
- data/rbi/stripe/resources/apps/secret.rbi +0 -195
- data/rbi/stripe/resources/balance.rbi +0 -230
- data/rbi/stripe/resources/balance_transaction.rbi +0 -147
- data/rbi/stripe/resources/bank_account.rbi +0 -127
- data/rbi/stripe/resources/billing/alert.rbi +0 -201
- data/rbi/stripe/resources/billing/alert_triggered.rbi +0 -28
- data/rbi/stripe/resources/billing/credit_balance_summary.rbi +0 -63
- data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +0 -147
- data/rbi/stripe/resources/billing/credit_grant.rbi +0 -291
- data/rbi/stripe/resources/billing/meter.rbi +0 -226
- data/rbi/stripe/resources/billing/meter_event.rbi +0 -64
- data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +0 -64
- data/rbi/stripe/resources/billing/meter_event_summary.rbi +0 -35
- data/rbi/stripe/resources/billing_portal/configuration.rbi +0 -712
- data/rbi/stripe/resources/billing_portal/session.rbi +0 -345
- data/rbi/stripe/resources/capability.rbi +0 -125
- data/rbi/stripe/resources/card.rbi +0 -125
- data/rbi/stripe/resources/cash_balance.rbi +0 -32
- data/rbi/stripe/resources/charge.rbi +0 -2136
- data/rbi/stripe/resources/checkout/session.rbi +0 -4105
- data/rbi/stripe/resources/climate/order.rbi +0 -245
- data/rbi/stripe/resources/climate/product.rbi +0 -75
- data/rbi/stripe/resources/climate/supplier.rbi +0 -72
- data/rbi/stripe/resources/confirmation_token.rbi +0 -1818
- data/rbi/stripe/resources/connect_collection_transfer.rbi +0 -26
- data/rbi/stripe/resources/country_spec.rbi +0 -85
- data/rbi/stripe/resources/coupon.rbi +0 -250
- data/rbi/stripe/resources/credit_note.rbi +0 -752
- data/rbi/stripe/resources/credit_note_line_item.rbi +0 -101
- data/rbi/stripe/resources/customer.rbi +0 -993
- data/rbi/stripe/resources/customer_balance_transaction.rbi +0 -56
- data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +0 -151
- data/rbi/stripe/resources/customer_session.rbi +0 -200
- data/rbi/stripe/resources/discount.rbi +0 -53
- data/rbi/stripe/resources/dispute.rbi +0 -761
- data/rbi/stripe/resources/entitlements/active_entitlement.rbi +0 -58
- data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +0 -23
- data/rbi/stripe/resources/entitlements/feature.rbi +0 -117
- data/rbi/stripe/resources/ephemeral_key.rbi +0 -44
- data/rbi/stripe/resources/event.rbi +0 -137
- data/rbi/stripe/resources/exchange_rate.rbi +0 -66
- data/rbi/stripe/resources/file.rbi +0 -143
- data/rbi/stripe/resources/file_link.rbi +0 -141
- data/rbi/stripe/resources/financial_connections/account.rbi +0 -339
- data/rbi/stripe/resources/financial_connections/account_owner.rbi +0 -35
- data/rbi/stripe/resources/financial_connections/account_ownership.rbi +0 -23
- data/rbi/stripe/resources/financial_connections/session.rbi +0 -123
- data/rbi/stripe/resources/financial_connections/transaction.rbi +0 -124
- data/rbi/stripe/resources/forwarding/request.rbi +0 -216
- data/rbi/stripe/resources/funding_instructions.rbi +0 -437
- data/rbi/stripe/resources/identity/verification_report.rbi +0 -360
- data/rbi/stripe/resources/identity/verification_session.rbi +0 -564
- data/rbi/stripe/resources/invoice.rbi +0 -3894
- data/rbi/stripe/resources/invoice_item.rbi +0 -470
- data/rbi/stripe/resources/invoice_line_item.rbi +0 -432
- data/rbi/stripe/resources/invoice_payment.rbi +0 -121
- data/rbi/stripe/resources/invoice_rendering_template.rbi +0 -104
- data/rbi/stripe/resources/issuing/authorization.rbi +0 -1283
- data/rbi/stripe/resources/issuing/card.rbi +0 -749
- data/rbi/stripe/resources/issuing/cardholder.rbi +0 -744
- data/rbi/stripe/resources/issuing/dispute.rbi +0 -913
- data/rbi/stripe/resources/issuing/personalization_design.rbi +0 -338
- data/rbi/stripe/resources/issuing/physical_bundle.rbi +0 -79
- data/rbi/stripe/resources/issuing/token.rbi +0 -226
- data/rbi/stripe/resources/issuing/transaction.rbi +0 -1061
- data/rbi/stripe/resources/line_item.rbi +0 -72
- data/rbi/stripe/resources/login_link.rbi +0 -19
- data/rbi/stripe/resources/mandate.rbi +0 -191
- data/rbi/stripe/resources/payment_intent.rbi +0 -10011
- data/rbi/stripe/resources/payment_link.rbi +0 -1891
- data/rbi/stripe/resources/payment_method.rbi +0 -1770
- data/rbi/stripe/resources/payment_method_configuration.rbi +0 -3550
- data/rbi/stripe/resources/payment_method_domain.rbi +0 -228
- data/rbi/stripe/resources/payout.rbi +0 -307
- data/rbi/stripe/resources/person.rbi +0 -401
- data/rbi/stripe/resources/plan.rbi +0 -371
- data/rbi/stripe/resources/price.rbi +0 -694
- data/rbi/stripe/resources/product.rbi +0 -553
- data/rbi/stripe/resources/product_feature.rbi +0 -26
- data/rbi/stripe/resources/promotion_code.rbi +0 -264
- data/rbi/stripe/resources/quote.rbi +0 -1137
- data/rbi/stripe/resources/radar/early_fraud_warning.rbi +0 -98
- data/rbi/stripe/resources/radar/value_list.rbi +0 -168
- data/rbi/stripe/resources/radar/value_list_item.rbi +0 -129
- data/rbi/stripe/resources/refund.rbi +0 -523
- data/rbi/stripe/resources/reporting/report_run.rbi +0 -191
- data/rbi/stripe/resources/reporting/report_type.rbi +0 -57
- data/rbi/stripe/resources/reserve_transaction.rbi +0 -23
- data/rbi/stripe/resources/reversal.rbi +0 -51
- data/rbi/stripe/resources/review.rbi +0 -154
- data/rbi/stripe/resources/setup_attempt.rbi +0 -477
- data/rbi/stripe/resources/setup_intent.rbi +0 -3974
- data/rbi/stripe/resources/shipping_rate.rbi +0 -305
- data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +0 -75
- data/rbi/stripe/resources/source.rbi +0 -1496
- data/rbi/stripe/resources/source_mandate_notification.rbi +0 -77
- data/rbi/stripe/resources/source_transaction.rbi +0 -127
- data/rbi/stripe/resources/subscription.rbi +0 -2154
- data/rbi/stripe/resources/subscription_item.rbi +0 -404
- data/rbi/stripe/resources/subscription_schedule.rbi +0 -1795
- data/rbi/stripe/resources/tax/calculation.rbi +0 -478
- data/rbi/stripe/resources/tax/calculation_line_item.rbi +0 -91
- data/rbi/stripe/resources/tax/registration.rbi +0 -3216
- data/rbi/stripe/resources/tax/settings.rbi +0 -141
- data/rbi/stripe/resources/tax/transaction.rbi +0 -351
- data/rbi/stripe/resources/tax/transaction_line_item.rbi +0 -54
- data/rbi/stripe/resources/tax_code.rbi +0 -44
- data/rbi/stripe/resources/tax_deducted_at_source.rbi +0 -23
- data/rbi/stripe/resources/tax_id.rbi +0 -165
- data/rbi/stripe/resources/tax_rate.rbi +0 -239
- data/rbi/stripe/resources/terminal/configuration.rbi +0 -1647
- data/rbi/stripe/resources/terminal/connection_token.rbi +0 -37
- data/rbi/stripe/resources/terminal/location.rbi +0 -222
- data/rbi/stripe/resources/terminal/reader.rbi +0 -1016
- data/rbi/stripe/resources/test_helpers/test_clock.rbi +0 -132
- data/rbi/stripe/resources/token.rbi +0 -1281
- data/rbi/stripe/resources/topup.rbi +0 -222
- data/rbi/stripe/resources/transfer.rbi +0 -199
- data/rbi/stripe/resources/treasury/credit_reversal.rbi +0 -119
- data/rbi/stripe/resources/treasury/debit_reversal.rbi +0 -131
- data/rbi/stripe/resources/treasury/financial_account.rbi +0 -869
- data/rbi/stripe/resources/treasury/financial_account_features.rbi +0 -260
- data/rbi/stripe/resources/treasury/inbound_transfer.rbi +0 -295
- data/rbi/stripe/resources/treasury/outbound_payment.rbi +0 -592
- data/rbi/stripe/resources/treasury/outbound_transfer.rbi +0 -431
- data/rbi/stripe/resources/treasury/received_credit.rbi +0 -302
- data/rbi/stripe/resources/treasury/received_debit.rbi +0 -256
- data/rbi/stripe/resources/treasury/transaction.rbi +0 -215
- data/rbi/stripe/resources/treasury/transaction_entry.rbi +0 -192
- data/rbi/stripe/resources/v2/amount.rbi +0 -14
- data/rbi/stripe/resources/v2/billing/meter_event.rbi +0 -37
- data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +0 -41
- data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +0 -31
- data/rbi/stripe/resources/v2/event.rbi +0 -48
- data/rbi/stripe/resources/v2/event_destination.rbi +0 -91
- data/rbi/stripe/resources/webhook_endpoint.rbi +0 -168
- data/rbi/stripe/services/account_capability_service.rbi +0 -51
- data/rbi/stripe/services/account_link_service.rbi +0 -60
- data/rbi/stripe/services/account_login_link_service.rbi +0 -22
- data/rbi/stripe/services/account_person_service.rbi +0 -1007
- data/rbi/stripe/services/account_service.rbi +0 -4281
- data/rbi/stripe/services/account_session_service.rbi +0 -748
- data/rbi/stripe/services/apple_pay_domain_service.rbi +0 -76
- data/rbi/stripe/services/application_fee_refund_service.rbi +0 -93
- data/rbi/stripe/services/application_fee_service.rbi +0 -78
- data/rbi/stripe/services/apps/secret_service.rbi +0 -151
- data/rbi/stripe/services/apps_service.rbi +0 -9
- data/rbi/stripe/services/balance_service.rbi +0 -21
- data/rbi/stripe/services/balance_transaction_service.rbi +0 -93
- data/rbi/stripe/services/billing/alert_service.rbi +0 -152
- data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +0 -68
- data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +0 -59
- data/rbi/stripe/services/billing/credit_grant_service.rbi +0 -211
- data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +0 -42
- data/rbi/stripe/services/billing/meter_event_service.rbi +0 -42
- data/rbi/stripe/services/billing/meter_event_summary_service.rbi +0 -54
- data/rbi/stripe/services/billing/meter_service.rbi +0 -163
- data/rbi/stripe/services/billing_portal/configuration_service.rbi +0 -561
- data/rbi/stripe/services/billing_portal/session_service.rbi +0 -204
- data/rbi/stripe/services/billing_portal_service.rbi +0 -10
- data/rbi/stripe/services/billing_service.rbi +0 -15
- data/rbi/stripe/services/charge_service.rbi +0 -448
- data/rbi/stripe/services/checkout/session_line_item_service.rbi +0 -33
- data/rbi/stripe/services/checkout/session_service.rbi +0 -2697
- data/rbi/stripe/services/checkout_service.rbi +0 -9
- data/rbi/stripe/services/climate/order_service.rbi +0 -142
- data/rbi/stripe/services/climate/product_service.rbi +0 -46
- data/rbi/stripe/services/climate_service.rbi +0 -11
- data/rbi/stripe/services/confirmation_token_service.rbi +0 -20
- data/rbi/stripe/services/country_spec_service.rbi +0 -44
- data/rbi/stripe/services/coupon_service.rbi +0 -194
- data/rbi/stripe/services/credit_note_preview_lines_service.rbi +0 -167
- data/rbi/stripe/services/credit_note_service.rbi +0 -415
- data/rbi/stripe/services/customer_balance_transaction_service.rbi +0 -92
- data/rbi/stripe/services/customer_cash_balance_service.rbi +0 -45
- data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +0 -44
- data/rbi/stripe/services/customer_funding_instructions_service.rbi +0 -59
- data/rbi/stripe/services/customer_payment_method_service.rbi +0 -57
- data/rbi/stripe/services/customer_payment_source_service.rbi +0 -232
- data/rbi/stripe/services/customer_service.rbi +0 -635
- data/rbi/stripe/services/customer_session_service.rbi +0 -116
- data/rbi/stripe/services/customer_tax_id_service.rbi +0 -70
- data/rbi/stripe/services/dispute_service.rbi +0 -424
- data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +0 -55
- data/rbi/stripe/services/entitlements/feature_service.rbi +0 -107
- data/rbi/stripe/services/entitlements_service.rbi +0 -10
- data/rbi/stripe/services/ephemeral_key_service.rbi +0 -53
- data/rbi/stripe/services/event_service.rbi +0 -83
- data/rbi/stripe/services/exchange_rate_service.rbi +0 -44
- data/rbi/stripe/services/file_link_service.rbi +0 -124
- data/rbi/stripe/services/file_service.rbi +0 -116
- data/rbi/stripe/services/financial_connections/account_owner_service.rbi +0 -42
- data/rbi/stripe/services/financial_connections/account_service.rbi +0 -133
- data/rbi/stripe/services/financial_connections/session_service.rbi +0 -88
- data/rbi/stripe/services/financial_connections/transaction_service.rbi +0 -92
- data/rbi/stripe/services/financial_connections_service.rbi +0 -11
- data/rbi/stripe/services/forwarding/request_service.rbi +0 -134
- data/rbi/stripe/services/forwarding_service.rbi +0 -9
- data/rbi/stripe/services/identity/verification_report_service.rbi +0 -87
- data/rbi/stripe/services/identity/verification_session_service.rbi +0 -339
- data/rbi/stripe/services/identity_service.rbi +0 -10
- data/rbi/stripe/services/invoice_item_service.rbi +0 -366
- data/rbi/stripe/services/invoice_line_item_service.rbi +0 -259
- data/rbi/stripe/services/invoice_payment_service.rbi +0 -71
- data/rbi/stripe/services/invoice_rendering_template_service.rbi +0 -82
- data/rbi/stripe/services/invoice_service.rbi +0 -3073
- data/rbi/stripe/services/issuing/authorization_service.rbi +0 -146
- data/rbi/stripe/services/issuing/card_service.rbi +0 -503
- data/rbi/stripe/services/issuing/cardholder_service.rbi +0 -587
- data/rbi/stripe/services/issuing/dispute_service.rbi +0 -707
- data/rbi/stripe/services/issuing/personalization_design_service.rbi +0 -243
- data/rbi/stripe/services/issuing/physical_bundle_service.rbi +0 -59
- data/rbi/stripe/services/issuing/token_service.rbi +0 -99
- data/rbi/stripe/services/issuing/transaction_service.rbi +0 -105
- data/rbi/stripe/services/issuing_service.rbi +0 -16
- data/rbi/stripe/services/mandate_service.rbi +0 -20
- data/rbi/stripe/services/payment_intent_service.rbi +0 -8010
- data/rbi/stripe/services/payment_link_service.rbi +0 -1441
- data/rbi/stripe/services/payment_method_configuration_service.rbi +0 -2487
- data/rbi/stripe/services/payment_method_domain_service.rbi +0 -112
- data/rbi/stripe/services/payment_method_service.rbi +0 -781
- data/rbi/stripe/services/payout_service.rbi +0 -209
- data/rbi/stripe/services/plan_service.rbi +0 -282
- data/rbi/stripe/services/price_service.rbi +0 -546
- data/rbi/stripe/services/product_feature_service.rbi +0 -67
- data/rbi/stripe/services/product_service.rbi +0 -477
- data/rbi/stripe/services/promotion_code_service.rbi +0 -214
- data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +0 -31
- data/rbi/stripe/services/quote_service.rbi +0 -695
- data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +0 -85
- data/rbi/stripe/services/radar/value_list_item_service.rbi +0 -109
- data/rbi/stripe/services/radar/value_list_service.rbi +0 -141
- data/rbi/stripe/services/radar_service.rbi +0 -11
- data/rbi/stripe/services/refund_service.rbi +0 -185
- data/rbi/stripe/services/reporting/report_run_service.rbi +0 -135
- data/rbi/stripe/services/reporting/report_type_service.rbi +0 -35
- data/rbi/stripe/services/reporting_service.rbi +0 -10
- data/rbi/stripe/services/review_service.rbi +0 -84
- data/rbi/stripe/services/setup_attempt_service.rbi +0 -65
- data/rbi/stripe/services/setup_intent_service.rbi +0 -3709
- data/rbi/stripe/services/shipping_rate_service.rbi +0 -241
- data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +0 -46
- data/rbi/stripe/services/sigma_service.rbi +0 -9
- data/rbi/stripe/services/source_service.rbi +0 -663
- data/rbi/stripe/services/subscription_item_service.rbi +0 -350
- data/rbi/stripe/services/subscription_schedule_service.rbi +0 -1425
- data/rbi/stripe/services/subscription_service.rbi +0 -1768
- data/rbi/stripe/services/tax/calculation_service.rbi +0 -234
- data/rbi/stripe/services/tax/registration_service.rbi +0 -2278
- data/rbi/stripe/services/tax/settings_service.rbi +0 -93
- data/rbi/stripe/services/tax/transaction_service.rbi +0 -146
- data/rbi/stripe/services/tax_code_service.rbi +0 -44
- data/rbi/stripe/services/tax_id_service.rbi +0 -110
- data/rbi/stripe/services/tax_rate_service.rbi +0 -185
- data/rbi/stripe/services/tax_service.rbi +0 -12
- data/rbi/stripe/services/terminal/configuration_service.rbi +0 -1328
- data/rbi/stripe/services/terminal/connection_token_service.rbi +0 -25
- data/rbi/stripe/services/terminal/location_service.rbi +0 -182
- data/rbi/stripe/services/terminal/reader_service.rbi +0 -540
- data/rbi/stripe/services/terminal_service.rbi +0 -12
- data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +0 -746
- data/rbi/stripe/services/test_helpers/customer_service.rbi +0 -33
- data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +0 -848
- data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +0 -76
- data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +0 -69
- data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +0 -711
- data/rbi/stripe/services/test_helpers/issuing_service.rbi +0 -14
- data/rbi/stripe/services/test_helpers/refund_service.rbi +0 -22
- data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +0 -117
- data/rbi/stripe/services/test_helpers/terminal_service.rbi +0 -11
- data/rbi/stripe/services/test_helpers/test_clock_service.rbi +0 -90
- data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +0 -64
- data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +0 -125
- data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +0 -125
- data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +0 -87
- data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +0 -87
- data/rbi/stripe/services/test_helpers/treasury_service.rbi +0 -15
- data/rbi/stripe/services/test_helpers_service.rbi +0 -15
- data/rbi/stripe/services/token_service.rbi +0 -1255
- data/rbi/stripe/services/topup_service.rbi +0 -176
- data/rbi/stripe/services/transfer_reversal_service.rbi +0 -101
- data/rbi/stripe/services/transfer_service.rbi +0 -152
- data/rbi/stripe/services/treasury/credit_reversal_service.rbi +0 -84
- data/rbi/stripe/services/treasury/debit_reversal_service.rbi +0 -88
- data/rbi/stripe/services/treasury/financial_account_features_service.rbi +0 -198
- data/rbi/stripe/services/treasury/financial_account_service.rbi +0 -566
- data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +0 -117
- data/rbi/stripe/services/treasury/outbound_payment_service.rbi +0 -304
- data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +0 -157
- data/rbi/stripe/services/treasury/received_credit_service.rbi +0 -72
- data/rbi/stripe/services/treasury/received_debit_service.rbi +0 -59
- data/rbi/stripe/services/treasury/transaction_entry_service.rbi +0 -111
- data/rbi/stripe/services/treasury/transaction_service.rbi +0 -122
- data/rbi/stripe/services/treasury_service.rbi +0 -18
- data/rbi/stripe/services/v1_services.rbi +0 -77
- data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +0 -39
- data/rbi/stripe/services/v2/billing/meter_event_service.rbi +0 -42
- data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +0 -18
- data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +0 -55
- data/rbi/stripe/services/v2/billing_service.rbi +0 -14
- data/rbi/stripe/services/v2/core/event_destination_service.rbi +0 -192
- data/rbi/stripe/services/v2/core/event_service.rbi +0 -36
- data/rbi/stripe/services/v2/core_service.rbi +0 -12
- data/rbi/stripe/services/v2_services.rbi +0 -10
- data/rbi/stripe/services/webhook_endpoint_service.rbi +0 -129
@@ -83,6 +83,8 @@ module Stripe
|
|
83
83
|
attr_accessor :created
|
84
84
|
# Only return subscription schedules for the given customer.
|
85
85
|
attr_accessor :customer
|
86
|
+
# Only return subscription schedules for the given account.
|
87
|
+
attr_accessor :customer_account
|
86
88
|
# 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.
|
87
89
|
attr_accessor :ending_before
|
88
90
|
# Specifies which fields in the response should be expanded.
|
@@ -101,6 +103,7 @@ module Stripe
|
|
101
103
|
completed_at: nil,
|
102
104
|
created: nil,
|
103
105
|
customer: nil,
|
106
|
+
customer_account: nil,
|
104
107
|
ending_before: nil,
|
105
108
|
expand: nil,
|
106
109
|
limit: nil,
|
@@ -112,6 +115,7 @@ module Stripe
|
|
112
115
|
@completed_at = completed_at
|
113
116
|
@created = created
|
114
117
|
@customer = customer
|
118
|
+
@customer_account = customer_account
|
115
119
|
@ending_before = ending_before
|
116
120
|
@expand = expand
|
117
121
|
@limit = limit
|
@@ -253,16 +257,44 @@ module Stripe
|
|
253
257
|
class Phase < Stripe::RequestParams
|
254
258
|
class AddInvoiceItem < Stripe::RequestParams
|
255
259
|
class Discount < Stripe::RequestParams
|
260
|
+
class DiscountEnd < Stripe::RequestParams
|
261
|
+
class Duration < Stripe::RequestParams
|
262
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
263
|
+
attr_accessor :interval
|
264
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
265
|
+
attr_accessor :interval_count
|
266
|
+
|
267
|
+
def initialize(interval: nil, interval_count: nil)
|
268
|
+
@interval = interval
|
269
|
+
@interval_count = interval_count
|
270
|
+
end
|
271
|
+
end
|
272
|
+
# Time span for the redeemed discount.
|
273
|
+
attr_accessor :duration
|
274
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
275
|
+
attr_accessor :timestamp
|
276
|
+
# The type of calculation made to determine when the discount ends.
|
277
|
+
attr_accessor :type
|
278
|
+
|
279
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
280
|
+
@duration = duration
|
281
|
+
@timestamp = timestamp
|
282
|
+
@type = type
|
283
|
+
end
|
284
|
+
end
|
256
285
|
# ID of the coupon to create a new discount for.
|
257
286
|
attr_accessor :coupon
|
258
287
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
259
288
|
attr_accessor :discount
|
289
|
+
# Details to determine how long the discount should be applied for.
|
290
|
+
attr_accessor :discount_end
|
260
291
|
# ID of the promotion code to create a new discount for.
|
261
292
|
attr_accessor :promotion_code
|
262
293
|
|
263
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
294
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
264
295
|
@coupon = coupon
|
265
296
|
@discount = discount
|
297
|
+
@discount_end = discount_end
|
266
298
|
@promotion_code = promotion_code
|
267
299
|
end
|
268
300
|
end
|
@@ -398,16 +430,44 @@ module Stripe
|
|
398
430
|
end
|
399
431
|
|
400
432
|
class Discount < Stripe::RequestParams
|
433
|
+
class DiscountEnd < Stripe::RequestParams
|
434
|
+
class Duration < Stripe::RequestParams
|
435
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
436
|
+
attr_accessor :interval
|
437
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
438
|
+
attr_accessor :interval_count
|
439
|
+
|
440
|
+
def initialize(interval: nil, interval_count: nil)
|
441
|
+
@interval = interval
|
442
|
+
@interval_count = interval_count
|
443
|
+
end
|
444
|
+
end
|
445
|
+
# Time span for the redeemed discount.
|
446
|
+
attr_accessor :duration
|
447
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
448
|
+
attr_accessor :timestamp
|
449
|
+
# The type of calculation made to determine when the discount ends.
|
450
|
+
attr_accessor :type
|
451
|
+
|
452
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
453
|
+
@duration = duration
|
454
|
+
@timestamp = timestamp
|
455
|
+
@type = type
|
456
|
+
end
|
457
|
+
end
|
401
458
|
# ID of the coupon to create a new discount for.
|
402
459
|
attr_accessor :coupon
|
403
460
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
404
461
|
attr_accessor :discount
|
462
|
+
# Details to determine how long the discount should be applied for.
|
463
|
+
attr_accessor :discount_end
|
405
464
|
# ID of the promotion code to create a new discount for.
|
406
465
|
attr_accessor :promotion_code
|
407
466
|
|
408
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
467
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
409
468
|
@coupon = coupon
|
410
469
|
@discount = discount
|
470
|
+
@discount_end = discount_end
|
411
471
|
@promotion_code = promotion_code
|
412
472
|
end
|
413
473
|
end
|
@@ -461,16 +521,44 @@ module Stripe
|
|
461
521
|
end
|
462
522
|
|
463
523
|
class Discount < Stripe::RequestParams
|
524
|
+
class DiscountEnd < Stripe::RequestParams
|
525
|
+
class Duration < Stripe::RequestParams
|
526
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
527
|
+
attr_accessor :interval
|
528
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
529
|
+
attr_accessor :interval_count
|
530
|
+
|
531
|
+
def initialize(interval: nil, interval_count: nil)
|
532
|
+
@interval = interval
|
533
|
+
@interval_count = interval_count
|
534
|
+
end
|
535
|
+
end
|
536
|
+
# Time span for the redeemed discount.
|
537
|
+
attr_accessor :duration
|
538
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
539
|
+
attr_accessor :timestamp
|
540
|
+
# The type of calculation made to determine when the discount ends.
|
541
|
+
attr_accessor :type
|
542
|
+
|
543
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
544
|
+
@duration = duration
|
545
|
+
@timestamp = timestamp
|
546
|
+
@type = type
|
547
|
+
end
|
548
|
+
end
|
464
549
|
# ID of the coupon to create a new discount for.
|
465
550
|
attr_accessor :coupon
|
466
551
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
467
552
|
attr_accessor :discount
|
553
|
+
# Details to determine how long the discount should be applied for.
|
554
|
+
attr_accessor :discount_end
|
468
555
|
# ID of the promotion code to create a new discount for.
|
469
556
|
attr_accessor :promotion_code
|
470
557
|
|
471
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
558
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
472
559
|
@coupon = coupon
|
473
560
|
@discount = discount
|
561
|
+
@discount_end = discount_end
|
474
562
|
@promotion_code = promotion_code
|
475
563
|
end
|
476
564
|
end
|
@@ -516,6 +604,18 @@ module Stripe
|
|
516
604
|
@unit_amount_decimal = unit_amount_decimal
|
517
605
|
end
|
518
606
|
end
|
607
|
+
|
608
|
+
class Trial < Stripe::RequestParams
|
609
|
+
# 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.
|
610
|
+
attr_accessor :converts_to
|
611
|
+
# Determines the type of trial for this item.
|
612
|
+
attr_accessor :type
|
613
|
+
|
614
|
+
def initialize(converts_to: nil, type: nil)
|
615
|
+
@converts_to = converts_to
|
616
|
+
@type = type
|
617
|
+
end
|
618
|
+
end
|
519
619
|
# 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.
|
520
620
|
attr_accessor :billing_thresholds
|
521
621
|
# The coupons to redeem into discounts for the subscription item.
|
@@ -532,6 +632,8 @@ module Stripe
|
|
532
632
|
attr_accessor :quantity
|
533
633
|
# 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.
|
534
634
|
attr_accessor :tax_rates
|
635
|
+
# Options that configure the trial on the subscription item.
|
636
|
+
attr_accessor :trial
|
535
637
|
|
536
638
|
def initialize(
|
537
639
|
billing_thresholds: nil,
|
@@ -541,7 +643,8 @@ module Stripe
|
|
541
643
|
price: nil,
|
542
644
|
price_data: nil,
|
543
645
|
quantity: nil,
|
544
|
-
tax_rates: nil
|
646
|
+
tax_rates: nil,
|
647
|
+
trial: nil
|
545
648
|
)
|
546
649
|
@billing_thresholds = billing_thresholds
|
547
650
|
@discounts = discounts
|
@@ -551,6 +654,16 @@ module Stripe
|
|
551
654
|
@price_data = price_data
|
552
655
|
@quantity = quantity
|
553
656
|
@tax_rates = tax_rates
|
657
|
+
@trial = trial
|
658
|
+
end
|
659
|
+
end
|
660
|
+
|
661
|
+
class PauseCollection < Stripe::RequestParams
|
662
|
+
# The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
663
|
+
attr_accessor :behavior
|
664
|
+
|
665
|
+
def initialize(behavior: nil)
|
666
|
+
@behavior = behavior
|
554
667
|
end
|
555
668
|
end
|
556
669
|
|
@@ -565,6 +678,23 @@ module Stripe
|
|
565
678
|
@destination = destination
|
566
679
|
end
|
567
680
|
end
|
681
|
+
|
682
|
+
class TrialSettings < Stripe::RequestParams
|
683
|
+
class EndBehavior < Stripe::RequestParams
|
684
|
+
# Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
685
|
+
attr_accessor :prorate_up_front
|
686
|
+
|
687
|
+
def initialize(prorate_up_front: nil)
|
688
|
+
@prorate_up_front = prorate_up_front
|
689
|
+
end
|
690
|
+
end
|
691
|
+
# Defines how the subscription should behave when a trial ends.
|
692
|
+
attr_accessor :end_behavior
|
693
|
+
|
694
|
+
def initialize(end_behavior: nil)
|
695
|
+
@end_behavior = end_behavior
|
696
|
+
end
|
697
|
+
end
|
568
698
|
# 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.
|
569
699
|
attr_accessor :add_invoice_items
|
570
700
|
# 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).
|
@@ -601,14 +731,20 @@ module Stripe
|
|
601
731
|
attr_accessor :metadata
|
602
732
|
# The account on behalf of which to charge, for each of the associated subscription's invoices.
|
603
733
|
attr_accessor :on_behalf_of
|
734
|
+
# If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment).
|
735
|
+
attr_accessor :pause_collection
|
604
736
|
# 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.
|
605
737
|
attr_accessor :proration_behavior
|
606
738
|
# The data with which to automatically create a Transfer for each of the associated subscription's invoices.
|
607
739
|
attr_accessor :transfer_data
|
608
740
|
# If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
|
609
741
|
attr_accessor :trial
|
742
|
+
# Specify trial behavior when crossing phase boundaries
|
743
|
+
attr_accessor :trial_continuation
|
610
744
|
# 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`
|
611
745
|
attr_accessor :trial_end
|
746
|
+
# Settings related to subscription trials.
|
747
|
+
attr_accessor :trial_settings
|
612
748
|
|
613
749
|
def initialize(
|
614
750
|
add_invoice_items: nil,
|
@@ -629,10 +765,13 @@ module Stripe
|
|
629
765
|
iterations: nil,
|
630
766
|
metadata: nil,
|
631
767
|
on_behalf_of: nil,
|
768
|
+
pause_collection: nil,
|
632
769
|
proration_behavior: nil,
|
633
770
|
transfer_data: nil,
|
634
771
|
trial: nil,
|
635
|
-
|
772
|
+
trial_continuation: nil,
|
773
|
+
trial_end: nil,
|
774
|
+
trial_settings: nil
|
636
775
|
)
|
637
776
|
@add_invoice_items = add_invoice_items
|
638
777
|
@application_fee_percent = application_fee_percent
|
@@ -652,16 +791,35 @@ module Stripe
|
|
652
791
|
@iterations = iterations
|
653
792
|
@metadata = metadata
|
654
793
|
@on_behalf_of = on_behalf_of
|
794
|
+
@pause_collection = pause_collection
|
655
795
|
@proration_behavior = proration_behavior
|
656
796
|
@transfer_data = transfer_data
|
657
797
|
@trial = trial
|
798
|
+
@trial_continuation = trial_continuation
|
658
799
|
@trial_end = trial_end
|
800
|
+
@trial_settings = trial_settings
|
659
801
|
end
|
660
802
|
end
|
803
|
+
|
804
|
+
class Prebilling < Stripe::RequestParams
|
805
|
+
# This is used to determine the number of billing cycles to prebill.
|
806
|
+
attr_accessor :iterations
|
807
|
+
# Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
|
808
|
+
attr_accessor :update_behavior
|
809
|
+
|
810
|
+
def initialize(iterations: nil, update_behavior: nil)
|
811
|
+
@iterations = iterations
|
812
|
+
@update_behavior = update_behavior
|
813
|
+
end
|
814
|
+
end
|
815
|
+
# 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.
|
816
|
+
attr_accessor :billing_behavior
|
661
817
|
# Controls how prorations and invoices for subscriptions are calculated and orchestrated.
|
662
818
|
attr_accessor :billing_mode
|
663
819
|
# The identifier of the customer to create the subscription schedule for.
|
664
820
|
attr_accessor :customer
|
821
|
+
# The identifier of the account to create the subscription schedule for.
|
822
|
+
attr_accessor :customer_account
|
665
823
|
# Object representing the subscription schedule's default settings.
|
666
824
|
attr_accessor :default_settings
|
667
825
|
# 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.
|
@@ -674,28 +832,36 @@ module Stripe
|
|
674
832
|
attr_accessor :metadata
|
675
833
|
# 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.
|
676
834
|
attr_accessor :phases
|
835
|
+
# If specified, the invoicing for the given billing cycle iterations will be processed now.
|
836
|
+
attr_accessor :prebilling
|
677
837
|
# 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.
|
678
838
|
attr_accessor :start_date
|
679
839
|
|
680
840
|
def initialize(
|
841
|
+
billing_behavior: nil,
|
681
842
|
billing_mode: nil,
|
682
843
|
customer: nil,
|
844
|
+
customer_account: nil,
|
683
845
|
default_settings: nil,
|
684
846
|
end_behavior: nil,
|
685
847
|
expand: nil,
|
686
848
|
from_subscription: nil,
|
687
849
|
metadata: nil,
|
688
850
|
phases: nil,
|
851
|
+
prebilling: nil,
|
689
852
|
start_date: nil
|
690
853
|
)
|
854
|
+
@billing_behavior = billing_behavior
|
691
855
|
@billing_mode = billing_mode
|
692
856
|
@customer = customer
|
857
|
+
@customer_account = customer_account
|
693
858
|
@default_settings = default_settings
|
694
859
|
@end_behavior = end_behavior
|
695
860
|
@expand = expand
|
696
861
|
@from_subscription = from_subscription
|
697
862
|
@metadata = metadata
|
698
863
|
@phases = phases
|
864
|
+
@prebilling = prebilling
|
699
865
|
@start_date = start_date
|
700
866
|
end
|
701
867
|
end
|
@@ -832,16 +998,44 @@ module Stripe
|
|
832
998
|
class Phase < Stripe::RequestParams
|
833
999
|
class AddInvoiceItem < Stripe::RequestParams
|
834
1000
|
class Discount < Stripe::RequestParams
|
1001
|
+
class DiscountEnd < Stripe::RequestParams
|
1002
|
+
class Duration < Stripe::RequestParams
|
1003
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1004
|
+
attr_accessor :interval
|
1005
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1006
|
+
attr_accessor :interval_count
|
1007
|
+
|
1008
|
+
def initialize(interval: nil, interval_count: nil)
|
1009
|
+
@interval = interval
|
1010
|
+
@interval_count = interval_count
|
1011
|
+
end
|
1012
|
+
end
|
1013
|
+
# Time span for the redeemed discount.
|
1014
|
+
attr_accessor :duration
|
1015
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1016
|
+
attr_accessor :timestamp
|
1017
|
+
# The type of calculation made to determine when the discount ends.
|
1018
|
+
attr_accessor :type
|
1019
|
+
|
1020
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
1021
|
+
@duration = duration
|
1022
|
+
@timestamp = timestamp
|
1023
|
+
@type = type
|
1024
|
+
end
|
1025
|
+
end
|
835
1026
|
# ID of the coupon to create a new discount for.
|
836
1027
|
attr_accessor :coupon
|
837
1028
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
838
1029
|
attr_accessor :discount
|
1030
|
+
# Details to determine how long the discount should be applied for.
|
1031
|
+
attr_accessor :discount_end
|
839
1032
|
# ID of the promotion code to create a new discount for.
|
840
1033
|
attr_accessor :promotion_code
|
841
1034
|
|
842
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1035
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
843
1036
|
@coupon = coupon
|
844
1037
|
@discount = discount
|
1038
|
+
@discount_end = discount_end
|
845
1039
|
@promotion_code = promotion_code
|
846
1040
|
end
|
847
1041
|
end
|
@@ -977,16 +1171,44 @@ module Stripe
|
|
977
1171
|
end
|
978
1172
|
|
979
1173
|
class Discount < Stripe::RequestParams
|
1174
|
+
class DiscountEnd < Stripe::RequestParams
|
1175
|
+
class Duration < Stripe::RequestParams
|
1176
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1177
|
+
attr_accessor :interval
|
1178
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1179
|
+
attr_accessor :interval_count
|
1180
|
+
|
1181
|
+
def initialize(interval: nil, interval_count: nil)
|
1182
|
+
@interval = interval
|
1183
|
+
@interval_count = interval_count
|
1184
|
+
end
|
1185
|
+
end
|
1186
|
+
# Time span for the redeemed discount.
|
1187
|
+
attr_accessor :duration
|
1188
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1189
|
+
attr_accessor :timestamp
|
1190
|
+
# The type of calculation made to determine when the discount ends.
|
1191
|
+
attr_accessor :type
|
1192
|
+
|
1193
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
1194
|
+
@duration = duration
|
1195
|
+
@timestamp = timestamp
|
1196
|
+
@type = type
|
1197
|
+
end
|
1198
|
+
end
|
980
1199
|
# ID of the coupon to create a new discount for.
|
981
1200
|
attr_accessor :coupon
|
982
1201
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
983
1202
|
attr_accessor :discount
|
1203
|
+
# Details to determine how long the discount should be applied for.
|
1204
|
+
attr_accessor :discount_end
|
984
1205
|
# ID of the promotion code to create a new discount for.
|
985
1206
|
attr_accessor :promotion_code
|
986
1207
|
|
987
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1208
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
988
1209
|
@coupon = coupon
|
989
1210
|
@discount = discount
|
1211
|
+
@discount_end = discount_end
|
990
1212
|
@promotion_code = promotion_code
|
991
1213
|
end
|
992
1214
|
end
|
@@ -1040,16 +1262,44 @@ module Stripe
|
|
1040
1262
|
end
|
1041
1263
|
|
1042
1264
|
class Discount < Stripe::RequestParams
|
1265
|
+
class DiscountEnd < Stripe::RequestParams
|
1266
|
+
class Duration < Stripe::RequestParams
|
1267
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1268
|
+
attr_accessor :interval
|
1269
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1270
|
+
attr_accessor :interval_count
|
1271
|
+
|
1272
|
+
def initialize(interval: nil, interval_count: nil)
|
1273
|
+
@interval = interval
|
1274
|
+
@interval_count = interval_count
|
1275
|
+
end
|
1276
|
+
end
|
1277
|
+
# Time span for the redeemed discount.
|
1278
|
+
attr_accessor :duration
|
1279
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1280
|
+
attr_accessor :timestamp
|
1281
|
+
# The type of calculation made to determine when the discount ends.
|
1282
|
+
attr_accessor :type
|
1283
|
+
|
1284
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
1285
|
+
@duration = duration
|
1286
|
+
@timestamp = timestamp
|
1287
|
+
@type = type
|
1288
|
+
end
|
1289
|
+
end
|
1043
1290
|
# ID of the coupon to create a new discount for.
|
1044
1291
|
attr_accessor :coupon
|
1045
1292
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
1046
1293
|
attr_accessor :discount
|
1294
|
+
# Details to determine how long the discount should be applied for.
|
1295
|
+
attr_accessor :discount_end
|
1047
1296
|
# ID of the promotion code to create a new discount for.
|
1048
1297
|
attr_accessor :promotion_code
|
1049
1298
|
|
1050
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1299
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
1051
1300
|
@coupon = coupon
|
1052
1301
|
@discount = discount
|
1302
|
+
@discount_end = discount_end
|
1053
1303
|
@promotion_code = promotion_code
|
1054
1304
|
end
|
1055
1305
|
end
|
@@ -1095,6 +1345,18 @@ module Stripe
|
|
1095
1345
|
@unit_amount_decimal = unit_amount_decimal
|
1096
1346
|
end
|
1097
1347
|
end
|
1348
|
+
|
1349
|
+
class Trial < Stripe::RequestParams
|
1350
|
+
# 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.
|
1351
|
+
attr_accessor :converts_to
|
1352
|
+
# Determines the type of trial for this item.
|
1353
|
+
attr_accessor :type
|
1354
|
+
|
1355
|
+
def initialize(converts_to: nil, type: nil)
|
1356
|
+
@converts_to = converts_to
|
1357
|
+
@type = type
|
1358
|
+
end
|
1359
|
+
end
|
1098
1360
|
# 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.
|
1099
1361
|
attr_accessor :billing_thresholds
|
1100
1362
|
# The coupons to redeem into discounts for the subscription item.
|
@@ -1111,6 +1373,8 @@ module Stripe
|
|
1111
1373
|
attr_accessor :quantity
|
1112
1374
|
# 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.
|
1113
1375
|
attr_accessor :tax_rates
|
1376
|
+
# Options that configure the trial on the subscription item.
|
1377
|
+
attr_accessor :trial
|
1114
1378
|
|
1115
1379
|
def initialize(
|
1116
1380
|
billing_thresholds: nil,
|
@@ -1120,7 +1384,8 @@ module Stripe
|
|
1120
1384
|
price: nil,
|
1121
1385
|
price_data: nil,
|
1122
1386
|
quantity: nil,
|
1123
|
-
tax_rates: nil
|
1387
|
+
tax_rates: nil,
|
1388
|
+
trial: nil
|
1124
1389
|
)
|
1125
1390
|
@billing_thresholds = billing_thresholds
|
1126
1391
|
@discounts = discounts
|
@@ -1130,6 +1395,16 @@ module Stripe
|
|
1130
1395
|
@price_data = price_data
|
1131
1396
|
@quantity = quantity
|
1132
1397
|
@tax_rates = tax_rates
|
1398
|
+
@trial = trial
|
1399
|
+
end
|
1400
|
+
end
|
1401
|
+
|
1402
|
+
class PauseCollection < Stripe::RequestParams
|
1403
|
+
# The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
1404
|
+
attr_accessor :behavior
|
1405
|
+
|
1406
|
+
def initialize(behavior: nil)
|
1407
|
+
@behavior = behavior
|
1133
1408
|
end
|
1134
1409
|
end
|
1135
1410
|
|
@@ -1144,6 +1419,23 @@ module Stripe
|
|
1144
1419
|
@destination = destination
|
1145
1420
|
end
|
1146
1421
|
end
|
1422
|
+
|
1423
|
+
class TrialSettings < Stripe::RequestParams
|
1424
|
+
class EndBehavior < Stripe::RequestParams
|
1425
|
+
# Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
1426
|
+
attr_accessor :prorate_up_front
|
1427
|
+
|
1428
|
+
def initialize(prorate_up_front: nil)
|
1429
|
+
@prorate_up_front = prorate_up_front
|
1430
|
+
end
|
1431
|
+
end
|
1432
|
+
# Defines how the subscription should behave when a trial ends.
|
1433
|
+
attr_accessor :end_behavior
|
1434
|
+
|
1435
|
+
def initialize(end_behavior: nil)
|
1436
|
+
@end_behavior = end_behavior
|
1437
|
+
end
|
1438
|
+
end
|
1147
1439
|
# 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.
|
1148
1440
|
attr_accessor :add_invoice_items
|
1149
1441
|
# 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).
|
@@ -1180,6 +1472,8 @@ module Stripe
|
|
1180
1472
|
attr_accessor :metadata
|
1181
1473
|
# The account on behalf of which to charge, for each of the associated subscription's invoices.
|
1182
1474
|
attr_accessor :on_behalf_of
|
1475
|
+
# If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment).
|
1476
|
+
attr_accessor :pause_collection
|
1183
1477
|
# 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.
|
1184
1478
|
attr_accessor :proration_behavior
|
1185
1479
|
# The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
|
@@ -1188,8 +1482,12 @@ module Stripe
|
|
1188
1482
|
attr_accessor :transfer_data
|
1189
1483
|
# If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
|
1190
1484
|
attr_accessor :trial
|
1485
|
+
# Specify trial behavior when crossing phase boundaries
|
1486
|
+
attr_accessor :trial_continuation
|
1191
1487
|
# 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`
|
1192
1488
|
attr_accessor :trial_end
|
1489
|
+
# Settings related to subscription trials.
|
1490
|
+
attr_accessor :trial_settings
|
1193
1491
|
|
1194
1492
|
def initialize(
|
1195
1493
|
add_invoice_items: nil,
|
@@ -1210,11 +1508,14 @@ module Stripe
|
|
1210
1508
|
iterations: nil,
|
1211
1509
|
metadata: nil,
|
1212
1510
|
on_behalf_of: nil,
|
1511
|
+
pause_collection: nil,
|
1213
1512
|
proration_behavior: nil,
|
1214
1513
|
start_date: nil,
|
1215
1514
|
transfer_data: nil,
|
1216
1515
|
trial: nil,
|
1217
|
-
|
1516
|
+
trial_continuation: nil,
|
1517
|
+
trial_end: nil,
|
1518
|
+
trial_settings: nil
|
1218
1519
|
)
|
1219
1520
|
@add_invoice_items = add_invoice_items
|
1220
1521
|
@application_fee_percent = application_fee_percent
|
@@ -1234,13 +1535,30 @@ module Stripe
|
|
1234
1535
|
@iterations = iterations
|
1235
1536
|
@metadata = metadata
|
1236
1537
|
@on_behalf_of = on_behalf_of
|
1538
|
+
@pause_collection = pause_collection
|
1237
1539
|
@proration_behavior = proration_behavior
|
1238
1540
|
@start_date = start_date
|
1239
1541
|
@transfer_data = transfer_data
|
1240
1542
|
@trial = trial
|
1543
|
+
@trial_continuation = trial_continuation
|
1241
1544
|
@trial_end = trial_end
|
1545
|
+
@trial_settings = trial_settings
|
1546
|
+
end
|
1547
|
+
end
|
1548
|
+
|
1549
|
+
class Prebilling < Stripe::RequestParams
|
1550
|
+
# This is used to determine the number of billing cycles to prebill.
|
1551
|
+
attr_accessor :iterations
|
1552
|
+
# Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
|
1553
|
+
attr_accessor :update_behavior
|
1554
|
+
|
1555
|
+
def initialize(iterations: nil, update_behavior: nil)
|
1556
|
+
@iterations = iterations
|
1557
|
+
@update_behavior = update_behavior
|
1242
1558
|
end
|
1243
1559
|
end
|
1560
|
+
# 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.
|
1561
|
+
attr_accessor :billing_behavior
|
1244
1562
|
# Object representing the subscription schedule's default settings.
|
1245
1563
|
attr_accessor :default_settings
|
1246
1564
|
# 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.
|
@@ -1251,26 +1569,598 @@ module Stripe
|
|
1251
1569
|
attr_accessor :metadata
|
1252
1570
|
# 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.
|
1253
1571
|
attr_accessor :phases
|
1572
|
+
# If specified, the invoicing for the given billing cycle iterations will be processed now.
|
1573
|
+
attr_accessor :prebilling
|
1254
1574
|
# 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`.
|
1255
1575
|
attr_accessor :proration_behavior
|
1256
1576
|
|
1257
1577
|
def initialize(
|
1578
|
+
billing_behavior: nil,
|
1258
1579
|
default_settings: nil,
|
1259
1580
|
end_behavior: nil,
|
1260
1581
|
expand: nil,
|
1261
1582
|
metadata: nil,
|
1262
1583
|
phases: nil,
|
1584
|
+
prebilling: nil,
|
1263
1585
|
proration_behavior: nil
|
1264
1586
|
)
|
1587
|
+
@billing_behavior = billing_behavior
|
1265
1588
|
@default_settings = default_settings
|
1266
1589
|
@end_behavior = end_behavior
|
1267
1590
|
@expand = expand
|
1268
1591
|
@metadata = metadata
|
1269
1592
|
@phases = phases
|
1593
|
+
@prebilling = prebilling
|
1270
1594
|
@proration_behavior = proration_behavior
|
1271
1595
|
end
|
1272
1596
|
end
|
1273
1597
|
|
1598
|
+
class AmendParams < Stripe::RequestParams
|
1599
|
+
class Amendment < Stripe::RequestParams
|
1600
|
+
class AmendmentEnd < Stripe::RequestParams
|
1601
|
+
class DiscountEnd < Stripe::RequestParams
|
1602
|
+
# The ID of a specific discount.
|
1603
|
+
attr_accessor :discount
|
1604
|
+
|
1605
|
+
def initialize(discount: nil)
|
1606
|
+
@discount = discount
|
1607
|
+
end
|
1608
|
+
end
|
1609
|
+
|
1610
|
+
class Duration < Stripe::RequestParams
|
1611
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1612
|
+
attr_accessor :interval
|
1613
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1614
|
+
attr_accessor :interval_count
|
1615
|
+
|
1616
|
+
def initialize(interval: nil, interval_count: nil)
|
1617
|
+
@interval = interval
|
1618
|
+
@interval_count = interval_count
|
1619
|
+
end
|
1620
|
+
end
|
1621
|
+
# Use the `end` time of a given discount.
|
1622
|
+
attr_accessor :discount_end
|
1623
|
+
# Time span for the amendment starting from the `amendment_start`.
|
1624
|
+
attr_accessor :duration
|
1625
|
+
# A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
|
1626
|
+
attr_accessor :timestamp
|
1627
|
+
# Select one of three ways to pass the `amendment_end`.
|
1628
|
+
attr_accessor :type
|
1629
|
+
|
1630
|
+
def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
|
1631
|
+
@discount_end = discount_end
|
1632
|
+
@duration = duration
|
1633
|
+
@timestamp = timestamp
|
1634
|
+
@type = type
|
1635
|
+
end
|
1636
|
+
end
|
1637
|
+
|
1638
|
+
class AmendmentStart < Stripe::RequestParams
|
1639
|
+
class AmendmentEnd < Stripe::RequestParams
|
1640
|
+
# 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.
|
1641
|
+
attr_accessor :index
|
1642
|
+
|
1643
|
+
def initialize(index: nil)
|
1644
|
+
@index = index
|
1645
|
+
end
|
1646
|
+
end
|
1647
|
+
|
1648
|
+
class DiscountEnd < Stripe::RequestParams
|
1649
|
+
# The ID of a specific discount.
|
1650
|
+
attr_accessor :discount
|
1651
|
+
|
1652
|
+
def initialize(discount: nil)
|
1653
|
+
@discount = discount
|
1654
|
+
end
|
1655
|
+
end
|
1656
|
+
# Details of another amendment in the same array, immediately after which this amendment should begin.
|
1657
|
+
attr_accessor :amendment_end
|
1658
|
+
# Use the `end` time of a given discount.
|
1659
|
+
attr_accessor :discount_end
|
1660
|
+
# A precise Unix timestamp for the amendment to start.
|
1661
|
+
attr_accessor :timestamp
|
1662
|
+
# Select one of three ways to pass the `amendment_start`.
|
1663
|
+
attr_accessor :type
|
1664
|
+
|
1665
|
+
def initialize(amendment_end: nil, discount_end: nil, timestamp: nil, type: nil)
|
1666
|
+
@amendment_end = amendment_end
|
1667
|
+
@discount_end = discount_end
|
1668
|
+
@timestamp = timestamp
|
1669
|
+
@type = type
|
1670
|
+
end
|
1671
|
+
end
|
1672
|
+
|
1673
|
+
class DiscountAction < Stripe::RequestParams
|
1674
|
+
class Add < Stripe::RequestParams
|
1675
|
+
class DiscountEnd < Stripe::RequestParams
|
1676
|
+
# The type of calculation made to determine when the discount ends.
|
1677
|
+
attr_accessor :type
|
1678
|
+
|
1679
|
+
def initialize(type: nil)
|
1680
|
+
@type = type
|
1681
|
+
end
|
1682
|
+
end
|
1683
|
+
# The coupon code to redeem.
|
1684
|
+
attr_accessor :coupon
|
1685
|
+
# An ID of an existing discount for a coupon that was already redeemed.
|
1686
|
+
attr_accessor :discount
|
1687
|
+
# Details to determine how long the discount should be applied for.
|
1688
|
+
attr_accessor :discount_end
|
1689
|
+
# 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.
|
1690
|
+
attr_accessor :index
|
1691
|
+
# The promotion code to redeem.
|
1692
|
+
attr_accessor :promotion_code
|
1693
|
+
|
1694
|
+
def initialize(
|
1695
|
+
coupon: nil,
|
1696
|
+
discount: nil,
|
1697
|
+
discount_end: nil,
|
1698
|
+
index: nil,
|
1699
|
+
promotion_code: nil
|
1700
|
+
)
|
1701
|
+
@coupon = coupon
|
1702
|
+
@discount = discount
|
1703
|
+
@discount_end = discount_end
|
1704
|
+
@index = index
|
1705
|
+
@promotion_code = promotion_code
|
1706
|
+
end
|
1707
|
+
end
|
1708
|
+
|
1709
|
+
class Remove < Stripe::RequestParams
|
1710
|
+
# The coupon code to remove from the `discounts` array.
|
1711
|
+
attr_accessor :coupon
|
1712
|
+
# The ID of a discount to remove from the `discounts` array.
|
1713
|
+
attr_accessor :discount
|
1714
|
+
# The ID of a promotion code to remove from the `discounts` array.
|
1715
|
+
attr_accessor :promotion_code
|
1716
|
+
|
1717
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1718
|
+
@coupon = coupon
|
1719
|
+
@discount = discount
|
1720
|
+
@promotion_code = promotion_code
|
1721
|
+
end
|
1722
|
+
end
|
1723
|
+
|
1724
|
+
class Set < Stripe::RequestParams
|
1725
|
+
# The coupon code to replace the `discounts` array with.
|
1726
|
+
attr_accessor :coupon
|
1727
|
+
# An ID of an existing discount to replace the `discounts` array with.
|
1728
|
+
attr_accessor :discount
|
1729
|
+
# An ID of an existing promotion code to replace the `discounts` array with.
|
1730
|
+
attr_accessor :promotion_code
|
1731
|
+
|
1732
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1733
|
+
@coupon = coupon
|
1734
|
+
@discount = discount
|
1735
|
+
@promotion_code = promotion_code
|
1736
|
+
end
|
1737
|
+
end
|
1738
|
+
# Details of the discount to add.
|
1739
|
+
attr_accessor :add
|
1740
|
+
# Details of the discount to remove.
|
1741
|
+
attr_accessor :remove
|
1742
|
+
# Details of the discount to replace the existing discounts with.
|
1743
|
+
attr_accessor :set
|
1744
|
+
# Determines the type of discount action.
|
1745
|
+
attr_accessor :type
|
1746
|
+
|
1747
|
+
def initialize(add: nil, remove: nil, set: nil, type: nil)
|
1748
|
+
@add = add
|
1749
|
+
@remove = remove
|
1750
|
+
@set = set
|
1751
|
+
@type = type
|
1752
|
+
end
|
1753
|
+
end
|
1754
|
+
|
1755
|
+
class ItemAction < Stripe::RequestParams
|
1756
|
+
class Add < Stripe::RequestParams
|
1757
|
+
class Discount < Stripe::RequestParams
|
1758
|
+
class DiscountEnd < Stripe::RequestParams
|
1759
|
+
class Duration < Stripe::RequestParams
|
1760
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1761
|
+
attr_accessor :interval
|
1762
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1763
|
+
attr_accessor :interval_count
|
1764
|
+
|
1765
|
+
def initialize(interval: nil, interval_count: nil)
|
1766
|
+
@interval = interval
|
1767
|
+
@interval_count = interval_count
|
1768
|
+
end
|
1769
|
+
end
|
1770
|
+
# Time span for the redeemed discount.
|
1771
|
+
attr_accessor :duration
|
1772
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1773
|
+
attr_accessor :timestamp
|
1774
|
+
# The type of calculation made to determine when the discount ends.
|
1775
|
+
attr_accessor :type
|
1776
|
+
|
1777
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
1778
|
+
@duration = duration
|
1779
|
+
@timestamp = timestamp
|
1780
|
+
@type = type
|
1781
|
+
end
|
1782
|
+
end
|
1783
|
+
# ID of the coupon to create a new discount for.
|
1784
|
+
attr_accessor :coupon
|
1785
|
+
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
1786
|
+
attr_accessor :discount
|
1787
|
+
# Details to determine how long the discount should be applied for.
|
1788
|
+
attr_accessor :discount_end
|
1789
|
+
# ID of the promotion code to create a new discount for.
|
1790
|
+
attr_accessor :promotion_code
|
1791
|
+
|
1792
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
1793
|
+
@coupon = coupon
|
1794
|
+
@discount = discount
|
1795
|
+
@discount_end = discount_end
|
1796
|
+
@promotion_code = promotion_code
|
1797
|
+
end
|
1798
|
+
end
|
1799
|
+
|
1800
|
+
class Trial < Stripe::RequestParams
|
1801
|
+
# 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.
|
1802
|
+
attr_accessor :converts_to
|
1803
|
+
# Determines the type of trial for this item.
|
1804
|
+
attr_accessor :type
|
1805
|
+
|
1806
|
+
def initialize(converts_to: nil, type: nil)
|
1807
|
+
@converts_to = converts_to
|
1808
|
+
@type = type
|
1809
|
+
end
|
1810
|
+
end
|
1811
|
+
# The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
|
1812
|
+
attr_accessor :discounts
|
1813
|
+
# 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`.
|
1814
|
+
attr_accessor :metadata
|
1815
|
+
# The ID of the price object.
|
1816
|
+
attr_accessor :price
|
1817
|
+
# Quantity for this item.
|
1818
|
+
attr_accessor :quantity
|
1819
|
+
# 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`.
|
1820
|
+
attr_accessor :tax_rates
|
1821
|
+
# Options that configure the trial on the subscription item.
|
1822
|
+
attr_accessor :trial
|
1823
|
+
|
1824
|
+
def initialize(
|
1825
|
+
discounts: nil,
|
1826
|
+
metadata: nil,
|
1827
|
+
price: nil,
|
1828
|
+
quantity: nil,
|
1829
|
+
tax_rates: nil,
|
1830
|
+
trial: nil
|
1831
|
+
)
|
1832
|
+
@discounts = discounts
|
1833
|
+
@metadata = metadata
|
1834
|
+
@price = price
|
1835
|
+
@quantity = quantity
|
1836
|
+
@tax_rates = tax_rates
|
1837
|
+
@trial = trial
|
1838
|
+
end
|
1839
|
+
end
|
1840
|
+
|
1841
|
+
class Remove < Stripe::RequestParams
|
1842
|
+
# ID of a price to remove.
|
1843
|
+
attr_accessor :price
|
1844
|
+
|
1845
|
+
def initialize(price: nil)
|
1846
|
+
@price = price
|
1847
|
+
end
|
1848
|
+
end
|
1849
|
+
|
1850
|
+
class Set < Stripe::RequestParams
|
1851
|
+
class Discount < Stripe::RequestParams
|
1852
|
+
class DiscountEnd < Stripe::RequestParams
|
1853
|
+
class Duration < Stripe::RequestParams
|
1854
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1855
|
+
attr_accessor :interval
|
1856
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1857
|
+
attr_accessor :interval_count
|
1858
|
+
|
1859
|
+
def initialize(interval: nil, interval_count: nil)
|
1860
|
+
@interval = interval
|
1861
|
+
@interval_count = interval_count
|
1862
|
+
end
|
1863
|
+
end
|
1864
|
+
# Time span for the redeemed discount.
|
1865
|
+
attr_accessor :duration
|
1866
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1867
|
+
attr_accessor :timestamp
|
1868
|
+
# The type of calculation made to determine when the discount ends.
|
1869
|
+
attr_accessor :type
|
1870
|
+
|
1871
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
1872
|
+
@duration = duration
|
1873
|
+
@timestamp = timestamp
|
1874
|
+
@type = type
|
1875
|
+
end
|
1876
|
+
end
|
1877
|
+
# ID of the coupon to create a new discount for.
|
1878
|
+
attr_accessor :coupon
|
1879
|
+
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
1880
|
+
attr_accessor :discount
|
1881
|
+
# Details to determine how long the discount should be applied for.
|
1882
|
+
attr_accessor :discount_end
|
1883
|
+
# ID of the promotion code to create a new discount for.
|
1884
|
+
attr_accessor :promotion_code
|
1885
|
+
|
1886
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
1887
|
+
@coupon = coupon
|
1888
|
+
@discount = discount
|
1889
|
+
@discount_end = discount_end
|
1890
|
+
@promotion_code = promotion_code
|
1891
|
+
end
|
1892
|
+
end
|
1893
|
+
|
1894
|
+
class Trial < Stripe::RequestParams
|
1895
|
+
# 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.
|
1896
|
+
attr_accessor :converts_to
|
1897
|
+
# Determines the type of trial for this item.
|
1898
|
+
attr_accessor :type
|
1899
|
+
|
1900
|
+
def initialize(converts_to: nil, type: nil)
|
1901
|
+
@converts_to = converts_to
|
1902
|
+
@type = type
|
1903
|
+
end
|
1904
|
+
end
|
1905
|
+
# 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`.
|
1906
|
+
attr_accessor :discounts
|
1907
|
+
# 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`.
|
1908
|
+
attr_accessor :metadata
|
1909
|
+
# The ID of the price object.
|
1910
|
+
attr_accessor :price
|
1911
|
+
# 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`.
|
1912
|
+
attr_accessor :quantity
|
1913
|
+
# 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`.
|
1914
|
+
attr_accessor :tax_rates
|
1915
|
+
# 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`.
|
1916
|
+
attr_accessor :trial
|
1917
|
+
|
1918
|
+
def initialize(
|
1919
|
+
discounts: nil,
|
1920
|
+
metadata: nil,
|
1921
|
+
price: nil,
|
1922
|
+
quantity: nil,
|
1923
|
+
tax_rates: nil,
|
1924
|
+
trial: nil
|
1925
|
+
)
|
1926
|
+
@discounts = discounts
|
1927
|
+
@metadata = metadata
|
1928
|
+
@price = price
|
1929
|
+
@quantity = quantity
|
1930
|
+
@tax_rates = tax_rates
|
1931
|
+
@trial = trial
|
1932
|
+
end
|
1933
|
+
end
|
1934
|
+
# 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.
|
1935
|
+
attr_accessor :add
|
1936
|
+
# Details of the subscription item to remove.
|
1937
|
+
attr_accessor :remove
|
1938
|
+
# 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.
|
1939
|
+
attr_accessor :set
|
1940
|
+
# Determines the type of item action.
|
1941
|
+
attr_accessor :type
|
1942
|
+
|
1943
|
+
def initialize(add: nil, remove: nil, set: nil, type: nil)
|
1944
|
+
@add = add
|
1945
|
+
@remove = remove
|
1946
|
+
@set = set
|
1947
|
+
@type = type
|
1948
|
+
end
|
1949
|
+
end
|
1950
|
+
|
1951
|
+
class MetadataAction < Stripe::RequestParams
|
1952
|
+
# Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
|
1953
|
+
attr_accessor :add
|
1954
|
+
# Keys to remove from schedule phase metadata.
|
1955
|
+
attr_accessor :remove
|
1956
|
+
# Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
|
1957
|
+
attr_accessor :set
|
1958
|
+
# Select one of three ways to update phase-level `metadata` on subscription schedules.
|
1959
|
+
attr_accessor :type
|
1960
|
+
|
1961
|
+
def initialize(add: nil, remove: nil, set: nil, type: nil)
|
1962
|
+
@add = add
|
1963
|
+
@remove = remove
|
1964
|
+
@set = set
|
1965
|
+
@type = type
|
1966
|
+
end
|
1967
|
+
end
|
1968
|
+
|
1969
|
+
class SetPauseCollection < Stripe::RequestParams
|
1970
|
+
class Set < Stripe::RequestParams
|
1971
|
+
# The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
1972
|
+
attr_accessor :behavior
|
1973
|
+
|
1974
|
+
def initialize(behavior: nil)
|
1975
|
+
@behavior = behavior
|
1976
|
+
end
|
1977
|
+
end
|
1978
|
+
# Details of the pause_collection behavior to apply to the amendment.
|
1979
|
+
attr_accessor :set
|
1980
|
+
# Determines the type of the pause_collection amendment.
|
1981
|
+
attr_accessor :type
|
1982
|
+
|
1983
|
+
def initialize(set: nil, type: nil)
|
1984
|
+
@set = set
|
1985
|
+
@type = type
|
1986
|
+
end
|
1987
|
+
end
|
1988
|
+
|
1989
|
+
class TrialSettings < Stripe::RequestParams
|
1990
|
+
class EndBehavior < Stripe::RequestParams
|
1991
|
+
# Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
1992
|
+
attr_accessor :prorate_up_front
|
1993
|
+
|
1994
|
+
def initialize(prorate_up_front: nil)
|
1995
|
+
@prorate_up_front = prorate_up_front
|
1996
|
+
end
|
1997
|
+
end
|
1998
|
+
# Defines how the subscription should behave when a trial ends.
|
1999
|
+
attr_accessor :end_behavior
|
2000
|
+
|
2001
|
+
def initialize(end_behavior: nil)
|
2002
|
+
@end_behavior = end_behavior
|
2003
|
+
end
|
2004
|
+
end
|
2005
|
+
# 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.
|
2006
|
+
attr_accessor :amendment_end
|
2007
|
+
# Details to identify the earliest timestamp where the proposed change should take effect.
|
2008
|
+
attr_accessor :amendment_start
|
2009
|
+
# 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.
|
2010
|
+
attr_accessor :billing_cycle_anchor
|
2011
|
+
# Changes to the coupons being redeemed or discounts being applied during the amendment time span.
|
2012
|
+
attr_accessor :discount_actions
|
2013
|
+
# Changes to the subscription items during the amendment time span.
|
2014
|
+
attr_accessor :item_actions
|
2015
|
+
# Instructions for how to modify phase metadata
|
2016
|
+
attr_accessor :metadata_actions
|
2017
|
+
# 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`.
|
2018
|
+
attr_accessor :proration_behavior
|
2019
|
+
# Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
|
2020
|
+
attr_accessor :set_pause_collection
|
2021
|
+
# Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
|
2022
|
+
attr_accessor :set_schedule_end
|
2023
|
+
# Settings related to subscription trials.
|
2024
|
+
attr_accessor :trial_settings
|
2025
|
+
|
2026
|
+
def initialize(
|
2027
|
+
amendment_end: nil,
|
2028
|
+
amendment_start: nil,
|
2029
|
+
billing_cycle_anchor: nil,
|
2030
|
+
discount_actions: nil,
|
2031
|
+
item_actions: nil,
|
2032
|
+
metadata_actions: nil,
|
2033
|
+
proration_behavior: nil,
|
2034
|
+
set_pause_collection: nil,
|
2035
|
+
set_schedule_end: nil,
|
2036
|
+
trial_settings: nil
|
2037
|
+
)
|
2038
|
+
@amendment_end = amendment_end
|
2039
|
+
@amendment_start = amendment_start
|
2040
|
+
@billing_cycle_anchor = billing_cycle_anchor
|
2041
|
+
@discount_actions = discount_actions
|
2042
|
+
@item_actions = item_actions
|
2043
|
+
@metadata_actions = metadata_actions
|
2044
|
+
@proration_behavior = proration_behavior
|
2045
|
+
@set_pause_collection = set_pause_collection
|
2046
|
+
@set_schedule_end = set_schedule_end
|
2047
|
+
@trial_settings = trial_settings
|
2048
|
+
end
|
2049
|
+
end
|
2050
|
+
|
2051
|
+
class Prebilling < Stripe::RequestParams
|
2052
|
+
class BillFrom < Stripe::RequestParams
|
2053
|
+
class AmendmentStart < Stripe::RequestParams
|
2054
|
+
# 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.
|
2055
|
+
attr_accessor :index
|
2056
|
+
|
2057
|
+
def initialize(index: nil)
|
2058
|
+
@index = index
|
2059
|
+
end
|
2060
|
+
end
|
2061
|
+
# Start the prebilled period when a specified amendment begins.
|
2062
|
+
attr_accessor :amendment_start
|
2063
|
+
# Start the prebilled period at a precise integer timestamp, starting from the Unix epoch.
|
2064
|
+
attr_accessor :timestamp
|
2065
|
+
# Select one of several ways to pass the `bill_from` value.
|
2066
|
+
attr_accessor :type
|
2067
|
+
|
2068
|
+
def initialize(amendment_start: nil, timestamp: nil, type: nil)
|
2069
|
+
@amendment_start = amendment_start
|
2070
|
+
@timestamp = timestamp
|
2071
|
+
@type = type
|
2072
|
+
end
|
2073
|
+
end
|
2074
|
+
|
2075
|
+
class BillUntil < Stripe::RequestParams
|
2076
|
+
class AmendmentEnd < Stripe::RequestParams
|
2077
|
+
# 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.
|
2078
|
+
attr_accessor :index
|
2079
|
+
|
2080
|
+
def initialize(index: nil)
|
2081
|
+
@index = index
|
2082
|
+
end
|
2083
|
+
end
|
2084
|
+
|
2085
|
+
class Duration < Stripe::RequestParams
|
2086
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
2087
|
+
attr_accessor :interval
|
2088
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
2089
|
+
attr_accessor :interval_count
|
2090
|
+
|
2091
|
+
def initialize(interval: nil, interval_count: nil)
|
2092
|
+
@interval = interval
|
2093
|
+
@interval_count = interval_count
|
2094
|
+
end
|
2095
|
+
end
|
2096
|
+
# End the prebilled period when a specified amendment ends.
|
2097
|
+
attr_accessor :amendment_end
|
2098
|
+
# Time span for prebilling, starting from `bill_from`.
|
2099
|
+
attr_accessor :duration
|
2100
|
+
# End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
|
2101
|
+
attr_accessor :timestamp
|
2102
|
+
# Select one of several ways to pass the `bill_until` value.
|
2103
|
+
attr_accessor :type
|
2104
|
+
|
2105
|
+
def initialize(amendment_end: nil, duration: nil, timestamp: nil, type: nil)
|
2106
|
+
@amendment_end = amendment_end
|
2107
|
+
@duration = duration
|
2108
|
+
@timestamp = timestamp
|
2109
|
+
@type = type
|
2110
|
+
end
|
2111
|
+
end
|
2112
|
+
# The beginning of the prebilled time period. The default value is `now`.
|
2113
|
+
attr_accessor :bill_from
|
2114
|
+
# The end of the prebilled time period.
|
2115
|
+
attr_accessor :bill_until
|
2116
|
+
# When the prebilling invoice should be created. The default value is `now`.
|
2117
|
+
attr_accessor :invoice_at
|
2118
|
+
# Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
|
2119
|
+
attr_accessor :update_behavior
|
2120
|
+
|
2121
|
+
def initialize(bill_from: nil, bill_until: nil, invoice_at: nil, update_behavior: nil)
|
2122
|
+
@bill_from = bill_from
|
2123
|
+
@bill_until = bill_until
|
2124
|
+
@invoice_at = invoice_at
|
2125
|
+
@update_behavior = update_behavior
|
2126
|
+
end
|
2127
|
+
end
|
2128
|
+
|
2129
|
+
class ScheduleSettings < Stripe::RequestParams
|
2130
|
+
# Behavior of the subscription schedule and underlying subscription when it ends.
|
2131
|
+
attr_accessor :end_behavior
|
2132
|
+
|
2133
|
+
def initialize(end_behavior: nil)
|
2134
|
+
@end_behavior = end_behavior
|
2135
|
+
end
|
2136
|
+
end
|
2137
|
+
# Changes to apply to the phases of the subscription schedule, in the order provided.
|
2138
|
+
attr_accessor :amendments
|
2139
|
+
# Specifies which fields in the response should be expanded.
|
2140
|
+
attr_accessor :expand
|
2141
|
+
# Provide any time periods to bill in advance.
|
2142
|
+
attr_accessor :prebilling
|
2143
|
+
# In cases where the amendment changes the currently active phase,
|
2144
|
+
# specifies if and how to prorate at the time of the request.
|
2145
|
+
attr_accessor :proration_behavior
|
2146
|
+
# Changes to apply to the subscription schedule.
|
2147
|
+
attr_accessor :schedule_settings
|
2148
|
+
|
2149
|
+
def initialize(
|
2150
|
+
amendments: nil,
|
2151
|
+
expand: nil,
|
2152
|
+
prebilling: nil,
|
2153
|
+
proration_behavior: nil,
|
2154
|
+
schedule_settings: nil
|
2155
|
+
)
|
2156
|
+
@amendments = amendments
|
2157
|
+
@expand = expand
|
2158
|
+
@prebilling = prebilling
|
2159
|
+
@proration_behavior = proration_behavior
|
2160
|
+
@schedule_settings = schedule_settings
|
2161
|
+
end
|
2162
|
+
end
|
2163
|
+
|
1274
2164
|
class CancelParams < Stripe::RequestParams
|
1275
2165
|
# Specifies which fields in the response should be expanded.
|
1276
2166
|
attr_accessor :expand
|
@@ -1298,6 +2188,17 @@ module Stripe
|
|
1298
2188
|
end
|
1299
2189
|
end
|
1300
2190
|
|
2191
|
+
# Amends an existing subscription schedule.
|
2192
|
+
def amend(schedule, params = {}, opts = {})
|
2193
|
+
request(
|
2194
|
+
method: :post,
|
2195
|
+
path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(schedule) }),
|
2196
|
+
params: params,
|
2197
|
+
opts: opts,
|
2198
|
+
base_address: :api
|
2199
|
+
)
|
2200
|
+
end
|
2201
|
+
|
1301
2202
|
# 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.
|
1302
2203
|
def cancel(schedule, params = {}, opts = {})
|
1303
2204
|
request(
|