stripe 15.2.0 → 15.3.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/CHANGELOG.md +1600 -670
- data/VERSION +1 -1
- data/lib/stripe/api_requestor.rb +28 -0
- data/lib/stripe/api_version.rb +1 -1
- data/lib/stripe/errors.rb +54 -0
- data/lib/stripe/event_types.rb +98 -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_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_completed_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_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_off_session_payment_requires_capture_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 +21 -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 +50 -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 +105 -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_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 +1538 -0
- data/lib/stripe/resources/checkout/session.rb +330 -2
- 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/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 +184 -0
- data/lib/stripe/resources/identity/verification_session.rb +10 -0
- data/lib/stripe/resources/invoice.rb +1070 -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 +2 -53
- 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 +24 -0
- data/lib/stripe/resources/margin.rb +115 -0
- data/lib/stripe/resources/order.rb +2806 -0
- data/lib/stripe/resources/payment_attempt_record.rb +1086 -0
- data/lib/stripe/resources/payment_intent.rb +7694 -2738
- data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +72 -0
- data/lib/stripe/resources/payment_method.rb +192 -1
- data/lib/stripe/resources/payment_method_configuration.rb +295 -0
- data/lib/stripe/resources/payment_record.rb +1615 -0
- data/lib/stripe/resources/payout.rb +6 -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 +2046 -6
- data/lib/stripe/resources/quote_line.rb +274 -0
- data/lib/stripe/resources/quote_preview_invoice.rb +663 -0
- data/lib/stripe/resources/quote_preview_subscription_schedule.rb +364 -0
- data/lib/stripe/resources/refund.rb +9 -0
- data/lib/stripe/resources/setup_attempt.rb +21 -0
- data/lib/stripe/resources/setup_intent.rb +578 -9
- data/lib/stripe/resources/source.rb +29 -0
- data/lib/stripe/resources/subscription.rb +333 -9
- data/lib/stripe/resources/subscription_item.rb +84 -3
- data/lib/stripe/resources/subscription_schedule.rb +1013 -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/reader.rb +156 -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 +1746 -0
- data/lib/stripe/resources/v2/core/account_link.rb +56 -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 +58 -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 +75 -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 +116 -0
- data/lib/stripe/resources/v2/money_management/received_debit.rb +84 -0
- data/lib/stripe/resources/v2/money_management/transaction.rb +78 -0
- data/lib/stripe/resources/v2/money_management/transaction_entry.rb +68 -0
- data/lib/stripe/resources/v2/payments/off_session_payment.rb +74 -0
- data/lib/stripe/resources.rb +104 -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 +96 -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_portal/session_service.rb +4 -0
- 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 +247 -2
- 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_service.rb +1021 -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/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 +2236 -0
- data/lib/stripe/services/payment_attempt_record_service.rb +49 -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 +4733 -245
- 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 +542 -0
- data/lib/stripe/services/payout_service.rb +4 -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 +1730 -7
- data/lib/stripe/services/setup_intent_service.rb +538 -9
- data/lib/stripe/services/subscription_item_service.rb +75 -3
- data/lib/stripe/services/subscription_schedule_service.rb +915 -10
- data/lib/stripe/services/subscription_service.rb +276 -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/reader_collected_data_service.rb +28 -0
- data/lib/stripe/services/terminal/reader_service.rb +90 -0
- data/lib/stripe/services/terminal_service.rb +2 -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 -2
- data/lib/stripe/services/v2/core/account_link_service.rb +76 -0
- data/lib/stripe/services/v2/core/account_service.rb +4138 -0
- data/lib/stripe/services/v2/core/accounts/person_service.rb +1046 -0
- data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +131 -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 +43 -0
- data/lib/stripe/services/v2/money_management/financial_address_service.rb +81 -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 +200 -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 +91 -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 +138 -0
- data/lib/stripe/services/v2/test_helper_service.rb +15 -0
- data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +49 -0
- data/lib/stripe/services/v2_services.rb +5 -2
- data/lib/stripe/services.rb +53 -1
- 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 +191639 -0
- data/stripe.gemspec +4 -1
- metadata +161 -324
- data/lib/stripe/services/invoice_payment_service.rb +0 -83
- data/rbi/stripe/resources/account.rbi +0 -4926
- data/rbi/stripe/resources/account_link.rbi +0 -74
- data/rbi/stripe/resources/account_session.rbi +0 -1013
- 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 -235
- 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 -645
- 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 -2069
- data/rbi/stripe/resources/checkout/session.rbi +0 -4004
- 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 -1807
- 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 -1005
- 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 -149
- 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 -526
- data/rbi/stripe/resources/invoice.rbi +0 -3812
- data/rbi/stripe/resources/invoice_item.rbi +0 -473
- 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 -741
- 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 -187
- data/rbi/stripe/resources/payment_intent.rbi +0 -9647
- data/rbi/stripe/resources/payment_link.rbi +0 -1801
- data/rbi/stripe/resources/payment_method.rbi +0 -1761
- 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 -300
- 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 -555
- data/rbi/stripe/resources/product_feature.rbi +0 -26
- data/rbi/stripe/resources/promotion_code.rbi +0 -261
- data/rbi/stripe/resources/quote.rbi +0 -1126
- 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 -3655
- 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 -2027
- data/rbi/stripe/resources/subscription_item.rbi +0 -404
- data/rbi/stripe/resources/subscription_schedule.rbi +0 -1623
- 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 -2713
- 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 -1386
- 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 -847
- data/rbi/stripe/resources/test_helpers/test_clock.rbi +0 -132
- data/rbi/stripe/resources/token.rbi +0 -1283
- 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 -865
- 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 -58
- data/rbi/stripe/services/account_login_link_service.rbi +0 -22
- data/rbi/stripe/services/account_person_service.rbi +0 -1011
- data/rbi/stripe/services/account_service.rbi +0 -4213
- data/rbi/stripe/services/account_session_service.rbi +0 -646
- 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 -511
- 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 -2614
- 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 -647
- 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 -323
- 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 -2981
- data/rbi/stripe/services/issuing/authorization_service.rbi +0 -146
- data/rbi/stripe/services/issuing/card_service.rbi +0 -495
- 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 -7659
- data/rbi/stripe/services/payment_link_service.rbi +0 -1352
- 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 -776
- data/rbi/stripe/services/payout_service.rbi +0 -205
- 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 -686
- 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 -3391
- 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 -1290
- data/rbi/stripe/services/subscription_service.rbi +0 -1648
- data/rbi/stripe/services/tax/calculation_service.rbi +0 -234
- data/rbi/stripe/services/tax/registration_service.rbi +0 -1845
- 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 -1118
- 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 -455
- data/rbi/stripe/services/terminal_service.rbi +0 -12
- data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +0 -739
- 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 -93
- 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 -1257
- 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 -562
- 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
|
@@ -244,16 +248,44 @@ module Stripe
|
|
244
248
|
class Phase < Stripe::RequestParams
|
245
249
|
class AddInvoiceItem < Stripe::RequestParams
|
246
250
|
class Discount < Stripe::RequestParams
|
251
|
+
class DiscountEnd < Stripe::RequestParams
|
252
|
+
class Duration < Stripe::RequestParams
|
253
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
254
|
+
attr_accessor :interval
|
255
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
256
|
+
attr_accessor :interval_count
|
257
|
+
|
258
|
+
def initialize(interval: nil, interval_count: nil)
|
259
|
+
@interval = interval
|
260
|
+
@interval_count = interval_count
|
261
|
+
end
|
262
|
+
end
|
263
|
+
# Time span for the redeemed discount.
|
264
|
+
attr_accessor :duration
|
265
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
266
|
+
attr_accessor :timestamp
|
267
|
+
# The type of calculation made to determine when the discount ends.
|
268
|
+
attr_accessor :type
|
269
|
+
|
270
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
271
|
+
@duration = duration
|
272
|
+
@timestamp = timestamp
|
273
|
+
@type = type
|
274
|
+
end
|
275
|
+
end
|
247
276
|
# ID of the coupon to create a new discount for.
|
248
277
|
attr_accessor :coupon
|
249
278
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
250
279
|
attr_accessor :discount
|
280
|
+
# Details to determine how long the discount should be applied for.
|
281
|
+
attr_accessor :discount_end
|
251
282
|
# ID of the promotion code to create a new discount for.
|
252
283
|
attr_accessor :promotion_code
|
253
284
|
|
254
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
285
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
255
286
|
@coupon = coupon
|
256
287
|
@discount = discount
|
288
|
+
@discount_end = discount_end
|
257
289
|
@promotion_code = promotion_code
|
258
290
|
end
|
259
291
|
end
|
@@ -340,16 +372,44 @@ module Stripe
|
|
340
372
|
end
|
341
373
|
|
342
374
|
class Discount < Stripe::RequestParams
|
375
|
+
class DiscountEnd < Stripe::RequestParams
|
376
|
+
class Duration < Stripe::RequestParams
|
377
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
378
|
+
attr_accessor :interval
|
379
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
380
|
+
attr_accessor :interval_count
|
381
|
+
|
382
|
+
def initialize(interval: nil, interval_count: nil)
|
383
|
+
@interval = interval
|
384
|
+
@interval_count = interval_count
|
385
|
+
end
|
386
|
+
end
|
387
|
+
# Time span for the redeemed discount.
|
388
|
+
attr_accessor :duration
|
389
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
390
|
+
attr_accessor :timestamp
|
391
|
+
# The type of calculation made to determine when the discount ends.
|
392
|
+
attr_accessor :type
|
393
|
+
|
394
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
395
|
+
@duration = duration
|
396
|
+
@timestamp = timestamp
|
397
|
+
@type = type
|
398
|
+
end
|
399
|
+
end
|
343
400
|
# ID of the coupon to create a new discount for.
|
344
401
|
attr_accessor :coupon
|
345
402
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
346
403
|
attr_accessor :discount
|
404
|
+
# Details to determine how long the discount should be applied for.
|
405
|
+
attr_accessor :discount_end
|
347
406
|
# ID of the promotion code to create a new discount for.
|
348
407
|
attr_accessor :promotion_code
|
349
408
|
|
350
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
409
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
351
410
|
@coupon = coupon
|
352
411
|
@discount = discount
|
412
|
+
@discount_end = discount_end
|
353
413
|
@promotion_code = promotion_code
|
354
414
|
end
|
355
415
|
end
|
@@ -391,16 +451,44 @@ module Stripe
|
|
391
451
|
end
|
392
452
|
|
393
453
|
class Discount < Stripe::RequestParams
|
454
|
+
class DiscountEnd < Stripe::RequestParams
|
455
|
+
class Duration < Stripe::RequestParams
|
456
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
457
|
+
attr_accessor :interval
|
458
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
459
|
+
attr_accessor :interval_count
|
460
|
+
|
461
|
+
def initialize(interval: nil, interval_count: nil)
|
462
|
+
@interval = interval
|
463
|
+
@interval_count = interval_count
|
464
|
+
end
|
465
|
+
end
|
466
|
+
# Time span for the redeemed discount.
|
467
|
+
attr_accessor :duration
|
468
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
469
|
+
attr_accessor :timestamp
|
470
|
+
# The type of calculation made to determine when the discount ends.
|
471
|
+
attr_accessor :type
|
472
|
+
|
473
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
474
|
+
@duration = duration
|
475
|
+
@timestamp = timestamp
|
476
|
+
@type = type
|
477
|
+
end
|
478
|
+
end
|
394
479
|
# ID of the coupon to create a new discount for.
|
395
480
|
attr_accessor :coupon
|
396
481
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
397
482
|
attr_accessor :discount
|
483
|
+
# Details to determine how long the discount should be applied for.
|
484
|
+
attr_accessor :discount_end
|
398
485
|
# ID of the promotion code to create a new discount for.
|
399
486
|
attr_accessor :promotion_code
|
400
487
|
|
401
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
488
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
402
489
|
@coupon = coupon
|
403
490
|
@discount = discount
|
491
|
+
@discount_end = discount_end
|
404
492
|
@promotion_code = promotion_code
|
405
493
|
end
|
406
494
|
end
|
@@ -446,6 +534,18 @@ module Stripe
|
|
446
534
|
@unit_amount_decimal = unit_amount_decimal
|
447
535
|
end
|
448
536
|
end
|
537
|
+
|
538
|
+
class Trial < Stripe::RequestParams
|
539
|
+
# 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.
|
540
|
+
attr_accessor :converts_to
|
541
|
+
# Determines the type of trial for this item.
|
542
|
+
attr_accessor :type
|
543
|
+
|
544
|
+
def initialize(converts_to: nil, type: nil)
|
545
|
+
@converts_to = converts_to
|
546
|
+
@type = type
|
547
|
+
end
|
548
|
+
end
|
449
549
|
# 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.
|
450
550
|
attr_accessor :billing_thresholds
|
451
551
|
# The coupons to redeem into discounts for the subscription item.
|
@@ -462,6 +562,8 @@ module Stripe
|
|
462
562
|
attr_accessor :quantity
|
463
563
|
# 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.
|
464
564
|
attr_accessor :tax_rates
|
565
|
+
# Options that configure the trial on the subscription item.
|
566
|
+
attr_accessor :trial
|
465
567
|
|
466
568
|
def initialize(
|
467
569
|
billing_thresholds: nil,
|
@@ -471,7 +573,8 @@ module Stripe
|
|
471
573
|
price: nil,
|
472
574
|
price_data: nil,
|
473
575
|
quantity: nil,
|
474
|
-
tax_rates: nil
|
576
|
+
tax_rates: nil,
|
577
|
+
trial: nil
|
475
578
|
)
|
476
579
|
@billing_thresholds = billing_thresholds
|
477
580
|
@discounts = discounts
|
@@ -481,6 +584,16 @@ module Stripe
|
|
481
584
|
@price_data = price_data
|
482
585
|
@quantity = quantity
|
483
586
|
@tax_rates = tax_rates
|
587
|
+
@trial = trial
|
588
|
+
end
|
589
|
+
end
|
590
|
+
|
591
|
+
class PauseCollection < Stripe::RequestParams
|
592
|
+
# The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
593
|
+
attr_accessor :behavior
|
594
|
+
|
595
|
+
def initialize(behavior: nil)
|
596
|
+
@behavior = behavior
|
484
597
|
end
|
485
598
|
end
|
486
599
|
|
@@ -495,6 +608,23 @@ module Stripe
|
|
495
608
|
@destination = destination
|
496
609
|
end
|
497
610
|
end
|
611
|
+
|
612
|
+
class TrialSettings < Stripe::RequestParams
|
613
|
+
class EndBehavior < Stripe::RequestParams
|
614
|
+
# Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
615
|
+
attr_accessor :prorate_up_front
|
616
|
+
|
617
|
+
def initialize(prorate_up_front: nil)
|
618
|
+
@prorate_up_front = prorate_up_front
|
619
|
+
end
|
620
|
+
end
|
621
|
+
# Defines how the subscription should behave when a trial ends.
|
622
|
+
attr_accessor :end_behavior
|
623
|
+
|
624
|
+
def initialize(end_behavior: nil)
|
625
|
+
@end_behavior = end_behavior
|
626
|
+
end
|
627
|
+
end
|
498
628
|
# 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.
|
499
629
|
attr_accessor :add_invoice_items
|
500
630
|
# 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).
|
@@ -529,14 +659,20 @@ module Stripe
|
|
529
659
|
attr_accessor :metadata
|
530
660
|
# The account on behalf of which to charge, for each of the associated subscription's invoices.
|
531
661
|
attr_accessor :on_behalf_of
|
662
|
+
# 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).
|
663
|
+
attr_accessor :pause_collection
|
532
664
|
# 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.
|
533
665
|
attr_accessor :proration_behavior
|
534
666
|
# The data with which to automatically create a Transfer for each of the associated subscription's invoices.
|
535
667
|
attr_accessor :transfer_data
|
536
668
|
# If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
|
537
669
|
attr_accessor :trial
|
670
|
+
# Specify trial behavior when crossing phase boundaries
|
671
|
+
attr_accessor :trial_continuation
|
538
672
|
# 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`
|
539
673
|
attr_accessor :trial_end
|
674
|
+
# Settings related to subscription trials.
|
675
|
+
attr_accessor :trial_settings
|
540
676
|
|
541
677
|
def initialize(
|
542
678
|
add_invoice_items: nil,
|
@@ -556,10 +692,13 @@ module Stripe
|
|
556
692
|
iterations: nil,
|
557
693
|
metadata: nil,
|
558
694
|
on_behalf_of: nil,
|
695
|
+
pause_collection: nil,
|
559
696
|
proration_behavior: nil,
|
560
697
|
transfer_data: nil,
|
561
698
|
trial: nil,
|
562
|
-
|
699
|
+
trial_continuation: nil,
|
700
|
+
trial_end: nil,
|
701
|
+
trial_settings: nil
|
563
702
|
)
|
564
703
|
@add_invoice_items = add_invoice_items
|
565
704
|
@application_fee_percent = application_fee_percent
|
@@ -578,14 +717,35 @@ module Stripe
|
|
578
717
|
@iterations = iterations
|
579
718
|
@metadata = metadata
|
580
719
|
@on_behalf_of = on_behalf_of
|
720
|
+
@pause_collection = pause_collection
|
581
721
|
@proration_behavior = proration_behavior
|
582
722
|
@transfer_data = transfer_data
|
583
723
|
@trial = trial
|
724
|
+
@trial_continuation = trial_continuation
|
584
725
|
@trial_end = trial_end
|
726
|
+
@trial_settings = trial_settings
|
727
|
+
end
|
728
|
+
end
|
729
|
+
|
730
|
+
class Prebilling < Stripe::RequestParams
|
731
|
+
# This is used to determine the number of billing cycles to prebill.
|
732
|
+
attr_accessor :iterations
|
733
|
+
# Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
|
734
|
+
attr_accessor :update_behavior
|
735
|
+
|
736
|
+
def initialize(iterations: nil, update_behavior: nil)
|
737
|
+
@iterations = iterations
|
738
|
+
@update_behavior = update_behavior
|
585
739
|
end
|
586
740
|
end
|
741
|
+
# 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.
|
742
|
+
attr_accessor :billing_behavior
|
743
|
+
# Controls how prorations and invoices for subscriptions are calculated and orchestrated.
|
744
|
+
attr_accessor :billing_mode
|
587
745
|
# The identifier of the customer to create the subscription schedule for.
|
588
746
|
attr_accessor :customer
|
747
|
+
# The identifier of the account to create the subscription schedule for.
|
748
|
+
attr_accessor :customer_account
|
589
749
|
# Object representing the subscription schedule's default settings.
|
590
750
|
attr_accessor :default_settings
|
591
751
|
# 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.
|
@@ -598,26 +758,36 @@ module Stripe
|
|
598
758
|
attr_accessor :metadata
|
599
759
|
# 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.
|
600
760
|
attr_accessor :phases
|
761
|
+
# If specified, the invoicing for the given billing cycle iterations will be processed now.
|
762
|
+
attr_accessor :prebilling
|
601
763
|
# 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.
|
602
764
|
attr_accessor :start_date
|
603
765
|
|
604
766
|
def initialize(
|
767
|
+
billing_behavior: nil,
|
768
|
+
billing_mode: nil,
|
605
769
|
customer: nil,
|
770
|
+
customer_account: nil,
|
606
771
|
default_settings: nil,
|
607
772
|
end_behavior: nil,
|
608
773
|
expand: nil,
|
609
774
|
from_subscription: nil,
|
610
775
|
metadata: nil,
|
611
776
|
phases: nil,
|
777
|
+
prebilling: nil,
|
612
778
|
start_date: nil
|
613
779
|
)
|
780
|
+
@billing_behavior = billing_behavior
|
781
|
+
@billing_mode = billing_mode
|
614
782
|
@customer = customer
|
783
|
+
@customer_account = customer_account
|
615
784
|
@default_settings = default_settings
|
616
785
|
@end_behavior = end_behavior
|
617
786
|
@expand = expand
|
618
787
|
@from_subscription = from_subscription
|
619
788
|
@metadata = metadata
|
620
789
|
@phases = phases
|
790
|
+
@prebilling = prebilling
|
621
791
|
@start_date = start_date
|
622
792
|
end
|
623
793
|
end
|
@@ -754,16 +924,44 @@ module Stripe
|
|
754
924
|
class Phase < Stripe::RequestParams
|
755
925
|
class AddInvoiceItem < Stripe::RequestParams
|
756
926
|
class Discount < Stripe::RequestParams
|
927
|
+
class DiscountEnd < Stripe::RequestParams
|
928
|
+
class Duration < Stripe::RequestParams
|
929
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
930
|
+
attr_accessor :interval
|
931
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
932
|
+
attr_accessor :interval_count
|
933
|
+
|
934
|
+
def initialize(interval: nil, interval_count: nil)
|
935
|
+
@interval = interval
|
936
|
+
@interval_count = interval_count
|
937
|
+
end
|
938
|
+
end
|
939
|
+
# Time span for the redeemed discount.
|
940
|
+
attr_accessor :duration
|
941
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
942
|
+
attr_accessor :timestamp
|
943
|
+
# The type of calculation made to determine when the discount ends.
|
944
|
+
attr_accessor :type
|
945
|
+
|
946
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
947
|
+
@duration = duration
|
948
|
+
@timestamp = timestamp
|
949
|
+
@type = type
|
950
|
+
end
|
951
|
+
end
|
757
952
|
# ID of the coupon to create a new discount for.
|
758
953
|
attr_accessor :coupon
|
759
954
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
760
955
|
attr_accessor :discount
|
956
|
+
# Details to determine how long the discount should be applied for.
|
957
|
+
attr_accessor :discount_end
|
761
958
|
# ID of the promotion code to create a new discount for.
|
762
959
|
attr_accessor :promotion_code
|
763
960
|
|
764
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
961
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
765
962
|
@coupon = coupon
|
766
963
|
@discount = discount
|
964
|
+
@discount_end = discount_end
|
767
965
|
@promotion_code = promotion_code
|
768
966
|
end
|
769
967
|
end
|
@@ -850,16 +1048,44 @@ module Stripe
|
|
850
1048
|
end
|
851
1049
|
|
852
1050
|
class Discount < Stripe::RequestParams
|
1051
|
+
class DiscountEnd < Stripe::RequestParams
|
1052
|
+
class Duration < Stripe::RequestParams
|
1053
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1054
|
+
attr_accessor :interval
|
1055
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1056
|
+
attr_accessor :interval_count
|
1057
|
+
|
1058
|
+
def initialize(interval: nil, interval_count: nil)
|
1059
|
+
@interval = interval
|
1060
|
+
@interval_count = interval_count
|
1061
|
+
end
|
1062
|
+
end
|
1063
|
+
# Time span for the redeemed discount.
|
1064
|
+
attr_accessor :duration
|
1065
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1066
|
+
attr_accessor :timestamp
|
1067
|
+
# The type of calculation made to determine when the discount ends.
|
1068
|
+
attr_accessor :type
|
1069
|
+
|
1070
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
1071
|
+
@duration = duration
|
1072
|
+
@timestamp = timestamp
|
1073
|
+
@type = type
|
1074
|
+
end
|
1075
|
+
end
|
853
1076
|
# ID of the coupon to create a new discount for.
|
854
1077
|
attr_accessor :coupon
|
855
1078
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
856
1079
|
attr_accessor :discount
|
1080
|
+
# Details to determine how long the discount should be applied for.
|
1081
|
+
attr_accessor :discount_end
|
857
1082
|
# ID of the promotion code to create a new discount for.
|
858
1083
|
attr_accessor :promotion_code
|
859
1084
|
|
860
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1085
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
861
1086
|
@coupon = coupon
|
862
1087
|
@discount = discount
|
1088
|
+
@discount_end = discount_end
|
863
1089
|
@promotion_code = promotion_code
|
864
1090
|
end
|
865
1091
|
end
|
@@ -901,16 +1127,44 @@ module Stripe
|
|
901
1127
|
end
|
902
1128
|
|
903
1129
|
class Discount < Stripe::RequestParams
|
1130
|
+
class DiscountEnd < Stripe::RequestParams
|
1131
|
+
class Duration < Stripe::RequestParams
|
1132
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1133
|
+
attr_accessor :interval
|
1134
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1135
|
+
attr_accessor :interval_count
|
1136
|
+
|
1137
|
+
def initialize(interval: nil, interval_count: nil)
|
1138
|
+
@interval = interval
|
1139
|
+
@interval_count = interval_count
|
1140
|
+
end
|
1141
|
+
end
|
1142
|
+
# Time span for the redeemed discount.
|
1143
|
+
attr_accessor :duration
|
1144
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1145
|
+
attr_accessor :timestamp
|
1146
|
+
# The type of calculation made to determine when the discount ends.
|
1147
|
+
attr_accessor :type
|
1148
|
+
|
1149
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
1150
|
+
@duration = duration
|
1151
|
+
@timestamp = timestamp
|
1152
|
+
@type = type
|
1153
|
+
end
|
1154
|
+
end
|
904
1155
|
# ID of the coupon to create a new discount for.
|
905
1156
|
attr_accessor :coupon
|
906
1157
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
907
1158
|
attr_accessor :discount
|
1159
|
+
# Details to determine how long the discount should be applied for.
|
1160
|
+
attr_accessor :discount_end
|
908
1161
|
# ID of the promotion code to create a new discount for.
|
909
1162
|
attr_accessor :promotion_code
|
910
1163
|
|
911
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1164
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
912
1165
|
@coupon = coupon
|
913
1166
|
@discount = discount
|
1167
|
+
@discount_end = discount_end
|
914
1168
|
@promotion_code = promotion_code
|
915
1169
|
end
|
916
1170
|
end
|
@@ -956,6 +1210,18 @@ module Stripe
|
|
956
1210
|
@unit_amount_decimal = unit_amount_decimal
|
957
1211
|
end
|
958
1212
|
end
|
1213
|
+
|
1214
|
+
class Trial < Stripe::RequestParams
|
1215
|
+
# 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.
|
1216
|
+
attr_accessor :converts_to
|
1217
|
+
# Determines the type of trial for this item.
|
1218
|
+
attr_accessor :type
|
1219
|
+
|
1220
|
+
def initialize(converts_to: nil, type: nil)
|
1221
|
+
@converts_to = converts_to
|
1222
|
+
@type = type
|
1223
|
+
end
|
1224
|
+
end
|
959
1225
|
# 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.
|
960
1226
|
attr_accessor :billing_thresholds
|
961
1227
|
# The coupons to redeem into discounts for the subscription item.
|
@@ -972,6 +1238,8 @@ module Stripe
|
|
972
1238
|
attr_accessor :quantity
|
973
1239
|
# 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.
|
974
1240
|
attr_accessor :tax_rates
|
1241
|
+
# Options that configure the trial on the subscription item.
|
1242
|
+
attr_accessor :trial
|
975
1243
|
|
976
1244
|
def initialize(
|
977
1245
|
billing_thresholds: nil,
|
@@ -981,7 +1249,8 @@ module Stripe
|
|
981
1249
|
price: nil,
|
982
1250
|
price_data: nil,
|
983
1251
|
quantity: nil,
|
984
|
-
tax_rates: nil
|
1252
|
+
tax_rates: nil,
|
1253
|
+
trial: nil
|
985
1254
|
)
|
986
1255
|
@billing_thresholds = billing_thresholds
|
987
1256
|
@discounts = discounts
|
@@ -991,6 +1260,16 @@ module Stripe
|
|
991
1260
|
@price_data = price_data
|
992
1261
|
@quantity = quantity
|
993
1262
|
@tax_rates = tax_rates
|
1263
|
+
@trial = trial
|
1264
|
+
end
|
1265
|
+
end
|
1266
|
+
|
1267
|
+
class PauseCollection < Stripe::RequestParams
|
1268
|
+
# The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
1269
|
+
attr_accessor :behavior
|
1270
|
+
|
1271
|
+
def initialize(behavior: nil)
|
1272
|
+
@behavior = behavior
|
994
1273
|
end
|
995
1274
|
end
|
996
1275
|
|
@@ -1005,6 +1284,23 @@ module Stripe
|
|
1005
1284
|
@destination = destination
|
1006
1285
|
end
|
1007
1286
|
end
|
1287
|
+
|
1288
|
+
class TrialSettings < Stripe::RequestParams
|
1289
|
+
class EndBehavior < Stripe::RequestParams
|
1290
|
+
# Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
1291
|
+
attr_accessor :prorate_up_front
|
1292
|
+
|
1293
|
+
def initialize(prorate_up_front: nil)
|
1294
|
+
@prorate_up_front = prorate_up_front
|
1295
|
+
end
|
1296
|
+
end
|
1297
|
+
# Defines how the subscription should behave when a trial ends.
|
1298
|
+
attr_accessor :end_behavior
|
1299
|
+
|
1300
|
+
def initialize(end_behavior: nil)
|
1301
|
+
@end_behavior = end_behavior
|
1302
|
+
end
|
1303
|
+
end
|
1008
1304
|
# 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.
|
1009
1305
|
attr_accessor :add_invoice_items
|
1010
1306
|
# 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).
|
@@ -1039,6 +1335,8 @@ module Stripe
|
|
1039
1335
|
attr_accessor :metadata
|
1040
1336
|
# The account on behalf of which to charge, for each of the associated subscription's invoices.
|
1041
1337
|
attr_accessor :on_behalf_of
|
1338
|
+
# 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).
|
1339
|
+
attr_accessor :pause_collection
|
1042
1340
|
# 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.
|
1043
1341
|
attr_accessor :proration_behavior
|
1044
1342
|
# The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
|
@@ -1047,8 +1345,12 @@ module Stripe
|
|
1047
1345
|
attr_accessor :transfer_data
|
1048
1346
|
# If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
|
1049
1347
|
attr_accessor :trial
|
1348
|
+
# Specify trial behavior when crossing phase boundaries
|
1349
|
+
attr_accessor :trial_continuation
|
1050
1350
|
# 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`
|
1051
1351
|
attr_accessor :trial_end
|
1352
|
+
# Settings related to subscription trials.
|
1353
|
+
attr_accessor :trial_settings
|
1052
1354
|
|
1053
1355
|
def initialize(
|
1054
1356
|
add_invoice_items: nil,
|
@@ -1068,11 +1370,14 @@ module Stripe
|
|
1068
1370
|
iterations: nil,
|
1069
1371
|
metadata: nil,
|
1070
1372
|
on_behalf_of: nil,
|
1373
|
+
pause_collection: nil,
|
1071
1374
|
proration_behavior: nil,
|
1072
1375
|
start_date: nil,
|
1073
1376
|
transfer_data: nil,
|
1074
1377
|
trial: nil,
|
1075
|
-
|
1378
|
+
trial_continuation: nil,
|
1379
|
+
trial_end: nil,
|
1380
|
+
trial_settings: nil
|
1076
1381
|
)
|
1077
1382
|
@add_invoice_items = add_invoice_items
|
1078
1383
|
@application_fee_percent = application_fee_percent
|
@@ -1091,13 +1396,30 @@ module Stripe
|
|
1091
1396
|
@iterations = iterations
|
1092
1397
|
@metadata = metadata
|
1093
1398
|
@on_behalf_of = on_behalf_of
|
1399
|
+
@pause_collection = pause_collection
|
1094
1400
|
@proration_behavior = proration_behavior
|
1095
1401
|
@start_date = start_date
|
1096
1402
|
@transfer_data = transfer_data
|
1097
1403
|
@trial = trial
|
1404
|
+
@trial_continuation = trial_continuation
|
1098
1405
|
@trial_end = trial_end
|
1406
|
+
@trial_settings = trial_settings
|
1407
|
+
end
|
1408
|
+
end
|
1409
|
+
|
1410
|
+
class Prebilling < Stripe::RequestParams
|
1411
|
+
# This is used to determine the number of billing cycles to prebill.
|
1412
|
+
attr_accessor :iterations
|
1413
|
+
# Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
|
1414
|
+
attr_accessor :update_behavior
|
1415
|
+
|
1416
|
+
def initialize(iterations: nil, update_behavior: nil)
|
1417
|
+
@iterations = iterations
|
1418
|
+
@update_behavior = update_behavior
|
1099
1419
|
end
|
1100
1420
|
end
|
1421
|
+
# 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.
|
1422
|
+
attr_accessor :billing_behavior
|
1101
1423
|
# Object representing the subscription schedule's default settings.
|
1102
1424
|
attr_accessor :default_settings
|
1103
1425
|
# 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.
|
@@ -1108,26 +1430,598 @@ module Stripe
|
|
1108
1430
|
attr_accessor :metadata
|
1109
1431
|
# 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.
|
1110
1432
|
attr_accessor :phases
|
1433
|
+
# If specified, the invoicing for the given billing cycle iterations will be processed now.
|
1434
|
+
attr_accessor :prebilling
|
1111
1435
|
# 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`.
|
1112
1436
|
attr_accessor :proration_behavior
|
1113
1437
|
|
1114
1438
|
def initialize(
|
1439
|
+
billing_behavior: nil,
|
1115
1440
|
default_settings: nil,
|
1116
1441
|
end_behavior: nil,
|
1117
1442
|
expand: nil,
|
1118
1443
|
metadata: nil,
|
1119
1444
|
phases: nil,
|
1445
|
+
prebilling: nil,
|
1120
1446
|
proration_behavior: nil
|
1121
1447
|
)
|
1448
|
+
@billing_behavior = billing_behavior
|
1122
1449
|
@default_settings = default_settings
|
1123
1450
|
@end_behavior = end_behavior
|
1124
1451
|
@expand = expand
|
1125
1452
|
@metadata = metadata
|
1126
1453
|
@phases = phases
|
1454
|
+
@prebilling = prebilling
|
1127
1455
|
@proration_behavior = proration_behavior
|
1128
1456
|
end
|
1129
1457
|
end
|
1130
1458
|
|
1459
|
+
class AmendParams < Stripe::RequestParams
|
1460
|
+
class Amendment < Stripe::RequestParams
|
1461
|
+
class AmendmentEnd < Stripe::RequestParams
|
1462
|
+
class DiscountEnd < Stripe::RequestParams
|
1463
|
+
# The ID of a specific discount.
|
1464
|
+
attr_accessor :discount
|
1465
|
+
|
1466
|
+
def initialize(discount: nil)
|
1467
|
+
@discount = discount
|
1468
|
+
end
|
1469
|
+
end
|
1470
|
+
|
1471
|
+
class Duration < Stripe::RequestParams
|
1472
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1473
|
+
attr_accessor :interval
|
1474
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1475
|
+
attr_accessor :interval_count
|
1476
|
+
|
1477
|
+
def initialize(interval: nil, interval_count: nil)
|
1478
|
+
@interval = interval
|
1479
|
+
@interval_count = interval_count
|
1480
|
+
end
|
1481
|
+
end
|
1482
|
+
# Use the `end` time of a given discount.
|
1483
|
+
attr_accessor :discount_end
|
1484
|
+
# Time span for the amendment starting from the `amendment_start`.
|
1485
|
+
attr_accessor :duration
|
1486
|
+
# A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
|
1487
|
+
attr_accessor :timestamp
|
1488
|
+
# Select one of three ways to pass the `amendment_end`.
|
1489
|
+
attr_accessor :type
|
1490
|
+
|
1491
|
+
def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
|
1492
|
+
@discount_end = discount_end
|
1493
|
+
@duration = duration
|
1494
|
+
@timestamp = timestamp
|
1495
|
+
@type = type
|
1496
|
+
end
|
1497
|
+
end
|
1498
|
+
|
1499
|
+
class AmendmentStart < Stripe::RequestParams
|
1500
|
+
class AmendmentEnd < Stripe::RequestParams
|
1501
|
+
# 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.
|
1502
|
+
attr_accessor :index
|
1503
|
+
|
1504
|
+
def initialize(index: nil)
|
1505
|
+
@index = index
|
1506
|
+
end
|
1507
|
+
end
|
1508
|
+
|
1509
|
+
class DiscountEnd < Stripe::RequestParams
|
1510
|
+
# The ID of a specific discount.
|
1511
|
+
attr_accessor :discount
|
1512
|
+
|
1513
|
+
def initialize(discount: nil)
|
1514
|
+
@discount = discount
|
1515
|
+
end
|
1516
|
+
end
|
1517
|
+
# Details of another amendment in the same array, immediately after which this amendment should begin.
|
1518
|
+
attr_accessor :amendment_end
|
1519
|
+
# Use the `end` time of a given discount.
|
1520
|
+
attr_accessor :discount_end
|
1521
|
+
# A precise Unix timestamp for the amendment to start.
|
1522
|
+
attr_accessor :timestamp
|
1523
|
+
# Select one of three ways to pass the `amendment_start`.
|
1524
|
+
attr_accessor :type
|
1525
|
+
|
1526
|
+
def initialize(amendment_end: nil, discount_end: nil, timestamp: nil, type: nil)
|
1527
|
+
@amendment_end = amendment_end
|
1528
|
+
@discount_end = discount_end
|
1529
|
+
@timestamp = timestamp
|
1530
|
+
@type = type
|
1531
|
+
end
|
1532
|
+
end
|
1533
|
+
|
1534
|
+
class DiscountAction < Stripe::RequestParams
|
1535
|
+
class Add < Stripe::RequestParams
|
1536
|
+
class DiscountEnd < Stripe::RequestParams
|
1537
|
+
# The type of calculation made to determine when the discount ends.
|
1538
|
+
attr_accessor :type
|
1539
|
+
|
1540
|
+
def initialize(type: nil)
|
1541
|
+
@type = type
|
1542
|
+
end
|
1543
|
+
end
|
1544
|
+
# The coupon code to redeem.
|
1545
|
+
attr_accessor :coupon
|
1546
|
+
# An ID of an existing discount for a coupon that was already redeemed.
|
1547
|
+
attr_accessor :discount
|
1548
|
+
# Details to determine how long the discount should be applied for.
|
1549
|
+
attr_accessor :discount_end
|
1550
|
+
# 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.
|
1551
|
+
attr_accessor :index
|
1552
|
+
# The promotion code to redeem.
|
1553
|
+
attr_accessor :promotion_code
|
1554
|
+
|
1555
|
+
def initialize(
|
1556
|
+
coupon: nil,
|
1557
|
+
discount: nil,
|
1558
|
+
discount_end: nil,
|
1559
|
+
index: nil,
|
1560
|
+
promotion_code: nil
|
1561
|
+
)
|
1562
|
+
@coupon = coupon
|
1563
|
+
@discount = discount
|
1564
|
+
@discount_end = discount_end
|
1565
|
+
@index = index
|
1566
|
+
@promotion_code = promotion_code
|
1567
|
+
end
|
1568
|
+
end
|
1569
|
+
|
1570
|
+
class Remove < Stripe::RequestParams
|
1571
|
+
# The coupon code to remove from the `discounts` array.
|
1572
|
+
attr_accessor :coupon
|
1573
|
+
# The ID of a discount to remove from the `discounts` array.
|
1574
|
+
attr_accessor :discount
|
1575
|
+
# The ID of a promotion code to remove from the `discounts` array.
|
1576
|
+
attr_accessor :promotion_code
|
1577
|
+
|
1578
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1579
|
+
@coupon = coupon
|
1580
|
+
@discount = discount
|
1581
|
+
@promotion_code = promotion_code
|
1582
|
+
end
|
1583
|
+
end
|
1584
|
+
|
1585
|
+
class Set < Stripe::RequestParams
|
1586
|
+
# The coupon code to replace the `discounts` array with.
|
1587
|
+
attr_accessor :coupon
|
1588
|
+
# An ID of an existing discount to replace the `discounts` array with.
|
1589
|
+
attr_accessor :discount
|
1590
|
+
# An ID of an existing promotion code to replace the `discounts` array with.
|
1591
|
+
attr_accessor :promotion_code
|
1592
|
+
|
1593
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1594
|
+
@coupon = coupon
|
1595
|
+
@discount = discount
|
1596
|
+
@promotion_code = promotion_code
|
1597
|
+
end
|
1598
|
+
end
|
1599
|
+
# Details of the discount to add.
|
1600
|
+
attr_accessor :add
|
1601
|
+
# Details of the discount to remove.
|
1602
|
+
attr_accessor :remove
|
1603
|
+
# Details of the discount to replace the existing discounts with.
|
1604
|
+
attr_accessor :set
|
1605
|
+
# Determines the type of discount action.
|
1606
|
+
attr_accessor :type
|
1607
|
+
|
1608
|
+
def initialize(add: nil, remove: nil, set: nil, type: nil)
|
1609
|
+
@add = add
|
1610
|
+
@remove = remove
|
1611
|
+
@set = set
|
1612
|
+
@type = type
|
1613
|
+
end
|
1614
|
+
end
|
1615
|
+
|
1616
|
+
class ItemAction < Stripe::RequestParams
|
1617
|
+
class Add < Stripe::RequestParams
|
1618
|
+
class Discount < Stripe::RequestParams
|
1619
|
+
class DiscountEnd < Stripe::RequestParams
|
1620
|
+
class Duration < Stripe::RequestParams
|
1621
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1622
|
+
attr_accessor :interval
|
1623
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1624
|
+
attr_accessor :interval_count
|
1625
|
+
|
1626
|
+
def initialize(interval: nil, interval_count: nil)
|
1627
|
+
@interval = interval
|
1628
|
+
@interval_count = interval_count
|
1629
|
+
end
|
1630
|
+
end
|
1631
|
+
# Time span for the redeemed discount.
|
1632
|
+
attr_accessor :duration
|
1633
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1634
|
+
attr_accessor :timestamp
|
1635
|
+
# The type of calculation made to determine when the discount ends.
|
1636
|
+
attr_accessor :type
|
1637
|
+
|
1638
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
1639
|
+
@duration = duration
|
1640
|
+
@timestamp = timestamp
|
1641
|
+
@type = type
|
1642
|
+
end
|
1643
|
+
end
|
1644
|
+
# ID of the coupon to create a new discount for.
|
1645
|
+
attr_accessor :coupon
|
1646
|
+
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
1647
|
+
attr_accessor :discount
|
1648
|
+
# Details to determine how long the discount should be applied for.
|
1649
|
+
attr_accessor :discount_end
|
1650
|
+
# ID of the promotion code to create a new discount for.
|
1651
|
+
attr_accessor :promotion_code
|
1652
|
+
|
1653
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
1654
|
+
@coupon = coupon
|
1655
|
+
@discount = discount
|
1656
|
+
@discount_end = discount_end
|
1657
|
+
@promotion_code = promotion_code
|
1658
|
+
end
|
1659
|
+
end
|
1660
|
+
|
1661
|
+
class Trial < Stripe::RequestParams
|
1662
|
+
# 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.
|
1663
|
+
attr_accessor :converts_to
|
1664
|
+
# Determines the type of trial for this item.
|
1665
|
+
attr_accessor :type
|
1666
|
+
|
1667
|
+
def initialize(converts_to: nil, type: nil)
|
1668
|
+
@converts_to = converts_to
|
1669
|
+
@type = type
|
1670
|
+
end
|
1671
|
+
end
|
1672
|
+
# The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
|
1673
|
+
attr_accessor :discounts
|
1674
|
+
# 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`.
|
1675
|
+
attr_accessor :metadata
|
1676
|
+
# The ID of the price object.
|
1677
|
+
attr_accessor :price
|
1678
|
+
# Quantity for this item.
|
1679
|
+
attr_accessor :quantity
|
1680
|
+
# 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`.
|
1681
|
+
attr_accessor :tax_rates
|
1682
|
+
# Options that configure the trial on the subscription item.
|
1683
|
+
attr_accessor :trial
|
1684
|
+
|
1685
|
+
def initialize(
|
1686
|
+
discounts: nil,
|
1687
|
+
metadata: nil,
|
1688
|
+
price: nil,
|
1689
|
+
quantity: nil,
|
1690
|
+
tax_rates: nil,
|
1691
|
+
trial: nil
|
1692
|
+
)
|
1693
|
+
@discounts = discounts
|
1694
|
+
@metadata = metadata
|
1695
|
+
@price = price
|
1696
|
+
@quantity = quantity
|
1697
|
+
@tax_rates = tax_rates
|
1698
|
+
@trial = trial
|
1699
|
+
end
|
1700
|
+
end
|
1701
|
+
|
1702
|
+
class Remove < Stripe::RequestParams
|
1703
|
+
# ID of a price to remove.
|
1704
|
+
attr_accessor :price
|
1705
|
+
|
1706
|
+
def initialize(price: nil)
|
1707
|
+
@price = price
|
1708
|
+
end
|
1709
|
+
end
|
1710
|
+
|
1711
|
+
class Set < Stripe::RequestParams
|
1712
|
+
class Discount < Stripe::RequestParams
|
1713
|
+
class DiscountEnd < Stripe::RequestParams
|
1714
|
+
class Duration < Stripe::RequestParams
|
1715
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1716
|
+
attr_accessor :interval
|
1717
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1718
|
+
attr_accessor :interval_count
|
1719
|
+
|
1720
|
+
def initialize(interval: nil, interval_count: nil)
|
1721
|
+
@interval = interval
|
1722
|
+
@interval_count = interval_count
|
1723
|
+
end
|
1724
|
+
end
|
1725
|
+
# Time span for the redeemed discount.
|
1726
|
+
attr_accessor :duration
|
1727
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1728
|
+
attr_accessor :timestamp
|
1729
|
+
# The type of calculation made to determine when the discount ends.
|
1730
|
+
attr_accessor :type
|
1731
|
+
|
1732
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
1733
|
+
@duration = duration
|
1734
|
+
@timestamp = timestamp
|
1735
|
+
@type = type
|
1736
|
+
end
|
1737
|
+
end
|
1738
|
+
# ID of the coupon to create a new discount for.
|
1739
|
+
attr_accessor :coupon
|
1740
|
+
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
1741
|
+
attr_accessor :discount
|
1742
|
+
# Details to determine how long the discount should be applied for.
|
1743
|
+
attr_accessor :discount_end
|
1744
|
+
# ID of the promotion code to create a new discount for.
|
1745
|
+
attr_accessor :promotion_code
|
1746
|
+
|
1747
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
1748
|
+
@coupon = coupon
|
1749
|
+
@discount = discount
|
1750
|
+
@discount_end = discount_end
|
1751
|
+
@promotion_code = promotion_code
|
1752
|
+
end
|
1753
|
+
end
|
1754
|
+
|
1755
|
+
class Trial < Stripe::RequestParams
|
1756
|
+
# 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.
|
1757
|
+
attr_accessor :converts_to
|
1758
|
+
# Determines the type of trial for this item.
|
1759
|
+
attr_accessor :type
|
1760
|
+
|
1761
|
+
def initialize(converts_to: nil, type: nil)
|
1762
|
+
@converts_to = converts_to
|
1763
|
+
@type = type
|
1764
|
+
end
|
1765
|
+
end
|
1766
|
+
# 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`.
|
1767
|
+
attr_accessor :discounts
|
1768
|
+
# 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`.
|
1769
|
+
attr_accessor :metadata
|
1770
|
+
# The ID of the price object.
|
1771
|
+
attr_accessor :price
|
1772
|
+
# 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`.
|
1773
|
+
attr_accessor :quantity
|
1774
|
+
# 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`.
|
1775
|
+
attr_accessor :tax_rates
|
1776
|
+
# 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`.
|
1777
|
+
attr_accessor :trial
|
1778
|
+
|
1779
|
+
def initialize(
|
1780
|
+
discounts: nil,
|
1781
|
+
metadata: nil,
|
1782
|
+
price: nil,
|
1783
|
+
quantity: nil,
|
1784
|
+
tax_rates: nil,
|
1785
|
+
trial: nil
|
1786
|
+
)
|
1787
|
+
@discounts = discounts
|
1788
|
+
@metadata = metadata
|
1789
|
+
@price = price
|
1790
|
+
@quantity = quantity
|
1791
|
+
@tax_rates = tax_rates
|
1792
|
+
@trial = trial
|
1793
|
+
end
|
1794
|
+
end
|
1795
|
+
# 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.
|
1796
|
+
attr_accessor :add
|
1797
|
+
# Details of the subscription item to remove.
|
1798
|
+
attr_accessor :remove
|
1799
|
+
# 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.
|
1800
|
+
attr_accessor :set
|
1801
|
+
# Determines the type of item action.
|
1802
|
+
attr_accessor :type
|
1803
|
+
|
1804
|
+
def initialize(add: nil, remove: nil, set: nil, type: nil)
|
1805
|
+
@add = add
|
1806
|
+
@remove = remove
|
1807
|
+
@set = set
|
1808
|
+
@type = type
|
1809
|
+
end
|
1810
|
+
end
|
1811
|
+
|
1812
|
+
class MetadataAction < Stripe::RequestParams
|
1813
|
+
# Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
|
1814
|
+
attr_accessor :add
|
1815
|
+
# Keys to remove from schedule phase metadata.
|
1816
|
+
attr_accessor :remove
|
1817
|
+
# Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
|
1818
|
+
attr_accessor :set
|
1819
|
+
# Select one of three ways to update phase-level `metadata` on subscription schedules.
|
1820
|
+
attr_accessor :type
|
1821
|
+
|
1822
|
+
def initialize(add: nil, remove: nil, set: nil, type: nil)
|
1823
|
+
@add = add
|
1824
|
+
@remove = remove
|
1825
|
+
@set = set
|
1826
|
+
@type = type
|
1827
|
+
end
|
1828
|
+
end
|
1829
|
+
|
1830
|
+
class SetPauseCollection < Stripe::RequestParams
|
1831
|
+
class Set < Stripe::RequestParams
|
1832
|
+
# The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
1833
|
+
attr_accessor :behavior
|
1834
|
+
|
1835
|
+
def initialize(behavior: nil)
|
1836
|
+
@behavior = behavior
|
1837
|
+
end
|
1838
|
+
end
|
1839
|
+
# Details of the pause_collection behavior to apply to the amendment.
|
1840
|
+
attr_accessor :set
|
1841
|
+
# Determines the type of the pause_collection amendment.
|
1842
|
+
attr_accessor :type
|
1843
|
+
|
1844
|
+
def initialize(set: nil, type: nil)
|
1845
|
+
@set = set
|
1846
|
+
@type = type
|
1847
|
+
end
|
1848
|
+
end
|
1849
|
+
|
1850
|
+
class TrialSettings < Stripe::RequestParams
|
1851
|
+
class EndBehavior < Stripe::RequestParams
|
1852
|
+
# Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
1853
|
+
attr_accessor :prorate_up_front
|
1854
|
+
|
1855
|
+
def initialize(prorate_up_front: nil)
|
1856
|
+
@prorate_up_front = prorate_up_front
|
1857
|
+
end
|
1858
|
+
end
|
1859
|
+
# Defines how the subscription should behave when a trial ends.
|
1860
|
+
attr_accessor :end_behavior
|
1861
|
+
|
1862
|
+
def initialize(end_behavior: nil)
|
1863
|
+
@end_behavior = end_behavior
|
1864
|
+
end
|
1865
|
+
end
|
1866
|
+
# 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.
|
1867
|
+
attr_accessor :amendment_end
|
1868
|
+
# Details to identify the earliest timestamp where the proposed change should take effect.
|
1869
|
+
attr_accessor :amendment_start
|
1870
|
+
# 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.
|
1871
|
+
attr_accessor :billing_cycle_anchor
|
1872
|
+
# Changes to the coupons being redeemed or discounts being applied during the amendment time span.
|
1873
|
+
attr_accessor :discount_actions
|
1874
|
+
# Changes to the subscription items during the amendment time span.
|
1875
|
+
attr_accessor :item_actions
|
1876
|
+
# Instructions for how to modify phase metadata
|
1877
|
+
attr_accessor :metadata_actions
|
1878
|
+
# 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`.
|
1879
|
+
attr_accessor :proration_behavior
|
1880
|
+
# Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
|
1881
|
+
attr_accessor :set_pause_collection
|
1882
|
+
# Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
|
1883
|
+
attr_accessor :set_schedule_end
|
1884
|
+
# Settings related to subscription trials.
|
1885
|
+
attr_accessor :trial_settings
|
1886
|
+
|
1887
|
+
def initialize(
|
1888
|
+
amendment_end: nil,
|
1889
|
+
amendment_start: nil,
|
1890
|
+
billing_cycle_anchor: nil,
|
1891
|
+
discount_actions: nil,
|
1892
|
+
item_actions: nil,
|
1893
|
+
metadata_actions: nil,
|
1894
|
+
proration_behavior: nil,
|
1895
|
+
set_pause_collection: nil,
|
1896
|
+
set_schedule_end: nil,
|
1897
|
+
trial_settings: nil
|
1898
|
+
)
|
1899
|
+
@amendment_end = amendment_end
|
1900
|
+
@amendment_start = amendment_start
|
1901
|
+
@billing_cycle_anchor = billing_cycle_anchor
|
1902
|
+
@discount_actions = discount_actions
|
1903
|
+
@item_actions = item_actions
|
1904
|
+
@metadata_actions = metadata_actions
|
1905
|
+
@proration_behavior = proration_behavior
|
1906
|
+
@set_pause_collection = set_pause_collection
|
1907
|
+
@set_schedule_end = set_schedule_end
|
1908
|
+
@trial_settings = trial_settings
|
1909
|
+
end
|
1910
|
+
end
|
1911
|
+
|
1912
|
+
class Prebilling < Stripe::RequestParams
|
1913
|
+
class BillFrom < Stripe::RequestParams
|
1914
|
+
class AmendmentStart < Stripe::RequestParams
|
1915
|
+
# 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.
|
1916
|
+
attr_accessor :index
|
1917
|
+
|
1918
|
+
def initialize(index: nil)
|
1919
|
+
@index = index
|
1920
|
+
end
|
1921
|
+
end
|
1922
|
+
# Start the prebilled period when a specified amendment begins.
|
1923
|
+
attr_accessor :amendment_start
|
1924
|
+
# Start the prebilled period at a precise integer timestamp, starting from the Unix epoch.
|
1925
|
+
attr_accessor :timestamp
|
1926
|
+
# Select one of several ways to pass the `bill_from` value.
|
1927
|
+
attr_accessor :type
|
1928
|
+
|
1929
|
+
def initialize(amendment_start: nil, timestamp: nil, type: nil)
|
1930
|
+
@amendment_start = amendment_start
|
1931
|
+
@timestamp = timestamp
|
1932
|
+
@type = type
|
1933
|
+
end
|
1934
|
+
end
|
1935
|
+
|
1936
|
+
class BillUntil < Stripe::RequestParams
|
1937
|
+
class AmendmentEnd < Stripe::RequestParams
|
1938
|
+
# 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.
|
1939
|
+
attr_accessor :index
|
1940
|
+
|
1941
|
+
def initialize(index: nil)
|
1942
|
+
@index = index
|
1943
|
+
end
|
1944
|
+
end
|
1945
|
+
|
1946
|
+
class Duration < Stripe::RequestParams
|
1947
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1948
|
+
attr_accessor :interval
|
1949
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1950
|
+
attr_accessor :interval_count
|
1951
|
+
|
1952
|
+
def initialize(interval: nil, interval_count: nil)
|
1953
|
+
@interval = interval
|
1954
|
+
@interval_count = interval_count
|
1955
|
+
end
|
1956
|
+
end
|
1957
|
+
# End the prebilled period when a specified amendment ends.
|
1958
|
+
attr_accessor :amendment_end
|
1959
|
+
# Time span for prebilling, starting from `bill_from`.
|
1960
|
+
attr_accessor :duration
|
1961
|
+
# End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
|
1962
|
+
attr_accessor :timestamp
|
1963
|
+
# Select one of several ways to pass the `bill_until` value.
|
1964
|
+
attr_accessor :type
|
1965
|
+
|
1966
|
+
def initialize(amendment_end: nil, duration: nil, timestamp: nil, type: nil)
|
1967
|
+
@amendment_end = amendment_end
|
1968
|
+
@duration = duration
|
1969
|
+
@timestamp = timestamp
|
1970
|
+
@type = type
|
1971
|
+
end
|
1972
|
+
end
|
1973
|
+
# The beginning of the prebilled time period. The default value is `now`.
|
1974
|
+
attr_accessor :bill_from
|
1975
|
+
# The end of the prebilled time period.
|
1976
|
+
attr_accessor :bill_until
|
1977
|
+
# When the prebilling invoice should be created. The default value is `now`.
|
1978
|
+
attr_accessor :invoice_at
|
1979
|
+
# Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
|
1980
|
+
attr_accessor :update_behavior
|
1981
|
+
|
1982
|
+
def initialize(bill_from: nil, bill_until: nil, invoice_at: nil, update_behavior: nil)
|
1983
|
+
@bill_from = bill_from
|
1984
|
+
@bill_until = bill_until
|
1985
|
+
@invoice_at = invoice_at
|
1986
|
+
@update_behavior = update_behavior
|
1987
|
+
end
|
1988
|
+
end
|
1989
|
+
|
1990
|
+
class ScheduleSettings < Stripe::RequestParams
|
1991
|
+
# Behavior of the subscription schedule and underlying subscription when it ends.
|
1992
|
+
attr_accessor :end_behavior
|
1993
|
+
|
1994
|
+
def initialize(end_behavior: nil)
|
1995
|
+
@end_behavior = end_behavior
|
1996
|
+
end
|
1997
|
+
end
|
1998
|
+
# Changes to apply to the phases of the subscription schedule, in the order provided.
|
1999
|
+
attr_accessor :amendments
|
2000
|
+
# Specifies which fields in the response should be expanded.
|
2001
|
+
attr_accessor :expand
|
2002
|
+
# Provide any time periods to bill in advance.
|
2003
|
+
attr_accessor :prebilling
|
2004
|
+
# In cases where the amendment changes the currently active phase,
|
2005
|
+
# specifies if and how to prorate at the time of the request.
|
2006
|
+
attr_accessor :proration_behavior
|
2007
|
+
# Changes to apply to the subscription schedule.
|
2008
|
+
attr_accessor :schedule_settings
|
2009
|
+
|
2010
|
+
def initialize(
|
2011
|
+
amendments: nil,
|
2012
|
+
expand: nil,
|
2013
|
+
prebilling: nil,
|
2014
|
+
proration_behavior: nil,
|
2015
|
+
schedule_settings: nil
|
2016
|
+
)
|
2017
|
+
@amendments = amendments
|
2018
|
+
@expand = expand
|
2019
|
+
@prebilling = prebilling
|
2020
|
+
@proration_behavior = proration_behavior
|
2021
|
+
@schedule_settings = schedule_settings
|
2022
|
+
end
|
2023
|
+
end
|
2024
|
+
|
1131
2025
|
class CancelParams < Stripe::RequestParams
|
1132
2026
|
# Specifies which fields in the response should be expanded.
|
1133
2027
|
attr_accessor :expand
|
@@ -1155,6 +2049,17 @@ module Stripe
|
|
1155
2049
|
end
|
1156
2050
|
end
|
1157
2051
|
|
2052
|
+
# Amends an existing subscription schedule.
|
2053
|
+
def amend(schedule, params = {}, opts = {})
|
2054
|
+
request(
|
2055
|
+
method: :post,
|
2056
|
+
path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(schedule) }),
|
2057
|
+
params: params,
|
2058
|
+
opts: opts,
|
2059
|
+
base_address: :api
|
2060
|
+
)
|
2061
|
+
end
|
2062
|
+
|
1158
2063
|
# 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.
|
1159
2064
|
def cancel(schedule, params = {}, opts = {})
|
1160
2065
|
request(
|