stripe 15.1.0 → 15.2.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 +1561 -695
- 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 +89 -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/object_types.rb +52 -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 +299 -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/meter_error_report.rb +59 -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 +1470 -0
- data/lib/stripe/resources/checkout/session.rb +331 -3
- data/lib/stripe/resources/confirmation_token.rb +176 -0
- data/lib/stripe/resources/coupon.rb +30 -1
- data/lib/stripe/resources/credit_note.rb +10 -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 +20 -1
- data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +27 -0
- data/lib/stripe/resources/financial_connections/institution.rb +90 -0
- data/lib/stripe/resources/financial_connections/session.rb +62 -2
- data/lib/stripe/resources/fx_quote.rb +184 -0
- data/lib/stripe/resources/gift_cards/card.rb +208 -0
- data/lib/stripe/resources/gift_cards/transaction.rb +272 -0
- data/lib/stripe/resources/identity/verification_session.rb +10 -0
- data/lib/stripe/resources/invoice.rb +1129 -15
- 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 +2859 -0
- data/lib/stripe/resources/payment_attempt_record.rb +1078 -0
- data/lib/stripe/resources/payment_intent.rb +6036 -1214
- data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +65 -0
- data/lib/stripe/resources/payment_method.rb +198 -1
- data/lib/stripe/resources/payment_method_configuration.rb +295 -0
- data/lib/stripe/resources/payment_record.rb +1607 -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 +275 -0
- data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +25 -0
- data/lib/stripe/resources/product.rb +59 -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 +339 -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 +596 -9
- data/lib/stripe/resources/source.rb +29 -0
- data/lib/stripe/resources/subscription.rb +298 -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 +89 -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 +406 -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 +136 -0
- data/lib/stripe/resources/v2/money_management/received_debit.rb +108 -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.rb +99 -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 +269 -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 +1350 -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 -123
- 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/gift_cards/card_service.rb +170 -0
- data/lib/stripe/services/gift_cards/transaction_service.rb +209 -0
- data/lib/stripe/services/gift_cards_service.rb +14 -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 +1059 -15
- 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 +2268 -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 +4631 -258
- data/lib/stripe/services/payment_method_configuration_service.rb +210 -0
- data/lib/stripe/services/payment_method_service.rb +126 -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 +231 -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/product_service.rb +38 -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 +556 -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 +257 -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 +180 -0
- data/lib/stripe/services/terminal_service.rb +2 -1
- data/lib/stripe/services/test_helpers/confirmation_token_service.rb +103 -0
- data/lib/stripe/services/test_helpers/terminal/reader_service.rb +43 -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 +12 -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 +1048 -0
- data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +135 -0
- data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +109 -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 +75 -0
- data/lib/stripe/services/v2/money_management/financial_account_service.rb +44 -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 +126 -0
- data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +96 -0
- data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +202 -0
- data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +237 -0
- data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +174 -0
- data/lib/stripe/services/v2/money_management/payout_method_service.rb +95 -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 +71 -0
- data/lib/stripe/services/v2/money_management/received_debit_service.rb +44 -0
- data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +70 -0
- data/lib/stripe/services/v2/money_management/transaction_service.rb +74 -0
- data/lib/stripe/services/v2/money_management_service.rb +31 -0
- data/lib/stripe/services/v2/test_helper_service.rb +15 -0
- data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +50 -0
- data/lib/stripe/services/v2_services.rb +4 -2
- data/lib/stripe/services.rb +54 -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 +191867 -0
- data/stripe.gemspec +4 -1
- metadata +157 -324
- data/lib/stripe/services/invoice_payment_service.rb +0 -83
- data/rbi/stripe/resources/account.rbi +0 -4903
- data/rbi/stripe/resources/account_link.rbi +0 -74
- data/rbi/stripe/resources/account_session.rbi +0 -894
- data/rbi/stripe/resources/apple_pay_domain.rbi +0 -90
- 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 -180
- data/rbi/stripe/resources/balance_transaction.rbi +0 -144
- 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 -2057
- data/rbi/stripe/resources/checkout/session.rbi +0 -3988
- 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 -1873
- 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 -252
- data/rbi/stripe/resources/credit_note.rbi +0 -747
- data/rbi/stripe/resources/credit_note_line_item.rbi +0 -101
- data/rbi/stripe/resources/customer.rbi +0 -1009
- 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 -351
- data/rbi/stripe/resources/identity/verification_session.rbi +0 -517
- data/rbi/stripe/resources/invoice.rbi +0 -3736
- data/rbi/stripe/resources/invoice_item.rbi +0 -475
- data/rbi/stripe/resources/invoice_line_item.rbi +0 -432
- data/rbi/stripe/resources/invoice_payment.rbi +0 -114
- 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 -9795
- data/rbi/stripe/resources/payment_link.rbi +0 -1801
- data/rbi/stripe/resources/payment_method.rbi +0 -1831
- data/rbi/stripe/resources/payment_method_configuration.rbi +0 -3220
- 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 -373
- data/rbi/stripe/resources/price.rbi +0 -694
- data/rbi/stripe/resources/product.rbi +0 -557
- 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 -170
- data/rbi/stripe/resources/radar/value_list_item.rbi +0 -131
- data/rbi/stripe/resources/refund.rbi +0 -519
- 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 -3869
- 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 -1964
- data/rbi/stripe/resources/subscription_item.rbi +0 -370
- data/rbi/stripe/resources/subscription_schedule.rbi +0 -1495
- data/rbi/stripe/resources/tax/calculation.rbi +0 -474
- data/rbi/stripe/resources/tax/calculation_line_item.rbi +0 -88
- 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 -167
- data/rbi/stripe/resources/tax_rate.rbi +0 -239
- data/rbi/stripe/resources/terminal/configuration.rbi +0 -1388
- data/rbi/stripe/resources/terminal/connection_token.rbi +0 -37
- data/rbi/stripe/resources/terminal/location.rbi +0 -224
- data/rbi/stripe/resources/terminal/reader.rbi +0 -587
- data/rbi/stripe/resources/test_helpers/test_clock.rbi +0 -134
- 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 -170
- 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 -1013
- data/rbi/stripe/services/account_service.rbi +0 -4189
- data/rbi/stripe/services/account_session_service.rbi +0 -572
- data/rbi/stripe/services/apple_pay_domain_service.rbi +0 -78
- 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 -2607
- 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 -196
- data/rbi/stripe/services/credit_note_preview_lines_service.rbi +0 -167
- data/rbi/stripe/services/credit_note_service.rbi +0 -416
- 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 -651
- data/rbi/stripe/services/customer_session_service.rbi +0 -116
- data/rbi/stripe/services/customer_tax_id_service.rbi +0 -72
- 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 -368
- 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 -2920
- 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 -7819
- data/rbi/stripe/services/payment_link_service.rbi +0 -1352
- data/rbi/stripe/services/payment_method_configuration_service.rbi +0 -2255
- data/rbi/stripe/services/payment_method_domain_service.rbi +0 -112
- data/rbi/stripe/services/payment_method_service.rbi +0 -846
- data/rbi/stripe/services/payout_service.rbi +0 -205
- data/rbi/stripe/services/plan_service.rbi +0 -284
- data/rbi/stripe/services/price_service.rbi +0 -546
- data/rbi/stripe/services/product_feature_service.rbi +0 -69
- data/rbi/stripe/services/product_service.rbi +0 -479
- 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 -111
- data/rbi/stripe/services/radar/value_list_service.rbi +0 -143
- 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 -3605
- 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 -324
- data/rbi/stripe/services/subscription_schedule_service.rbi +0 -1192
- data/rbi/stripe/services/subscription_service.rbi +0 -1596
- data/rbi/stripe/services/tax/calculation_service.rbi +0 -230
- 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 -112
- 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 -1120
- data/rbi/stripe/services/terminal/connection_token_service.rbi +0 -25
- data/rbi/stripe/services/terminal/location_service.rbi +0 -184
- data/rbi/stripe/services/terminal/reader_service.rbi +0 -344
- data/rbi/stripe/services/terminal_service.rbi +0 -12
- data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +0 -805
- 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 -62
- data/rbi/stripe/services/test_helpers/terminal_service.rbi +0 -11
- data/rbi/stripe/services/test_helpers/test_clock_service.rbi +0 -92
- 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 -20
- 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 -200
- data/rbi/stripe/services/v2/core/event_service.rbi +0 -38
- 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 -131
@@ -3,10 +3,14 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
class QuoteService < StripeService
|
6
|
-
attr_reader :line_items, :computed_upfront_line_items
|
6
|
+
attr_reader :preview_invoices, :preview_subscription_schedules, :lines, :line_items, :computed_upfront_line_items
|
7
7
|
|
8
8
|
def initialize(requestor)
|
9
9
|
super
|
10
|
+
@preview_invoices = Stripe::QuotePreviewInvoiceService.new(@requestor)
|
11
|
+
@preview_subscription_schedules = Stripe::QuotePreviewSubscriptionScheduleService
|
12
|
+
.new(@requestor)
|
13
|
+
@lines = Stripe::QuoteLineService.new(@requestor)
|
10
14
|
@line_items = Stripe::QuoteLineItemService.new(@requestor)
|
11
15
|
@computed_upfront_line_items = Stripe::QuoteComputedUpfrontLineItemsService.new(@requestor)
|
12
16
|
end
|
@@ -14,10 +18,14 @@ module Stripe
|
|
14
18
|
class ListParams < Stripe::RequestParams
|
15
19
|
# The ID of the customer whose quotes will be retrieved.
|
16
20
|
attr_accessor :customer
|
21
|
+
# The ID of the account whose quotes will be retrieved.
|
22
|
+
attr_accessor :customer_account
|
17
23
|
# 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.
|
18
24
|
attr_accessor :ending_before
|
19
25
|
# Specifies which fields in the response should be expanded.
|
20
26
|
attr_accessor :expand
|
27
|
+
# The subscription which the quote updates.
|
28
|
+
attr_accessor :from_subscription
|
21
29
|
# A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
|
22
30
|
attr_accessor :limit
|
23
31
|
# A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
|
@@ -29,16 +37,20 @@ module Stripe
|
|
29
37
|
|
30
38
|
def initialize(
|
31
39
|
customer: nil,
|
40
|
+
customer_account: nil,
|
32
41
|
ending_before: nil,
|
33
42
|
expand: nil,
|
43
|
+
from_subscription: nil,
|
34
44
|
limit: nil,
|
35
45
|
starting_after: nil,
|
36
46
|
status: nil,
|
37
47
|
test_clock: nil
|
38
48
|
)
|
39
49
|
@customer = customer
|
50
|
+
@customer_account = customer_account
|
40
51
|
@ending_before = ending_before
|
41
52
|
@expand = expand
|
53
|
+
@from_subscription = from_subscription
|
42
54
|
@limit = limit
|
43
55
|
@starting_after = starting_after
|
44
56
|
@status = status
|
@@ -71,16 +83,44 @@ module Stripe
|
|
71
83
|
end
|
72
84
|
|
73
85
|
class Discount < Stripe::RequestParams
|
86
|
+
class DiscountEnd < Stripe::RequestParams
|
87
|
+
class Duration < Stripe::RequestParams
|
88
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
89
|
+
attr_accessor :interval
|
90
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
91
|
+
attr_accessor :interval_count
|
92
|
+
|
93
|
+
def initialize(interval: nil, interval_count: nil)
|
94
|
+
@interval = interval
|
95
|
+
@interval_count = interval_count
|
96
|
+
end
|
97
|
+
end
|
98
|
+
# Time span for the redeemed discount.
|
99
|
+
attr_accessor :duration
|
100
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
101
|
+
attr_accessor :timestamp
|
102
|
+
# The type of calculation made to determine when the discount ends.
|
103
|
+
attr_accessor :type
|
104
|
+
|
105
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
106
|
+
@duration = duration
|
107
|
+
@timestamp = timestamp
|
108
|
+
@type = type
|
109
|
+
end
|
110
|
+
end
|
74
111
|
# ID of the coupon to create a new discount for.
|
75
112
|
attr_accessor :coupon
|
76
113
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
77
114
|
attr_accessor :discount
|
115
|
+
# Details to determine how long the discount should be applied for.
|
116
|
+
attr_accessor :discount_end
|
78
117
|
# ID of the promotion code to create a new discount for.
|
79
118
|
attr_accessor :promotion_code
|
80
119
|
|
81
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
120
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
82
121
|
@coupon = coupon
|
83
122
|
@discount = discount
|
123
|
+
@discount_end = discount_end
|
84
124
|
@promotion_code = promotion_code
|
85
125
|
end
|
86
126
|
end
|
@@ -120,18 +160,522 @@ module Stripe
|
|
120
160
|
end
|
121
161
|
end
|
122
162
|
|
163
|
+
class Line < Stripe::RequestParams
|
164
|
+
class Action < Stripe::RequestParams
|
165
|
+
class AddDiscount < Stripe::RequestParams
|
166
|
+
class DiscountEnd < Stripe::RequestParams
|
167
|
+
# The type of calculation made to determine when the discount ends.
|
168
|
+
attr_accessor :type
|
169
|
+
|
170
|
+
def initialize(type: nil)
|
171
|
+
@type = type
|
172
|
+
end
|
173
|
+
end
|
174
|
+
# The coupon code to redeem.
|
175
|
+
attr_accessor :coupon
|
176
|
+
# An ID of an existing discount for a coupon that was already redeemed.
|
177
|
+
attr_accessor :discount
|
178
|
+
# Details to determine how long the discount should be applied for.
|
179
|
+
attr_accessor :discount_end
|
180
|
+
# 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.
|
181
|
+
attr_accessor :index
|
182
|
+
# The promotion code to redeem.
|
183
|
+
attr_accessor :promotion_code
|
184
|
+
|
185
|
+
def initialize(
|
186
|
+
coupon: nil,
|
187
|
+
discount: nil,
|
188
|
+
discount_end: nil,
|
189
|
+
index: nil,
|
190
|
+
promotion_code: nil
|
191
|
+
)
|
192
|
+
@coupon = coupon
|
193
|
+
@discount = discount
|
194
|
+
@discount_end = discount_end
|
195
|
+
@index = index
|
196
|
+
@promotion_code = promotion_code
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
class AddItem < Stripe::RequestParams
|
201
|
+
class Discount < Stripe::RequestParams
|
202
|
+
class DiscountEnd < Stripe::RequestParams
|
203
|
+
class Duration < Stripe::RequestParams
|
204
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
205
|
+
attr_accessor :interval
|
206
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
207
|
+
attr_accessor :interval_count
|
208
|
+
|
209
|
+
def initialize(interval: nil, interval_count: nil)
|
210
|
+
@interval = interval
|
211
|
+
@interval_count = interval_count
|
212
|
+
end
|
213
|
+
end
|
214
|
+
# Time span for the redeemed discount.
|
215
|
+
attr_accessor :duration
|
216
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
217
|
+
attr_accessor :timestamp
|
218
|
+
# The type of calculation made to determine when the discount ends.
|
219
|
+
attr_accessor :type
|
220
|
+
|
221
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
222
|
+
@duration = duration
|
223
|
+
@timestamp = timestamp
|
224
|
+
@type = type
|
225
|
+
end
|
226
|
+
end
|
227
|
+
# ID of the coupon to create a new discount for.
|
228
|
+
attr_accessor :coupon
|
229
|
+
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
230
|
+
attr_accessor :discount
|
231
|
+
# Details to determine how long the discount should be applied for.
|
232
|
+
attr_accessor :discount_end
|
233
|
+
# ID of the promotion code to create a new discount for.
|
234
|
+
attr_accessor :promotion_code
|
235
|
+
|
236
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
237
|
+
@coupon = coupon
|
238
|
+
@discount = discount
|
239
|
+
@discount_end = discount_end
|
240
|
+
@promotion_code = promotion_code
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
class Trial < Stripe::RequestParams
|
245
|
+
# 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.
|
246
|
+
attr_accessor :converts_to
|
247
|
+
# Determines the type of trial for this item.
|
248
|
+
attr_accessor :type
|
249
|
+
|
250
|
+
def initialize(converts_to: nil, type: nil)
|
251
|
+
@converts_to = converts_to
|
252
|
+
@type = type
|
253
|
+
end
|
254
|
+
end
|
255
|
+
# The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
|
256
|
+
attr_accessor :discounts
|
257
|
+
# 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`.
|
258
|
+
attr_accessor :metadata
|
259
|
+
# The ID of the price object.
|
260
|
+
attr_accessor :price
|
261
|
+
# Quantity for this item.
|
262
|
+
attr_accessor :quantity
|
263
|
+
# 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`.
|
264
|
+
attr_accessor :tax_rates
|
265
|
+
# Options that configure the trial on the subscription item.
|
266
|
+
attr_accessor :trial
|
267
|
+
|
268
|
+
def initialize(
|
269
|
+
discounts: nil,
|
270
|
+
metadata: nil,
|
271
|
+
price: nil,
|
272
|
+
quantity: nil,
|
273
|
+
tax_rates: nil,
|
274
|
+
trial: nil
|
275
|
+
)
|
276
|
+
@discounts = discounts
|
277
|
+
@metadata = metadata
|
278
|
+
@price = price
|
279
|
+
@quantity = quantity
|
280
|
+
@tax_rates = tax_rates
|
281
|
+
@trial = trial
|
282
|
+
end
|
283
|
+
end
|
284
|
+
|
285
|
+
class RemoveDiscount < Stripe::RequestParams
|
286
|
+
# The coupon code to remove from the `discounts` array.
|
287
|
+
attr_accessor :coupon
|
288
|
+
# The ID of a discount to remove from the `discounts` array.
|
289
|
+
attr_accessor :discount
|
290
|
+
# The ID of a promotion code to remove from the `discounts` array.
|
291
|
+
attr_accessor :promotion_code
|
292
|
+
|
293
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
294
|
+
@coupon = coupon
|
295
|
+
@discount = discount
|
296
|
+
@promotion_code = promotion_code
|
297
|
+
end
|
298
|
+
end
|
299
|
+
|
300
|
+
class RemoveItem < Stripe::RequestParams
|
301
|
+
# ID of a price to remove.
|
302
|
+
attr_accessor :price
|
303
|
+
|
304
|
+
def initialize(price: nil)
|
305
|
+
@price = price
|
306
|
+
end
|
307
|
+
end
|
308
|
+
|
309
|
+
class SetDiscount < Stripe::RequestParams
|
310
|
+
# The coupon code to replace the `discounts` array with.
|
311
|
+
attr_accessor :coupon
|
312
|
+
# An ID of an existing discount to replace the `discounts` array with.
|
313
|
+
attr_accessor :discount
|
314
|
+
# An ID of an existing promotion code to replace the `discounts` array with.
|
315
|
+
attr_accessor :promotion_code
|
316
|
+
|
317
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
318
|
+
@coupon = coupon
|
319
|
+
@discount = discount
|
320
|
+
@promotion_code = promotion_code
|
321
|
+
end
|
322
|
+
end
|
323
|
+
|
324
|
+
class SetItem < Stripe::RequestParams
|
325
|
+
class Discount < Stripe::RequestParams
|
326
|
+
class DiscountEnd < Stripe::RequestParams
|
327
|
+
class Duration < Stripe::RequestParams
|
328
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
329
|
+
attr_accessor :interval
|
330
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
331
|
+
attr_accessor :interval_count
|
332
|
+
|
333
|
+
def initialize(interval: nil, interval_count: nil)
|
334
|
+
@interval = interval
|
335
|
+
@interval_count = interval_count
|
336
|
+
end
|
337
|
+
end
|
338
|
+
# Time span for the redeemed discount.
|
339
|
+
attr_accessor :duration
|
340
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
341
|
+
attr_accessor :timestamp
|
342
|
+
# The type of calculation made to determine when the discount ends.
|
343
|
+
attr_accessor :type
|
344
|
+
|
345
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
346
|
+
@duration = duration
|
347
|
+
@timestamp = timestamp
|
348
|
+
@type = type
|
349
|
+
end
|
350
|
+
end
|
351
|
+
# ID of the coupon to create a new discount for.
|
352
|
+
attr_accessor :coupon
|
353
|
+
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
354
|
+
attr_accessor :discount
|
355
|
+
# Details to determine how long the discount should be applied for.
|
356
|
+
attr_accessor :discount_end
|
357
|
+
# ID of the promotion code to create a new discount for.
|
358
|
+
attr_accessor :promotion_code
|
359
|
+
|
360
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
361
|
+
@coupon = coupon
|
362
|
+
@discount = discount
|
363
|
+
@discount_end = discount_end
|
364
|
+
@promotion_code = promotion_code
|
365
|
+
end
|
366
|
+
end
|
367
|
+
|
368
|
+
class Trial < Stripe::RequestParams
|
369
|
+
# 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.
|
370
|
+
attr_accessor :converts_to
|
371
|
+
# Determines the type of trial for this item.
|
372
|
+
attr_accessor :type
|
373
|
+
|
374
|
+
def initialize(converts_to: nil, type: nil)
|
375
|
+
@converts_to = converts_to
|
376
|
+
@type = type
|
377
|
+
end
|
378
|
+
end
|
379
|
+
# 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`.
|
380
|
+
attr_accessor :discounts
|
381
|
+
# 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`.
|
382
|
+
attr_accessor :metadata
|
383
|
+
# The ID of the price object.
|
384
|
+
attr_accessor :price
|
385
|
+
# 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`.
|
386
|
+
attr_accessor :quantity
|
387
|
+
# 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`.
|
388
|
+
attr_accessor :tax_rates
|
389
|
+
# 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`.
|
390
|
+
attr_accessor :trial
|
391
|
+
|
392
|
+
def initialize(
|
393
|
+
discounts: nil,
|
394
|
+
metadata: nil,
|
395
|
+
price: nil,
|
396
|
+
quantity: nil,
|
397
|
+
tax_rates: nil,
|
398
|
+
trial: nil
|
399
|
+
)
|
400
|
+
@discounts = discounts
|
401
|
+
@metadata = metadata
|
402
|
+
@price = price
|
403
|
+
@quantity = quantity
|
404
|
+
@tax_rates = tax_rates
|
405
|
+
@trial = trial
|
406
|
+
end
|
407
|
+
end
|
408
|
+
# Details for the `add_discount` type.
|
409
|
+
attr_accessor :add_discount
|
410
|
+
# Details for the `add_item` type.
|
411
|
+
attr_accessor :add_item
|
412
|
+
# Details for the `add_metadata` type: specify a hash of key-value pairs.
|
413
|
+
attr_accessor :add_metadata
|
414
|
+
# Details for the `remove_discount` type.
|
415
|
+
attr_accessor :remove_discount
|
416
|
+
# Details for the `remove_item` type.
|
417
|
+
attr_accessor :remove_item
|
418
|
+
# Details for the `remove_metadata` type: specify an array of metadata keys.
|
419
|
+
attr_accessor :remove_metadata
|
420
|
+
# Details for the `set_discounts` type.
|
421
|
+
attr_accessor :set_discounts
|
422
|
+
# Details for the `set_items` type.
|
423
|
+
attr_accessor :set_items
|
424
|
+
# Details for the `set_metadata` type: specify an array of key-value pairs.
|
425
|
+
attr_accessor :set_metadata
|
426
|
+
# The type of action the quote line performs.
|
427
|
+
attr_accessor :type
|
428
|
+
|
429
|
+
def initialize(
|
430
|
+
add_discount: nil,
|
431
|
+
add_item: nil,
|
432
|
+
add_metadata: nil,
|
433
|
+
remove_discount: nil,
|
434
|
+
remove_item: nil,
|
435
|
+
remove_metadata: nil,
|
436
|
+
set_discounts: nil,
|
437
|
+
set_items: nil,
|
438
|
+
set_metadata: nil,
|
439
|
+
type: nil
|
440
|
+
)
|
441
|
+
@add_discount = add_discount
|
442
|
+
@add_item = add_item
|
443
|
+
@add_metadata = add_metadata
|
444
|
+
@remove_discount = remove_discount
|
445
|
+
@remove_item = remove_item
|
446
|
+
@remove_metadata = remove_metadata
|
447
|
+
@set_discounts = set_discounts
|
448
|
+
@set_items = set_items
|
449
|
+
@set_metadata = set_metadata
|
450
|
+
@type = type
|
451
|
+
end
|
452
|
+
end
|
453
|
+
|
454
|
+
class AppliesTo < Stripe::RequestParams
|
455
|
+
# A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
|
456
|
+
attr_accessor :new_reference
|
457
|
+
# The ID of the schedule the line applies to.
|
458
|
+
attr_accessor :subscription_schedule
|
459
|
+
# Describes whether the quote line is affecting a new schedule or an existing schedule.
|
460
|
+
attr_accessor :type
|
461
|
+
|
462
|
+
def initialize(new_reference: nil, subscription_schedule: nil, type: nil)
|
463
|
+
@new_reference = new_reference
|
464
|
+
@subscription_schedule = subscription_schedule
|
465
|
+
@type = type
|
466
|
+
end
|
467
|
+
end
|
468
|
+
|
469
|
+
class CancelSubscriptionSchedule < Stripe::RequestParams
|
470
|
+
# Timestamp helper to cancel the underlying schedule on the accompanying line's start date. Must be set to `line_starts_at`.
|
471
|
+
attr_accessor :cancel_at
|
472
|
+
# If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Boolean that defaults to `true`.
|
473
|
+
attr_accessor :invoice_now
|
474
|
+
# If the subscription schedule is `active`, indicates if the cancellation should be prorated. Boolean that defaults to `true`.
|
475
|
+
attr_accessor :prorate
|
476
|
+
|
477
|
+
def initialize(cancel_at: nil, invoice_now: nil, prorate: nil)
|
478
|
+
@cancel_at = cancel_at
|
479
|
+
@invoice_now = invoice_now
|
480
|
+
@prorate = prorate
|
481
|
+
end
|
482
|
+
end
|
483
|
+
|
484
|
+
class EndsAt < Stripe::RequestParams
|
485
|
+
class DiscountEnd < Stripe::RequestParams
|
486
|
+
# The ID of a specific discount.
|
487
|
+
attr_accessor :discount
|
488
|
+
|
489
|
+
def initialize(discount: nil)
|
490
|
+
@discount = discount
|
491
|
+
end
|
492
|
+
end
|
493
|
+
|
494
|
+
class Duration < Stripe::RequestParams
|
495
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
496
|
+
attr_accessor :interval
|
497
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
498
|
+
attr_accessor :interval_count
|
499
|
+
|
500
|
+
def initialize(interval: nil, interval_count: nil)
|
501
|
+
@interval = interval
|
502
|
+
@interval_count = interval_count
|
503
|
+
end
|
504
|
+
end
|
505
|
+
# Use the `end` time of a given discount.
|
506
|
+
attr_accessor :discount_end
|
507
|
+
# Time span for the quote line starting from the `starts_at` date.
|
508
|
+
attr_accessor :duration
|
509
|
+
# A precise Unix timestamp.
|
510
|
+
attr_accessor :timestamp
|
511
|
+
# Select a way to pass in `ends_at`.
|
512
|
+
attr_accessor :type
|
513
|
+
|
514
|
+
def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
|
515
|
+
@discount_end = discount_end
|
516
|
+
@duration = duration
|
517
|
+
@timestamp = timestamp
|
518
|
+
@type = type
|
519
|
+
end
|
520
|
+
end
|
521
|
+
|
522
|
+
class SetPauseCollection < Stripe::RequestParams
|
523
|
+
class Set < Stripe::RequestParams
|
524
|
+
# The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
525
|
+
attr_accessor :behavior
|
526
|
+
|
527
|
+
def initialize(behavior: nil)
|
528
|
+
@behavior = behavior
|
529
|
+
end
|
530
|
+
end
|
531
|
+
# Details of the pause_collection behavior to apply to the amendment.
|
532
|
+
attr_accessor :set
|
533
|
+
# Determines the type of the pause_collection amendment.
|
534
|
+
attr_accessor :type
|
535
|
+
|
536
|
+
def initialize(set: nil, type: nil)
|
537
|
+
@set = set
|
538
|
+
@type = type
|
539
|
+
end
|
540
|
+
end
|
541
|
+
|
542
|
+
class StartsAt < Stripe::RequestParams
|
543
|
+
class DiscountEnd < Stripe::RequestParams
|
544
|
+
# The ID of a specific discount.
|
545
|
+
attr_accessor :discount
|
546
|
+
|
547
|
+
def initialize(discount: nil)
|
548
|
+
@discount = discount
|
549
|
+
end
|
550
|
+
end
|
551
|
+
|
552
|
+
class LineEndsAt < Stripe::RequestParams
|
553
|
+
# The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
|
554
|
+
attr_accessor :index
|
555
|
+
|
556
|
+
def initialize(index: nil)
|
557
|
+
@index = index
|
558
|
+
end
|
559
|
+
end
|
560
|
+
# Use the `end` time of a given discount.
|
561
|
+
attr_accessor :discount_end
|
562
|
+
# The timestamp the given line ends at.
|
563
|
+
attr_accessor :line_ends_at
|
564
|
+
# A precise Unix timestamp.
|
565
|
+
attr_accessor :timestamp
|
566
|
+
# Select a way to pass in `starts_at`.
|
567
|
+
attr_accessor :type
|
568
|
+
|
569
|
+
def initialize(discount_end: nil, line_ends_at: nil, timestamp: nil, type: nil)
|
570
|
+
@discount_end = discount_end
|
571
|
+
@line_ends_at = line_ends_at
|
572
|
+
@timestamp = timestamp
|
573
|
+
@type = type
|
574
|
+
end
|
575
|
+
end
|
576
|
+
|
577
|
+
class TrialSettings < Stripe::RequestParams
|
578
|
+
class EndBehavior < Stripe::RequestParams
|
579
|
+
# Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
580
|
+
attr_accessor :prorate_up_front
|
581
|
+
|
582
|
+
def initialize(prorate_up_front: nil)
|
583
|
+
@prorate_up_front = prorate_up_front
|
584
|
+
end
|
585
|
+
end
|
586
|
+
# Defines how the subscription should behave when a trial ends.
|
587
|
+
attr_accessor :end_behavior
|
588
|
+
|
589
|
+
def initialize(end_behavior: nil)
|
590
|
+
@end_behavior = end_behavior
|
591
|
+
end
|
592
|
+
end
|
593
|
+
# An array of operations the quote line performs.
|
594
|
+
attr_accessor :actions
|
595
|
+
# Details to identify the subscription schedule the quote line applies to.
|
596
|
+
attr_accessor :applies_to
|
597
|
+
# For point-in-time quote lines (having no `ends_at` timestamp), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the Quote Line `starts_at` timestamp.For time-span based quote lines (having both `starts_at` and `ends_at`), the only valid value is `automatic`, which removes any previously configured billing cycle anchor resets during the window of time spanning the quote line.
|
598
|
+
attr_accessor :billing_cycle_anchor
|
599
|
+
# A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings.
|
600
|
+
attr_accessor :cancel_subscription_schedule
|
601
|
+
# Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line.
|
602
|
+
attr_accessor :ends_at
|
603
|
+
# Changes to how Stripe handles prorations during the quote line's time span. Affects if and how prorations are created when a future phase starts.
|
604
|
+
attr_accessor :proration_behavior
|
605
|
+
# Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
|
606
|
+
attr_accessor :set_pause_collection
|
607
|
+
# Timestamp helper to end the underlying schedule early, based on the acompanying line's start or end date.
|
608
|
+
attr_accessor :set_schedule_end
|
609
|
+
# Details to identify the earliest timestamp where the proposed change should take effect.
|
610
|
+
attr_accessor :starts_at
|
611
|
+
# Settings related to subscription trials.
|
612
|
+
attr_accessor :trial_settings
|
613
|
+
|
614
|
+
def initialize(
|
615
|
+
actions: nil,
|
616
|
+
applies_to: nil,
|
617
|
+
billing_cycle_anchor: nil,
|
618
|
+
cancel_subscription_schedule: nil,
|
619
|
+
ends_at: nil,
|
620
|
+
proration_behavior: nil,
|
621
|
+
set_pause_collection: nil,
|
622
|
+
set_schedule_end: nil,
|
623
|
+
starts_at: nil,
|
624
|
+
trial_settings: nil
|
625
|
+
)
|
626
|
+
@actions = actions
|
627
|
+
@applies_to = applies_to
|
628
|
+
@billing_cycle_anchor = billing_cycle_anchor
|
629
|
+
@cancel_subscription_schedule = cancel_subscription_schedule
|
630
|
+
@ends_at = ends_at
|
631
|
+
@proration_behavior = proration_behavior
|
632
|
+
@set_pause_collection = set_pause_collection
|
633
|
+
@set_schedule_end = set_schedule_end
|
634
|
+
@starts_at = starts_at
|
635
|
+
@trial_settings = trial_settings
|
636
|
+
end
|
637
|
+
end
|
638
|
+
|
123
639
|
class LineItem < Stripe::RequestParams
|
124
640
|
class Discount < Stripe::RequestParams
|
641
|
+
class DiscountEnd < Stripe::RequestParams
|
642
|
+
class Duration < Stripe::RequestParams
|
643
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
644
|
+
attr_accessor :interval
|
645
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
646
|
+
attr_accessor :interval_count
|
647
|
+
|
648
|
+
def initialize(interval: nil, interval_count: nil)
|
649
|
+
@interval = interval
|
650
|
+
@interval_count = interval_count
|
651
|
+
end
|
652
|
+
end
|
653
|
+
# Time span for the redeemed discount.
|
654
|
+
attr_accessor :duration
|
655
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
656
|
+
attr_accessor :timestamp
|
657
|
+
# The type of calculation made to determine when the discount ends.
|
658
|
+
attr_accessor :type
|
659
|
+
|
660
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
661
|
+
@duration = duration
|
662
|
+
@timestamp = timestamp
|
663
|
+
@type = type
|
664
|
+
end
|
665
|
+
end
|
125
666
|
# ID of the coupon to create a new discount for.
|
126
667
|
attr_accessor :coupon
|
127
668
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
128
669
|
attr_accessor :discount
|
670
|
+
# Details to determine how long the discount should be applied for.
|
671
|
+
attr_accessor :discount_end
|
129
672
|
# ID of the promotion code to create a new discount for.
|
130
673
|
attr_accessor :promotion_code
|
131
674
|
|
132
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
675
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
133
676
|
@coupon = coupon
|
134
677
|
@discount = discount
|
678
|
+
@discount_end = discount_end
|
135
679
|
@promotion_code = promotion_code
|
136
680
|
end
|
137
681
|
end
|
@@ -198,23 +742,285 @@ module Stripe
|
|
198
742
|
end
|
199
743
|
|
200
744
|
class SubscriptionData < Stripe::RequestParams
|
745
|
+
class BillOnAcceptance < Stripe::RequestParams
|
746
|
+
class BillFrom < Stripe::RequestParams
|
747
|
+
class LineStartsAt < Stripe::RequestParams
|
748
|
+
# The ID of a quote line.
|
749
|
+
attr_accessor :id
|
750
|
+
# The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
|
751
|
+
attr_accessor :index
|
752
|
+
|
753
|
+
def initialize(id: nil, index: nil)
|
754
|
+
@id = id
|
755
|
+
@index = index
|
756
|
+
end
|
757
|
+
end
|
758
|
+
# Details of a Quote line to start the bill period from.
|
759
|
+
attr_accessor :line_starts_at
|
760
|
+
# A precise Unix timestamp.
|
761
|
+
attr_accessor :timestamp
|
762
|
+
# The type of method to specify the `bill_from` time.
|
763
|
+
attr_accessor :type
|
764
|
+
|
765
|
+
def initialize(line_starts_at: nil, timestamp: nil, type: nil)
|
766
|
+
@line_starts_at = line_starts_at
|
767
|
+
@timestamp = timestamp
|
768
|
+
@type = type
|
769
|
+
end
|
770
|
+
end
|
771
|
+
|
772
|
+
class BillUntil < Stripe::RequestParams
|
773
|
+
class Duration < Stripe::RequestParams
|
774
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
775
|
+
attr_accessor :interval
|
776
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
777
|
+
attr_accessor :interval_count
|
778
|
+
|
779
|
+
def initialize(interval: nil, interval_count: nil)
|
780
|
+
@interval = interval
|
781
|
+
@interval_count = interval_count
|
782
|
+
end
|
783
|
+
end
|
784
|
+
|
785
|
+
class LineEndsAt < Stripe::RequestParams
|
786
|
+
# The ID of a quote line.
|
787
|
+
attr_accessor :id
|
788
|
+
# The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
|
789
|
+
attr_accessor :index
|
790
|
+
|
791
|
+
def initialize(id: nil, index: nil)
|
792
|
+
@id = id
|
793
|
+
@index = index
|
794
|
+
end
|
795
|
+
end
|
796
|
+
# Details of the duration over which to bill.
|
797
|
+
attr_accessor :duration
|
798
|
+
# Details of a Quote line item from which to bill until.
|
799
|
+
attr_accessor :line_ends_at
|
800
|
+
# A precise Unix timestamp.
|
801
|
+
attr_accessor :timestamp
|
802
|
+
# The type of method to specify the `bill_until` time.
|
803
|
+
attr_accessor :type
|
804
|
+
|
805
|
+
def initialize(duration: nil, line_ends_at: nil, timestamp: nil, type: nil)
|
806
|
+
@duration = duration
|
807
|
+
@line_ends_at = line_ends_at
|
808
|
+
@timestamp = timestamp
|
809
|
+
@type = type
|
810
|
+
end
|
811
|
+
end
|
812
|
+
# The start of the period to bill from when the Quote is accepted.
|
813
|
+
attr_accessor :bill_from
|
814
|
+
# The end of the period to bill until when the Quote is accepted.
|
815
|
+
attr_accessor :bill_until
|
816
|
+
|
817
|
+
def initialize(bill_from: nil, bill_until: nil)
|
818
|
+
@bill_from = bill_from
|
819
|
+
@bill_until = bill_until
|
820
|
+
end
|
821
|
+
end
|
822
|
+
|
823
|
+
class Prebilling < Stripe::RequestParams
|
824
|
+
# This is used to determine the number of billing cycles to prebill.
|
825
|
+
attr_accessor :iterations
|
826
|
+
|
827
|
+
def initialize(iterations: nil)
|
828
|
+
@iterations = iterations
|
829
|
+
end
|
830
|
+
end
|
831
|
+
# Describes the period to bill for upon accepting the quote.
|
832
|
+
attr_accessor :bill_on_acceptance
|
833
|
+
# 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.
|
834
|
+
attr_accessor :billing_behavior
|
835
|
+
# When specified as `reset`, the subscription will always start a new billing period when the quote is accepted.
|
836
|
+
attr_accessor :billing_cycle_anchor
|
837
|
+
# Configure billing_mode to opt in improved credit proration behavior.Once a quote that creates a subscription or subscription schedule is accepted,all future operations on the subscription or subscription schedule will be processed based on this billing_mode.
|
838
|
+
attr_accessor :billing_mode
|
201
839
|
# The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
|
202
840
|
attr_accessor :description
|
203
841
|
# When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted.
|
204
842
|
attr_accessor :effective_date
|
843
|
+
# Behavior of the subscription schedule and underlying subscription when it ends.
|
844
|
+
attr_accessor :end_behavior
|
845
|
+
# The id of a subscription that the quote will update. By default, the quote will contain the state of the subscription (such as line items, collection method and billing thresholds) unless overridden.
|
846
|
+
attr_accessor :from_subscription
|
205
847
|
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
|
206
848
|
attr_accessor :metadata
|
849
|
+
# If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`.
|
850
|
+
attr_accessor :prebilling
|
851
|
+
# Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
|
852
|
+
#
|
853
|
+
# When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
|
854
|
+
#
|
855
|
+
# Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
|
856
|
+
#
|
857
|
+
# Prorations can be disabled by passing `none`.
|
858
|
+
attr_accessor :proration_behavior
|
207
859
|
# Integer representing the number of trial period days before the customer is charged for the first time.
|
208
860
|
attr_accessor :trial_period_days
|
209
861
|
|
210
|
-
def initialize(
|
862
|
+
def initialize(
|
863
|
+
bill_on_acceptance: nil,
|
864
|
+
billing_behavior: nil,
|
865
|
+
billing_cycle_anchor: nil,
|
866
|
+
billing_mode: nil,
|
867
|
+
description: nil,
|
868
|
+
effective_date: nil,
|
869
|
+
end_behavior: nil,
|
870
|
+
from_subscription: nil,
|
871
|
+
metadata: nil,
|
872
|
+
prebilling: nil,
|
873
|
+
proration_behavior: nil,
|
874
|
+
trial_period_days: nil
|
875
|
+
)
|
876
|
+
@bill_on_acceptance = bill_on_acceptance
|
877
|
+
@billing_behavior = billing_behavior
|
878
|
+
@billing_cycle_anchor = billing_cycle_anchor
|
879
|
+
@billing_mode = billing_mode
|
211
880
|
@description = description
|
212
881
|
@effective_date = effective_date
|
882
|
+
@end_behavior = end_behavior
|
883
|
+
@from_subscription = from_subscription
|
213
884
|
@metadata = metadata
|
885
|
+
@prebilling = prebilling
|
886
|
+
@proration_behavior = proration_behavior
|
214
887
|
@trial_period_days = trial_period_days
|
215
888
|
end
|
216
889
|
end
|
217
890
|
|
891
|
+
class SubscriptionDataOverride < Stripe::RequestParams
|
892
|
+
class AppliesTo < Stripe::RequestParams
|
893
|
+
# A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
|
894
|
+
attr_accessor :new_reference
|
895
|
+
# The ID of the schedule the line applies to.
|
896
|
+
attr_accessor :subscription_schedule
|
897
|
+
# Describes whether the quote line is affecting a new schedule or an existing schedule.
|
898
|
+
attr_accessor :type
|
899
|
+
|
900
|
+
def initialize(new_reference: nil, subscription_schedule: nil, type: nil)
|
901
|
+
@new_reference = new_reference
|
902
|
+
@subscription_schedule = subscription_schedule
|
903
|
+
@type = type
|
904
|
+
end
|
905
|
+
end
|
906
|
+
|
907
|
+
class BillOnAcceptance < Stripe::RequestParams
|
908
|
+
class BillFrom < Stripe::RequestParams
|
909
|
+
class LineStartsAt < Stripe::RequestParams
|
910
|
+
# The ID of a quote line.
|
911
|
+
attr_accessor :id
|
912
|
+
# The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
|
913
|
+
attr_accessor :index
|
914
|
+
|
915
|
+
def initialize(id: nil, index: nil)
|
916
|
+
@id = id
|
917
|
+
@index = index
|
918
|
+
end
|
919
|
+
end
|
920
|
+
# Details of a Quote line to start the bill period from.
|
921
|
+
attr_accessor :line_starts_at
|
922
|
+
# A precise Unix timestamp.
|
923
|
+
attr_accessor :timestamp
|
924
|
+
# The type of method to specify the `bill_from` time.
|
925
|
+
attr_accessor :type
|
926
|
+
|
927
|
+
def initialize(line_starts_at: nil, timestamp: nil, type: nil)
|
928
|
+
@line_starts_at = line_starts_at
|
929
|
+
@timestamp = timestamp
|
930
|
+
@type = type
|
931
|
+
end
|
932
|
+
end
|
933
|
+
|
934
|
+
class BillUntil < Stripe::RequestParams
|
935
|
+
class Duration < Stripe::RequestParams
|
936
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
937
|
+
attr_accessor :interval
|
938
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
939
|
+
attr_accessor :interval_count
|
940
|
+
|
941
|
+
def initialize(interval: nil, interval_count: nil)
|
942
|
+
@interval = interval
|
943
|
+
@interval_count = interval_count
|
944
|
+
end
|
945
|
+
end
|
946
|
+
|
947
|
+
class LineEndsAt < Stripe::RequestParams
|
948
|
+
# The ID of a quote line.
|
949
|
+
attr_accessor :id
|
950
|
+
# The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
|
951
|
+
attr_accessor :index
|
952
|
+
|
953
|
+
def initialize(id: nil, index: nil)
|
954
|
+
@id = id
|
955
|
+
@index = index
|
956
|
+
end
|
957
|
+
end
|
958
|
+
# Details of the duration over which to bill.
|
959
|
+
attr_accessor :duration
|
960
|
+
# Details of a Quote line item from which to bill until.
|
961
|
+
attr_accessor :line_ends_at
|
962
|
+
# A precise Unix timestamp.
|
963
|
+
attr_accessor :timestamp
|
964
|
+
# The type of method to specify the `bill_until` time.
|
965
|
+
attr_accessor :type
|
966
|
+
|
967
|
+
def initialize(duration: nil, line_ends_at: nil, timestamp: nil, type: nil)
|
968
|
+
@duration = duration
|
969
|
+
@line_ends_at = line_ends_at
|
970
|
+
@timestamp = timestamp
|
971
|
+
@type = type
|
972
|
+
end
|
973
|
+
end
|
974
|
+
# The start of the period to bill from when the Quote is accepted.
|
975
|
+
attr_accessor :bill_from
|
976
|
+
# The end of the period to bill until when the Quote is accepted.
|
977
|
+
attr_accessor :bill_until
|
978
|
+
|
979
|
+
def initialize(bill_from: nil, bill_until: nil)
|
980
|
+
@bill_from = bill_from
|
981
|
+
@bill_until = bill_until
|
982
|
+
end
|
983
|
+
end
|
984
|
+
# Whether the override applies to an existing Subscription Schedule or a new Subscription Schedule.
|
985
|
+
attr_accessor :applies_to
|
986
|
+
# Describes the period to bill for upon accepting the quote.
|
987
|
+
attr_accessor :bill_on_acceptance
|
988
|
+
# 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.
|
989
|
+
attr_accessor :billing_behavior
|
990
|
+
# The customer the Subscription Data override applies to. This is only relevant when `applies_to.type=new_reference`.
|
991
|
+
attr_accessor :customer
|
992
|
+
# The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
|
993
|
+
attr_accessor :description
|
994
|
+
# Behavior of the subscription schedule and underlying subscription when it ends.
|
995
|
+
attr_accessor :end_behavior
|
996
|
+
# Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
|
997
|
+
#
|
998
|
+
# When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
|
999
|
+
#
|
1000
|
+
# Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
|
1001
|
+
#
|
1002
|
+
# Prorations can be disabled by passing `none`.
|
1003
|
+
attr_accessor :proration_behavior
|
1004
|
+
|
1005
|
+
def initialize(
|
1006
|
+
applies_to: nil,
|
1007
|
+
bill_on_acceptance: nil,
|
1008
|
+
billing_behavior: nil,
|
1009
|
+
customer: nil,
|
1010
|
+
description: nil,
|
1011
|
+
end_behavior: nil,
|
1012
|
+
proration_behavior: nil
|
1013
|
+
)
|
1014
|
+
@applies_to = applies_to
|
1015
|
+
@bill_on_acceptance = bill_on_acceptance
|
1016
|
+
@billing_behavior = billing_behavior
|
1017
|
+
@customer = customer
|
1018
|
+
@description = description
|
1019
|
+
@end_behavior = end_behavior
|
1020
|
+
@proration_behavior = proration_behavior
|
1021
|
+
end
|
1022
|
+
end
|
1023
|
+
|
218
1024
|
class TransferData < Stripe::RequestParams
|
219
1025
|
# The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field.
|
220
1026
|
attr_accessor :amount
|
@@ -229,6 +1035,8 @@ module Stripe
|
|
229
1035
|
@destination = destination
|
230
1036
|
end
|
231
1037
|
end
|
1038
|
+
# Set to true to allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now.
|
1039
|
+
attr_accessor :allow_backdated_lines
|
232
1040
|
# The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field.
|
233
1041
|
attr_accessor :application_fee_amount
|
234
1042
|
# 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. There must be at least 1 line item with a recurring price to use this field.
|
@@ -239,6 +1047,8 @@ module Stripe
|
|
239
1047
|
attr_accessor :collection_method
|
240
1048
|
# The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
|
241
1049
|
attr_accessor :customer
|
1050
|
+
# The account for which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed.
|
1051
|
+
attr_accessor :customer_account
|
242
1052
|
# The tax rates that will apply to any line item that does not have `tax_rates` set.
|
243
1053
|
attr_accessor :default_tax_rates
|
244
1054
|
# A description that will be displayed on the quote PDF. If no value is passed, the default description configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used.
|
@@ -259,23 +1069,29 @@ module Stripe
|
|
259
1069
|
attr_accessor :invoice_settings
|
260
1070
|
# A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost.
|
261
1071
|
attr_accessor :line_items
|
1072
|
+
# A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
|
1073
|
+
attr_accessor :lines
|
262
1074
|
# 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`.
|
263
1075
|
attr_accessor :metadata
|
264
1076
|
# The account on behalf of which to charge.
|
265
1077
|
attr_accessor :on_behalf_of
|
266
1078
|
# When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created.
|
267
1079
|
attr_accessor :subscription_data
|
1080
|
+
# List representing overrides for `subscription_data` configurations for specific subscription schedules.
|
1081
|
+
attr_accessor :subscription_data_overrides
|
268
1082
|
# ID of the test clock to attach to the quote.
|
269
1083
|
attr_accessor :test_clock
|
270
1084
|
# The data with which to automatically create a Transfer for each of the invoices.
|
271
1085
|
attr_accessor :transfer_data
|
272
1086
|
|
273
1087
|
def initialize(
|
1088
|
+
allow_backdated_lines: nil,
|
274
1089
|
application_fee_amount: nil,
|
275
1090
|
application_fee_percent: nil,
|
276
1091
|
automatic_tax: nil,
|
277
1092
|
collection_method: nil,
|
278
1093
|
customer: nil,
|
1094
|
+
customer_account: nil,
|
279
1095
|
default_tax_rates: nil,
|
280
1096
|
description: nil,
|
281
1097
|
discounts: nil,
|
@@ -286,17 +1102,21 @@ module Stripe
|
|
286
1102
|
header: nil,
|
287
1103
|
invoice_settings: nil,
|
288
1104
|
line_items: nil,
|
1105
|
+
lines: nil,
|
289
1106
|
metadata: nil,
|
290
1107
|
on_behalf_of: nil,
|
291
1108
|
subscription_data: nil,
|
1109
|
+
subscription_data_overrides: nil,
|
292
1110
|
test_clock: nil,
|
293
1111
|
transfer_data: nil
|
294
1112
|
)
|
1113
|
+
@allow_backdated_lines = allow_backdated_lines
|
295
1114
|
@application_fee_amount = application_fee_amount
|
296
1115
|
@application_fee_percent = application_fee_percent
|
297
1116
|
@automatic_tax = automatic_tax
|
298
1117
|
@collection_method = collection_method
|
299
1118
|
@customer = customer
|
1119
|
+
@customer_account = customer_account
|
300
1120
|
@default_tax_rates = default_tax_rates
|
301
1121
|
@description = description
|
302
1122
|
@discounts = discounts
|
@@ -307,9 +1127,11 @@ module Stripe
|
|
307
1127
|
@header = header
|
308
1128
|
@invoice_settings = invoice_settings
|
309
1129
|
@line_items = line_items
|
1130
|
+
@lines = lines
|
310
1131
|
@metadata = metadata
|
311
1132
|
@on_behalf_of = on_behalf_of
|
312
1133
|
@subscription_data = subscription_data
|
1134
|
+
@subscription_data_overrides = subscription_data_overrides
|
313
1135
|
@test_clock = test_clock
|
314
1136
|
@transfer_data = transfer_data
|
315
1137
|
end
|
@@ -349,16 +1171,44 @@ module Stripe
|
|
349
1171
|
end
|
350
1172
|
|
351
1173
|
class Discount < Stripe::RequestParams
|
1174
|
+
class DiscountEnd < Stripe::RequestParams
|
1175
|
+
class Duration < Stripe::RequestParams
|
1176
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1177
|
+
attr_accessor :interval
|
1178
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1179
|
+
attr_accessor :interval_count
|
1180
|
+
|
1181
|
+
def initialize(interval: nil, interval_count: nil)
|
1182
|
+
@interval = interval
|
1183
|
+
@interval_count = interval_count
|
1184
|
+
end
|
1185
|
+
end
|
1186
|
+
# Time span for the redeemed discount.
|
1187
|
+
attr_accessor :duration
|
1188
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1189
|
+
attr_accessor :timestamp
|
1190
|
+
# The type of calculation made to determine when the discount ends.
|
1191
|
+
attr_accessor :type
|
1192
|
+
|
1193
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
1194
|
+
@duration = duration
|
1195
|
+
@timestamp = timestamp
|
1196
|
+
@type = type
|
1197
|
+
end
|
1198
|
+
end
|
352
1199
|
# ID of the coupon to create a new discount for.
|
353
1200
|
attr_accessor :coupon
|
354
1201
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
355
1202
|
attr_accessor :discount
|
1203
|
+
# Details to determine how long the discount should be applied for.
|
1204
|
+
attr_accessor :discount_end
|
356
1205
|
# ID of the promotion code to create a new discount for.
|
357
1206
|
attr_accessor :promotion_code
|
358
1207
|
|
359
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1208
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
360
1209
|
@coupon = coupon
|
361
1210
|
@discount = discount
|
1211
|
+
@discount_end = discount_end
|
362
1212
|
@promotion_code = promotion_code
|
363
1213
|
end
|
364
1214
|
end
|
@@ -386,18 +1236,529 @@ module Stripe
|
|
386
1236
|
end
|
387
1237
|
end
|
388
1238
|
|
1239
|
+
class Line < Stripe::RequestParams
|
1240
|
+
class Action < Stripe::RequestParams
|
1241
|
+
class AddDiscount < Stripe::RequestParams
|
1242
|
+
class DiscountEnd < Stripe::RequestParams
|
1243
|
+
# The type of calculation made to determine when the discount ends.
|
1244
|
+
attr_accessor :type
|
1245
|
+
|
1246
|
+
def initialize(type: nil)
|
1247
|
+
@type = type
|
1248
|
+
end
|
1249
|
+
end
|
1250
|
+
# The coupon code to redeem.
|
1251
|
+
attr_accessor :coupon
|
1252
|
+
# An ID of an existing discount for a coupon that was already redeemed.
|
1253
|
+
attr_accessor :discount
|
1254
|
+
# Details to determine how long the discount should be applied for.
|
1255
|
+
attr_accessor :discount_end
|
1256
|
+
# 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.
|
1257
|
+
attr_accessor :index
|
1258
|
+
# The promotion code to redeem.
|
1259
|
+
attr_accessor :promotion_code
|
1260
|
+
|
1261
|
+
def initialize(
|
1262
|
+
coupon: nil,
|
1263
|
+
discount: nil,
|
1264
|
+
discount_end: nil,
|
1265
|
+
index: nil,
|
1266
|
+
promotion_code: nil
|
1267
|
+
)
|
1268
|
+
@coupon = coupon
|
1269
|
+
@discount = discount
|
1270
|
+
@discount_end = discount_end
|
1271
|
+
@index = index
|
1272
|
+
@promotion_code = promotion_code
|
1273
|
+
end
|
1274
|
+
end
|
1275
|
+
|
1276
|
+
class AddItem < Stripe::RequestParams
|
1277
|
+
class Discount < Stripe::RequestParams
|
1278
|
+
class DiscountEnd < Stripe::RequestParams
|
1279
|
+
class Duration < Stripe::RequestParams
|
1280
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1281
|
+
attr_accessor :interval
|
1282
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1283
|
+
attr_accessor :interval_count
|
1284
|
+
|
1285
|
+
def initialize(interval: nil, interval_count: nil)
|
1286
|
+
@interval = interval
|
1287
|
+
@interval_count = interval_count
|
1288
|
+
end
|
1289
|
+
end
|
1290
|
+
# Time span for the redeemed discount.
|
1291
|
+
attr_accessor :duration
|
1292
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1293
|
+
attr_accessor :timestamp
|
1294
|
+
# The type of calculation made to determine when the discount ends.
|
1295
|
+
attr_accessor :type
|
1296
|
+
|
1297
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
1298
|
+
@duration = duration
|
1299
|
+
@timestamp = timestamp
|
1300
|
+
@type = type
|
1301
|
+
end
|
1302
|
+
end
|
1303
|
+
# ID of the coupon to create a new discount for.
|
1304
|
+
attr_accessor :coupon
|
1305
|
+
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
1306
|
+
attr_accessor :discount
|
1307
|
+
# Details to determine how long the discount should be applied for.
|
1308
|
+
attr_accessor :discount_end
|
1309
|
+
# ID of the promotion code to create a new discount for.
|
1310
|
+
attr_accessor :promotion_code
|
1311
|
+
|
1312
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
1313
|
+
@coupon = coupon
|
1314
|
+
@discount = discount
|
1315
|
+
@discount_end = discount_end
|
1316
|
+
@promotion_code = promotion_code
|
1317
|
+
end
|
1318
|
+
end
|
1319
|
+
|
1320
|
+
class Trial < Stripe::RequestParams
|
1321
|
+
# 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.
|
1322
|
+
attr_accessor :converts_to
|
1323
|
+
# Determines the type of trial for this item.
|
1324
|
+
attr_accessor :type
|
1325
|
+
|
1326
|
+
def initialize(converts_to: nil, type: nil)
|
1327
|
+
@converts_to = converts_to
|
1328
|
+
@type = type
|
1329
|
+
end
|
1330
|
+
end
|
1331
|
+
# The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
|
1332
|
+
attr_accessor :discounts
|
1333
|
+
# 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`.
|
1334
|
+
attr_accessor :metadata
|
1335
|
+
# The ID of the price object.
|
1336
|
+
attr_accessor :price
|
1337
|
+
# Quantity for this item.
|
1338
|
+
attr_accessor :quantity
|
1339
|
+
# 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`.
|
1340
|
+
attr_accessor :tax_rates
|
1341
|
+
# Options that configure the trial on the subscription item.
|
1342
|
+
attr_accessor :trial
|
1343
|
+
|
1344
|
+
def initialize(
|
1345
|
+
discounts: nil,
|
1346
|
+
metadata: nil,
|
1347
|
+
price: nil,
|
1348
|
+
quantity: nil,
|
1349
|
+
tax_rates: nil,
|
1350
|
+
trial: nil
|
1351
|
+
)
|
1352
|
+
@discounts = discounts
|
1353
|
+
@metadata = metadata
|
1354
|
+
@price = price
|
1355
|
+
@quantity = quantity
|
1356
|
+
@tax_rates = tax_rates
|
1357
|
+
@trial = trial
|
1358
|
+
end
|
1359
|
+
end
|
1360
|
+
|
1361
|
+
class RemoveDiscount < Stripe::RequestParams
|
1362
|
+
# The coupon code to remove from the `discounts` array.
|
1363
|
+
attr_accessor :coupon
|
1364
|
+
# The ID of a discount to remove from the `discounts` array.
|
1365
|
+
attr_accessor :discount
|
1366
|
+
# The ID of a promotion code to remove from the `discounts` array.
|
1367
|
+
attr_accessor :promotion_code
|
1368
|
+
|
1369
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1370
|
+
@coupon = coupon
|
1371
|
+
@discount = discount
|
1372
|
+
@promotion_code = promotion_code
|
1373
|
+
end
|
1374
|
+
end
|
1375
|
+
|
1376
|
+
class RemoveItem < Stripe::RequestParams
|
1377
|
+
# ID of a price to remove.
|
1378
|
+
attr_accessor :price
|
1379
|
+
|
1380
|
+
def initialize(price: nil)
|
1381
|
+
@price = price
|
1382
|
+
end
|
1383
|
+
end
|
1384
|
+
|
1385
|
+
class SetDiscount < Stripe::RequestParams
|
1386
|
+
# The coupon code to replace the `discounts` array with.
|
1387
|
+
attr_accessor :coupon
|
1388
|
+
# An ID of an existing discount to replace the `discounts` array with.
|
1389
|
+
attr_accessor :discount
|
1390
|
+
# An ID of an existing promotion code to replace the `discounts` array with.
|
1391
|
+
attr_accessor :promotion_code
|
1392
|
+
|
1393
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1394
|
+
@coupon = coupon
|
1395
|
+
@discount = discount
|
1396
|
+
@promotion_code = promotion_code
|
1397
|
+
end
|
1398
|
+
end
|
1399
|
+
|
1400
|
+
class SetItem < Stripe::RequestParams
|
1401
|
+
class Discount < Stripe::RequestParams
|
1402
|
+
class DiscountEnd < Stripe::RequestParams
|
1403
|
+
class Duration < Stripe::RequestParams
|
1404
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1405
|
+
attr_accessor :interval
|
1406
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1407
|
+
attr_accessor :interval_count
|
1408
|
+
|
1409
|
+
def initialize(interval: nil, interval_count: nil)
|
1410
|
+
@interval = interval
|
1411
|
+
@interval_count = interval_count
|
1412
|
+
end
|
1413
|
+
end
|
1414
|
+
# Time span for the redeemed discount.
|
1415
|
+
attr_accessor :duration
|
1416
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1417
|
+
attr_accessor :timestamp
|
1418
|
+
# The type of calculation made to determine when the discount ends.
|
1419
|
+
attr_accessor :type
|
1420
|
+
|
1421
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
1422
|
+
@duration = duration
|
1423
|
+
@timestamp = timestamp
|
1424
|
+
@type = type
|
1425
|
+
end
|
1426
|
+
end
|
1427
|
+
# ID of the coupon to create a new discount for.
|
1428
|
+
attr_accessor :coupon
|
1429
|
+
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
1430
|
+
attr_accessor :discount
|
1431
|
+
# Details to determine how long the discount should be applied for.
|
1432
|
+
attr_accessor :discount_end
|
1433
|
+
# ID of the promotion code to create a new discount for.
|
1434
|
+
attr_accessor :promotion_code
|
1435
|
+
|
1436
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
1437
|
+
@coupon = coupon
|
1438
|
+
@discount = discount
|
1439
|
+
@discount_end = discount_end
|
1440
|
+
@promotion_code = promotion_code
|
1441
|
+
end
|
1442
|
+
end
|
1443
|
+
|
1444
|
+
class Trial < Stripe::RequestParams
|
1445
|
+
# 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.
|
1446
|
+
attr_accessor :converts_to
|
1447
|
+
# Determines the type of trial for this item.
|
1448
|
+
attr_accessor :type
|
1449
|
+
|
1450
|
+
def initialize(converts_to: nil, type: nil)
|
1451
|
+
@converts_to = converts_to
|
1452
|
+
@type = type
|
1453
|
+
end
|
1454
|
+
end
|
1455
|
+
# 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`.
|
1456
|
+
attr_accessor :discounts
|
1457
|
+
# 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`.
|
1458
|
+
attr_accessor :metadata
|
1459
|
+
# The ID of the price object.
|
1460
|
+
attr_accessor :price
|
1461
|
+
# 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`.
|
1462
|
+
attr_accessor :quantity
|
1463
|
+
# 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`.
|
1464
|
+
attr_accessor :tax_rates
|
1465
|
+
# 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`.
|
1466
|
+
attr_accessor :trial
|
1467
|
+
|
1468
|
+
def initialize(
|
1469
|
+
discounts: nil,
|
1470
|
+
metadata: nil,
|
1471
|
+
price: nil,
|
1472
|
+
quantity: nil,
|
1473
|
+
tax_rates: nil,
|
1474
|
+
trial: nil
|
1475
|
+
)
|
1476
|
+
@discounts = discounts
|
1477
|
+
@metadata = metadata
|
1478
|
+
@price = price
|
1479
|
+
@quantity = quantity
|
1480
|
+
@tax_rates = tax_rates
|
1481
|
+
@trial = trial
|
1482
|
+
end
|
1483
|
+
end
|
1484
|
+
# Details for the `add_discount` type.
|
1485
|
+
attr_accessor :add_discount
|
1486
|
+
# Details for the `add_item` type.
|
1487
|
+
attr_accessor :add_item
|
1488
|
+
# Details for the `add_metadata` type: specify a hash of key-value pairs.
|
1489
|
+
attr_accessor :add_metadata
|
1490
|
+
# Details for the `remove_discount` type.
|
1491
|
+
attr_accessor :remove_discount
|
1492
|
+
# Details for the `remove_item` type.
|
1493
|
+
attr_accessor :remove_item
|
1494
|
+
# Details for the `remove_metadata` type: specify an array of metadata keys.
|
1495
|
+
attr_accessor :remove_metadata
|
1496
|
+
# Details for the `set_discounts` type.
|
1497
|
+
attr_accessor :set_discounts
|
1498
|
+
# Details for the `set_items` type.
|
1499
|
+
attr_accessor :set_items
|
1500
|
+
# Details for the `set_metadata` type: specify an array of key-value pairs.
|
1501
|
+
attr_accessor :set_metadata
|
1502
|
+
# The type of action the quote line performs.
|
1503
|
+
attr_accessor :type
|
1504
|
+
|
1505
|
+
def initialize(
|
1506
|
+
add_discount: nil,
|
1507
|
+
add_item: nil,
|
1508
|
+
add_metadata: nil,
|
1509
|
+
remove_discount: nil,
|
1510
|
+
remove_item: nil,
|
1511
|
+
remove_metadata: nil,
|
1512
|
+
set_discounts: nil,
|
1513
|
+
set_items: nil,
|
1514
|
+
set_metadata: nil,
|
1515
|
+
type: nil
|
1516
|
+
)
|
1517
|
+
@add_discount = add_discount
|
1518
|
+
@add_item = add_item
|
1519
|
+
@add_metadata = add_metadata
|
1520
|
+
@remove_discount = remove_discount
|
1521
|
+
@remove_item = remove_item
|
1522
|
+
@remove_metadata = remove_metadata
|
1523
|
+
@set_discounts = set_discounts
|
1524
|
+
@set_items = set_items
|
1525
|
+
@set_metadata = set_metadata
|
1526
|
+
@type = type
|
1527
|
+
end
|
1528
|
+
end
|
1529
|
+
|
1530
|
+
class AppliesTo < Stripe::RequestParams
|
1531
|
+
# A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
|
1532
|
+
attr_accessor :new_reference
|
1533
|
+
# The ID of the schedule the line applies to.
|
1534
|
+
attr_accessor :subscription_schedule
|
1535
|
+
# Describes whether the quote line is affecting a new schedule or an existing schedule.
|
1536
|
+
attr_accessor :type
|
1537
|
+
|
1538
|
+
def initialize(new_reference: nil, subscription_schedule: nil, type: nil)
|
1539
|
+
@new_reference = new_reference
|
1540
|
+
@subscription_schedule = subscription_schedule
|
1541
|
+
@type = type
|
1542
|
+
end
|
1543
|
+
end
|
1544
|
+
|
1545
|
+
class CancelSubscriptionSchedule < Stripe::RequestParams
|
1546
|
+
# Timestamp helper to cancel the underlying schedule on the accompanying line's start date. Must be set to `line_starts_at`.
|
1547
|
+
attr_accessor :cancel_at
|
1548
|
+
# If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Boolean that defaults to `true`.
|
1549
|
+
attr_accessor :invoice_now
|
1550
|
+
# If the subscription schedule is `active`, indicates if the cancellation should be prorated. Boolean that defaults to `true`.
|
1551
|
+
attr_accessor :prorate
|
1552
|
+
|
1553
|
+
def initialize(cancel_at: nil, invoice_now: nil, prorate: nil)
|
1554
|
+
@cancel_at = cancel_at
|
1555
|
+
@invoice_now = invoice_now
|
1556
|
+
@prorate = prorate
|
1557
|
+
end
|
1558
|
+
end
|
1559
|
+
|
1560
|
+
class EndsAt < Stripe::RequestParams
|
1561
|
+
class DiscountEnd < Stripe::RequestParams
|
1562
|
+
# The ID of a specific discount.
|
1563
|
+
attr_accessor :discount
|
1564
|
+
|
1565
|
+
def initialize(discount: nil)
|
1566
|
+
@discount = discount
|
1567
|
+
end
|
1568
|
+
end
|
1569
|
+
|
1570
|
+
class Duration < Stripe::RequestParams
|
1571
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1572
|
+
attr_accessor :interval
|
1573
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1574
|
+
attr_accessor :interval_count
|
1575
|
+
|
1576
|
+
def initialize(interval: nil, interval_count: nil)
|
1577
|
+
@interval = interval
|
1578
|
+
@interval_count = interval_count
|
1579
|
+
end
|
1580
|
+
end
|
1581
|
+
# Use the `end` time of a given discount.
|
1582
|
+
attr_accessor :discount_end
|
1583
|
+
# Time span for the quote line starting from the `starts_at` date.
|
1584
|
+
attr_accessor :duration
|
1585
|
+
# A precise Unix timestamp.
|
1586
|
+
attr_accessor :timestamp
|
1587
|
+
# Select a way to pass in `ends_at`.
|
1588
|
+
attr_accessor :type
|
1589
|
+
|
1590
|
+
def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
|
1591
|
+
@discount_end = discount_end
|
1592
|
+
@duration = duration
|
1593
|
+
@timestamp = timestamp
|
1594
|
+
@type = type
|
1595
|
+
end
|
1596
|
+
end
|
1597
|
+
|
1598
|
+
class SetPauseCollection < Stripe::RequestParams
|
1599
|
+
class Set < Stripe::RequestParams
|
1600
|
+
# The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
1601
|
+
attr_accessor :behavior
|
1602
|
+
|
1603
|
+
def initialize(behavior: nil)
|
1604
|
+
@behavior = behavior
|
1605
|
+
end
|
1606
|
+
end
|
1607
|
+
# Details of the pause_collection behavior to apply to the amendment.
|
1608
|
+
attr_accessor :set
|
1609
|
+
# Determines the type of the pause_collection amendment.
|
1610
|
+
attr_accessor :type
|
1611
|
+
|
1612
|
+
def initialize(set: nil, type: nil)
|
1613
|
+
@set = set
|
1614
|
+
@type = type
|
1615
|
+
end
|
1616
|
+
end
|
1617
|
+
|
1618
|
+
class StartsAt < Stripe::RequestParams
|
1619
|
+
class DiscountEnd < Stripe::RequestParams
|
1620
|
+
# The ID of a specific discount.
|
1621
|
+
attr_accessor :discount
|
1622
|
+
|
1623
|
+
def initialize(discount: nil)
|
1624
|
+
@discount = discount
|
1625
|
+
end
|
1626
|
+
end
|
1627
|
+
|
1628
|
+
class LineEndsAt < Stripe::RequestParams
|
1629
|
+
# The ID of a quote line.
|
1630
|
+
attr_accessor :id
|
1631
|
+
# The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
|
1632
|
+
attr_accessor :index
|
1633
|
+
|
1634
|
+
def initialize(id: nil, index: nil)
|
1635
|
+
@id = id
|
1636
|
+
@index = index
|
1637
|
+
end
|
1638
|
+
end
|
1639
|
+
# Use the `end` time of a given discount.
|
1640
|
+
attr_accessor :discount_end
|
1641
|
+
# The timestamp the given line ends at.
|
1642
|
+
attr_accessor :line_ends_at
|
1643
|
+
# A precise Unix timestamp.
|
1644
|
+
attr_accessor :timestamp
|
1645
|
+
# Select a way to pass in `starts_at`.
|
1646
|
+
attr_accessor :type
|
1647
|
+
|
1648
|
+
def initialize(discount_end: nil, line_ends_at: nil, timestamp: nil, type: nil)
|
1649
|
+
@discount_end = discount_end
|
1650
|
+
@line_ends_at = line_ends_at
|
1651
|
+
@timestamp = timestamp
|
1652
|
+
@type = type
|
1653
|
+
end
|
1654
|
+
end
|
1655
|
+
|
1656
|
+
class TrialSettings < Stripe::RequestParams
|
1657
|
+
class EndBehavior < Stripe::RequestParams
|
1658
|
+
# Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
1659
|
+
attr_accessor :prorate_up_front
|
1660
|
+
|
1661
|
+
def initialize(prorate_up_front: nil)
|
1662
|
+
@prorate_up_front = prorate_up_front
|
1663
|
+
end
|
1664
|
+
end
|
1665
|
+
# Defines how the subscription should behave when a trial ends.
|
1666
|
+
attr_accessor :end_behavior
|
1667
|
+
|
1668
|
+
def initialize(end_behavior: nil)
|
1669
|
+
@end_behavior = end_behavior
|
1670
|
+
end
|
1671
|
+
end
|
1672
|
+
# An array of operations the quote line performs.
|
1673
|
+
attr_accessor :actions
|
1674
|
+
# Details to identify the subscription schedule the quote line applies to.
|
1675
|
+
attr_accessor :applies_to
|
1676
|
+
# For point-in-time quote lines (having no `ends_at` timestamp), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the Quote Line `starts_at` timestamp.For time-span based quote lines (having both `starts_at` and `ends_at`), the only valid value is `automatic`, which removes any previously configured billing cycle anchor resets during the window of time spanning the quote line.
|
1677
|
+
attr_accessor :billing_cycle_anchor
|
1678
|
+
# A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings.
|
1679
|
+
attr_accessor :cancel_subscription_schedule
|
1680
|
+
# Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line.
|
1681
|
+
attr_accessor :ends_at
|
1682
|
+
# The ID of an existing line on the quote.
|
1683
|
+
attr_accessor :id
|
1684
|
+
# Changes to how Stripe handles prorations during the quote line's time span. Affects if and how prorations are created when a future phase starts.
|
1685
|
+
attr_accessor :proration_behavior
|
1686
|
+
# Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
|
1687
|
+
attr_accessor :set_pause_collection
|
1688
|
+
# Timestamp helper to end the underlying schedule early, based on the acompanying line's start or end date.
|
1689
|
+
attr_accessor :set_schedule_end
|
1690
|
+
# Details to identify the earliest timestamp where the proposed change should take effect.
|
1691
|
+
attr_accessor :starts_at
|
1692
|
+
# Settings related to subscription trials.
|
1693
|
+
attr_accessor :trial_settings
|
1694
|
+
|
1695
|
+
def initialize(
|
1696
|
+
actions: nil,
|
1697
|
+
applies_to: nil,
|
1698
|
+
billing_cycle_anchor: nil,
|
1699
|
+
cancel_subscription_schedule: nil,
|
1700
|
+
ends_at: nil,
|
1701
|
+
id: nil,
|
1702
|
+
proration_behavior: nil,
|
1703
|
+
set_pause_collection: nil,
|
1704
|
+
set_schedule_end: nil,
|
1705
|
+
starts_at: nil,
|
1706
|
+
trial_settings: nil
|
1707
|
+
)
|
1708
|
+
@actions = actions
|
1709
|
+
@applies_to = applies_to
|
1710
|
+
@billing_cycle_anchor = billing_cycle_anchor
|
1711
|
+
@cancel_subscription_schedule = cancel_subscription_schedule
|
1712
|
+
@ends_at = ends_at
|
1713
|
+
@id = id
|
1714
|
+
@proration_behavior = proration_behavior
|
1715
|
+
@set_pause_collection = set_pause_collection
|
1716
|
+
@set_schedule_end = set_schedule_end
|
1717
|
+
@starts_at = starts_at
|
1718
|
+
@trial_settings = trial_settings
|
1719
|
+
end
|
1720
|
+
end
|
1721
|
+
|
389
1722
|
class LineItem < Stripe::RequestParams
|
390
1723
|
class Discount < Stripe::RequestParams
|
1724
|
+
class DiscountEnd < Stripe::RequestParams
|
1725
|
+
class Duration < Stripe::RequestParams
|
1726
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1727
|
+
attr_accessor :interval
|
1728
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1729
|
+
attr_accessor :interval_count
|
1730
|
+
|
1731
|
+
def initialize(interval: nil, interval_count: nil)
|
1732
|
+
@interval = interval
|
1733
|
+
@interval_count = interval_count
|
1734
|
+
end
|
1735
|
+
end
|
1736
|
+
# Time span for the redeemed discount.
|
1737
|
+
attr_accessor :duration
|
1738
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1739
|
+
attr_accessor :timestamp
|
1740
|
+
# The type of calculation made to determine when the discount ends.
|
1741
|
+
attr_accessor :type
|
1742
|
+
|
1743
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
1744
|
+
@duration = duration
|
1745
|
+
@timestamp = timestamp
|
1746
|
+
@type = type
|
1747
|
+
end
|
1748
|
+
end
|
391
1749
|
# ID of the coupon to create a new discount for.
|
392
1750
|
attr_accessor :coupon
|
393
1751
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
394
1752
|
attr_accessor :discount
|
1753
|
+
# Details to determine how long the discount should be applied for.
|
1754
|
+
attr_accessor :discount_end
|
395
1755
|
# ID of the promotion code to create a new discount for.
|
396
1756
|
attr_accessor :promotion_code
|
397
1757
|
|
398
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1758
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
399
1759
|
@coupon = coupon
|
400
1760
|
@discount = discount
|
1761
|
+
@discount_end = discount_end
|
401
1762
|
@promotion_code = promotion_code
|
402
1763
|
end
|
403
1764
|
end
|
@@ -474,23 +1835,277 @@ module Stripe
|
|
474
1835
|
end
|
475
1836
|
|
476
1837
|
class SubscriptionData < Stripe::RequestParams
|
1838
|
+
class BillOnAcceptance < Stripe::RequestParams
|
1839
|
+
class BillFrom < Stripe::RequestParams
|
1840
|
+
class LineStartsAt < Stripe::RequestParams
|
1841
|
+
# The ID of a quote line.
|
1842
|
+
attr_accessor :id
|
1843
|
+
# The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
|
1844
|
+
attr_accessor :index
|
1845
|
+
|
1846
|
+
def initialize(id: nil, index: nil)
|
1847
|
+
@id = id
|
1848
|
+
@index = index
|
1849
|
+
end
|
1850
|
+
end
|
1851
|
+
# Details of a Quote line to start the bill period from.
|
1852
|
+
attr_accessor :line_starts_at
|
1853
|
+
# A precise Unix timestamp.
|
1854
|
+
attr_accessor :timestamp
|
1855
|
+
# The type of method to specify the `bill_from` time.
|
1856
|
+
attr_accessor :type
|
1857
|
+
|
1858
|
+
def initialize(line_starts_at: nil, timestamp: nil, type: nil)
|
1859
|
+
@line_starts_at = line_starts_at
|
1860
|
+
@timestamp = timestamp
|
1861
|
+
@type = type
|
1862
|
+
end
|
1863
|
+
end
|
1864
|
+
|
1865
|
+
class BillUntil < Stripe::RequestParams
|
1866
|
+
class Duration < Stripe::RequestParams
|
1867
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1868
|
+
attr_accessor :interval
|
1869
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1870
|
+
attr_accessor :interval_count
|
1871
|
+
|
1872
|
+
def initialize(interval: nil, interval_count: nil)
|
1873
|
+
@interval = interval
|
1874
|
+
@interval_count = interval_count
|
1875
|
+
end
|
1876
|
+
end
|
1877
|
+
|
1878
|
+
class LineEndsAt < Stripe::RequestParams
|
1879
|
+
# The ID of a quote line.
|
1880
|
+
attr_accessor :id
|
1881
|
+
# The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
|
1882
|
+
attr_accessor :index
|
1883
|
+
|
1884
|
+
def initialize(id: nil, index: nil)
|
1885
|
+
@id = id
|
1886
|
+
@index = index
|
1887
|
+
end
|
1888
|
+
end
|
1889
|
+
# Details of the duration over which to bill.
|
1890
|
+
attr_accessor :duration
|
1891
|
+
# Details of a Quote line item from which to bill until.
|
1892
|
+
attr_accessor :line_ends_at
|
1893
|
+
# A precise Unix timestamp.
|
1894
|
+
attr_accessor :timestamp
|
1895
|
+
# The type of method to specify the `bill_until` time.
|
1896
|
+
attr_accessor :type
|
1897
|
+
|
1898
|
+
def initialize(duration: nil, line_ends_at: nil, timestamp: nil, type: nil)
|
1899
|
+
@duration = duration
|
1900
|
+
@line_ends_at = line_ends_at
|
1901
|
+
@timestamp = timestamp
|
1902
|
+
@type = type
|
1903
|
+
end
|
1904
|
+
end
|
1905
|
+
# The start of the period to bill from when the Quote is accepted.
|
1906
|
+
attr_accessor :bill_from
|
1907
|
+
# The end of the period to bill until when the Quote is accepted.
|
1908
|
+
attr_accessor :bill_until
|
1909
|
+
|
1910
|
+
def initialize(bill_from: nil, bill_until: nil)
|
1911
|
+
@bill_from = bill_from
|
1912
|
+
@bill_until = bill_until
|
1913
|
+
end
|
1914
|
+
end
|
1915
|
+
|
1916
|
+
class Prebilling < Stripe::RequestParams
|
1917
|
+
# This is used to determine the number of billing cycles to prebill.
|
1918
|
+
attr_accessor :iterations
|
1919
|
+
|
1920
|
+
def initialize(iterations: nil)
|
1921
|
+
@iterations = iterations
|
1922
|
+
end
|
1923
|
+
end
|
1924
|
+
# Describes the period to bill for upon accepting the quote.
|
1925
|
+
attr_accessor :bill_on_acceptance
|
1926
|
+
# 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.
|
1927
|
+
attr_accessor :billing_behavior
|
1928
|
+
# When specified as `reset`, the subscription will always start a new billing period when the quote is accepted.
|
1929
|
+
attr_accessor :billing_cycle_anchor
|
477
1930
|
# The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
|
478
1931
|
attr_accessor :description
|
479
1932
|
# When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted.
|
480
1933
|
attr_accessor :effective_date
|
1934
|
+
# Behavior of the subscription schedule and underlying subscription when it ends.
|
1935
|
+
attr_accessor :end_behavior
|
481
1936
|
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
|
482
1937
|
attr_accessor :metadata
|
1938
|
+
# If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`.
|
1939
|
+
attr_accessor :prebilling
|
1940
|
+
# Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
|
1941
|
+
#
|
1942
|
+
# When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
|
1943
|
+
#
|
1944
|
+
# Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
|
1945
|
+
#
|
1946
|
+
# Prorations can be disabled by passing `none`.
|
1947
|
+
attr_accessor :proration_behavior
|
483
1948
|
# Integer representing the number of trial period days before the customer is charged for the first time.
|
484
1949
|
attr_accessor :trial_period_days
|
485
1950
|
|
486
|
-
def initialize(
|
1951
|
+
def initialize(
|
1952
|
+
bill_on_acceptance: nil,
|
1953
|
+
billing_behavior: nil,
|
1954
|
+
billing_cycle_anchor: nil,
|
1955
|
+
description: nil,
|
1956
|
+
effective_date: nil,
|
1957
|
+
end_behavior: nil,
|
1958
|
+
metadata: nil,
|
1959
|
+
prebilling: nil,
|
1960
|
+
proration_behavior: nil,
|
1961
|
+
trial_period_days: nil
|
1962
|
+
)
|
1963
|
+
@bill_on_acceptance = bill_on_acceptance
|
1964
|
+
@billing_behavior = billing_behavior
|
1965
|
+
@billing_cycle_anchor = billing_cycle_anchor
|
487
1966
|
@description = description
|
488
1967
|
@effective_date = effective_date
|
1968
|
+
@end_behavior = end_behavior
|
489
1969
|
@metadata = metadata
|
1970
|
+
@prebilling = prebilling
|
1971
|
+
@proration_behavior = proration_behavior
|
490
1972
|
@trial_period_days = trial_period_days
|
491
1973
|
end
|
492
1974
|
end
|
493
1975
|
|
1976
|
+
class SubscriptionDataOverride < Stripe::RequestParams
|
1977
|
+
class AppliesTo < Stripe::RequestParams
|
1978
|
+
# A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
|
1979
|
+
attr_accessor :new_reference
|
1980
|
+
# The ID of the schedule the line applies to.
|
1981
|
+
attr_accessor :subscription_schedule
|
1982
|
+
# Describes whether the quote line is affecting a new schedule or an existing schedule.
|
1983
|
+
attr_accessor :type
|
1984
|
+
|
1985
|
+
def initialize(new_reference: nil, subscription_schedule: nil, type: nil)
|
1986
|
+
@new_reference = new_reference
|
1987
|
+
@subscription_schedule = subscription_schedule
|
1988
|
+
@type = type
|
1989
|
+
end
|
1990
|
+
end
|
1991
|
+
|
1992
|
+
class BillOnAcceptance < Stripe::RequestParams
|
1993
|
+
class BillFrom < Stripe::RequestParams
|
1994
|
+
class LineStartsAt < Stripe::RequestParams
|
1995
|
+
# The ID of a quote line.
|
1996
|
+
attr_accessor :id
|
1997
|
+
# The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
|
1998
|
+
attr_accessor :index
|
1999
|
+
|
2000
|
+
def initialize(id: nil, index: nil)
|
2001
|
+
@id = id
|
2002
|
+
@index = index
|
2003
|
+
end
|
2004
|
+
end
|
2005
|
+
# Details of a Quote line to start the bill period from.
|
2006
|
+
attr_accessor :line_starts_at
|
2007
|
+
# A precise Unix timestamp.
|
2008
|
+
attr_accessor :timestamp
|
2009
|
+
# The type of method to specify the `bill_from` time.
|
2010
|
+
attr_accessor :type
|
2011
|
+
|
2012
|
+
def initialize(line_starts_at: nil, timestamp: nil, type: nil)
|
2013
|
+
@line_starts_at = line_starts_at
|
2014
|
+
@timestamp = timestamp
|
2015
|
+
@type = type
|
2016
|
+
end
|
2017
|
+
end
|
2018
|
+
|
2019
|
+
class BillUntil < Stripe::RequestParams
|
2020
|
+
class Duration < Stripe::RequestParams
|
2021
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
2022
|
+
attr_accessor :interval
|
2023
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
2024
|
+
attr_accessor :interval_count
|
2025
|
+
|
2026
|
+
def initialize(interval: nil, interval_count: nil)
|
2027
|
+
@interval = interval
|
2028
|
+
@interval_count = interval_count
|
2029
|
+
end
|
2030
|
+
end
|
2031
|
+
|
2032
|
+
class LineEndsAt < Stripe::RequestParams
|
2033
|
+
# The ID of a quote line.
|
2034
|
+
attr_accessor :id
|
2035
|
+
# The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
|
2036
|
+
attr_accessor :index
|
2037
|
+
|
2038
|
+
def initialize(id: nil, index: nil)
|
2039
|
+
@id = id
|
2040
|
+
@index = index
|
2041
|
+
end
|
2042
|
+
end
|
2043
|
+
# Details of the duration over which to bill.
|
2044
|
+
attr_accessor :duration
|
2045
|
+
# Details of a Quote line item from which to bill until.
|
2046
|
+
attr_accessor :line_ends_at
|
2047
|
+
# A precise Unix timestamp.
|
2048
|
+
attr_accessor :timestamp
|
2049
|
+
# The type of method to specify the `bill_until` time.
|
2050
|
+
attr_accessor :type
|
2051
|
+
|
2052
|
+
def initialize(duration: nil, line_ends_at: nil, timestamp: nil, type: nil)
|
2053
|
+
@duration = duration
|
2054
|
+
@line_ends_at = line_ends_at
|
2055
|
+
@timestamp = timestamp
|
2056
|
+
@type = type
|
2057
|
+
end
|
2058
|
+
end
|
2059
|
+
# The start of the period to bill from when the Quote is accepted.
|
2060
|
+
attr_accessor :bill_from
|
2061
|
+
# The end of the period to bill until when the Quote is accepted.
|
2062
|
+
attr_accessor :bill_until
|
2063
|
+
|
2064
|
+
def initialize(bill_from: nil, bill_until: nil)
|
2065
|
+
@bill_from = bill_from
|
2066
|
+
@bill_until = bill_until
|
2067
|
+
end
|
2068
|
+
end
|
2069
|
+
# Whether the override applies to an existing Subscription Schedule or a new Subscription Schedule.
|
2070
|
+
attr_accessor :applies_to
|
2071
|
+
# Describes the period to bill for upon accepting the quote.
|
2072
|
+
attr_accessor :bill_on_acceptance
|
2073
|
+
# 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.
|
2074
|
+
attr_accessor :billing_behavior
|
2075
|
+
# The customer the Subscription Data override applies to.
|
2076
|
+
attr_accessor :customer
|
2077
|
+
# The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
|
2078
|
+
attr_accessor :description
|
2079
|
+
# Behavior of the subscription schedule and underlying subscription when it ends.
|
2080
|
+
attr_accessor :end_behavior
|
2081
|
+
# Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
|
2082
|
+
#
|
2083
|
+
# When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
|
2084
|
+
#
|
2085
|
+
# Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
|
2086
|
+
#
|
2087
|
+
# Prorations can be disabled by passing `none`.
|
2088
|
+
attr_accessor :proration_behavior
|
2089
|
+
|
2090
|
+
def initialize(
|
2091
|
+
applies_to: nil,
|
2092
|
+
bill_on_acceptance: nil,
|
2093
|
+
billing_behavior: nil,
|
2094
|
+
customer: nil,
|
2095
|
+
description: nil,
|
2096
|
+
end_behavior: nil,
|
2097
|
+
proration_behavior: nil
|
2098
|
+
)
|
2099
|
+
@applies_to = applies_to
|
2100
|
+
@bill_on_acceptance = bill_on_acceptance
|
2101
|
+
@billing_behavior = billing_behavior
|
2102
|
+
@customer = customer
|
2103
|
+
@description = description
|
2104
|
+
@end_behavior = end_behavior
|
2105
|
+
@proration_behavior = proration_behavior
|
2106
|
+
end
|
2107
|
+
end
|
2108
|
+
|
494
2109
|
class TransferData < Stripe::RequestParams
|
495
2110
|
# The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field.
|
496
2111
|
attr_accessor :amount
|
@@ -505,6 +2120,8 @@ module Stripe
|
|
505
2120
|
@destination = destination
|
506
2121
|
end
|
507
2122
|
end
|
2123
|
+
# Set to true to allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now.
|
2124
|
+
attr_accessor :allow_backdated_lines
|
508
2125
|
# The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field.
|
509
2126
|
attr_accessor :application_fee_amount
|
510
2127
|
# 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. There must be at least 1 line item with a recurring price to use this field.
|
@@ -515,6 +2132,8 @@ module Stripe
|
|
515
2132
|
attr_accessor :collection_method
|
516
2133
|
# The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
|
517
2134
|
attr_accessor :customer
|
2135
|
+
# The account for which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed.
|
2136
|
+
attr_accessor :customer_account
|
518
2137
|
# The tax rates that will apply to any line item that does not have `tax_rates` set.
|
519
2138
|
attr_accessor :default_tax_rates
|
520
2139
|
# A description that will be displayed on the quote PDF.
|
@@ -533,21 +2152,27 @@ module Stripe
|
|
533
2152
|
attr_accessor :invoice_settings
|
534
2153
|
# A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost.
|
535
2154
|
attr_accessor :line_items
|
2155
|
+
# A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
|
2156
|
+
attr_accessor :lines
|
536
2157
|
# 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`.
|
537
2158
|
attr_accessor :metadata
|
538
2159
|
# The account on behalf of which to charge.
|
539
2160
|
attr_accessor :on_behalf_of
|
540
2161
|
# When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created.
|
541
2162
|
attr_accessor :subscription_data
|
2163
|
+
# List representing overrides for `subscription_data` configurations for specific subscription schedules.
|
2164
|
+
attr_accessor :subscription_data_overrides
|
542
2165
|
# The data with which to automatically create a Transfer for each of the invoices.
|
543
2166
|
attr_accessor :transfer_data
|
544
2167
|
|
545
2168
|
def initialize(
|
2169
|
+
allow_backdated_lines: nil,
|
546
2170
|
application_fee_amount: nil,
|
547
2171
|
application_fee_percent: nil,
|
548
2172
|
automatic_tax: nil,
|
549
2173
|
collection_method: nil,
|
550
2174
|
customer: nil,
|
2175
|
+
customer_account: nil,
|
551
2176
|
default_tax_rates: nil,
|
552
2177
|
description: nil,
|
553
2178
|
discounts: nil,
|
@@ -557,16 +2182,20 @@ module Stripe
|
|
557
2182
|
header: nil,
|
558
2183
|
invoice_settings: nil,
|
559
2184
|
line_items: nil,
|
2185
|
+
lines: nil,
|
560
2186
|
metadata: nil,
|
561
2187
|
on_behalf_of: nil,
|
562
2188
|
subscription_data: nil,
|
2189
|
+
subscription_data_overrides: nil,
|
563
2190
|
transfer_data: nil
|
564
2191
|
)
|
2192
|
+
@allow_backdated_lines = allow_backdated_lines
|
565
2193
|
@application_fee_amount = application_fee_amount
|
566
2194
|
@application_fee_percent = application_fee_percent
|
567
2195
|
@automatic_tax = automatic_tax
|
568
2196
|
@collection_method = collection_method
|
569
2197
|
@customer = customer
|
2198
|
+
@customer_account = customer_account
|
570
2199
|
@default_tax_rates = default_tax_rates
|
571
2200
|
@description = description
|
572
2201
|
@discounts = discounts
|
@@ -576,9 +2205,11 @@ module Stripe
|
|
576
2205
|
@header = header
|
577
2206
|
@invoice_settings = invoice_settings
|
578
2207
|
@line_items = line_items
|
2208
|
+
@lines = lines
|
579
2209
|
@metadata = metadata
|
580
2210
|
@on_behalf_of = on_behalf_of
|
581
2211
|
@subscription_data = subscription_data
|
2212
|
+
@subscription_data_overrides = subscription_data_overrides
|
582
2213
|
@transfer_data = transfer_data
|
583
2214
|
end
|
584
2215
|
end
|
@@ -613,6 +2244,36 @@ module Stripe
|
|
613
2244
|
end
|
614
2245
|
end
|
615
2246
|
|
2247
|
+
class MarkDraftParams < Stripe::RequestParams
|
2248
|
+
# Specifies which fields in the response should be expanded.
|
2249
|
+
attr_accessor :expand
|
2250
|
+
|
2251
|
+
def initialize(expand: nil)
|
2252
|
+
@expand = expand
|
2253
|
+
end
|
2254
|
+
end
|
2255
|
+
|
2256
|
+
class MarkStaleParams < Stripe::RequestParams
|
2257
|
+
# Specifies which fields in the response should be expanded.
|
2258
|
+
attr_accessor :expand
|
2259
|
+
# Reason the Quote is being marked stale.
|
2260
|
+
attr_accessor :reason
|
2261
|
+
|
2262
|
+
def initialize(expand: nil, reason: nil)
|
2263
|
+
@expand = expand
|
2264
|
+
@reason = reason
|
2265
|
+
end
|
2266
|
+
end
|
2267
|
+
|
2268
|
+
class ReestimateParams < Stripe::RequestParams
|
2269
|
+
# Specifies which fields in the response should be expanded.
|
2270
|
+
attr_accessor :expand
|
2271
|
+
|
2272
|
+
def initialize(expand: nil)
|
2273
|
+
@expand = expand
|
2274
|
+
end
|
2275
|
+
end
|
2276
|
+
|
616
2277
|
class PdfParams < Stripe::RequestParams
|
617
2278
|
# Specifies which fields in the response should be expanded.
|
618
2279
|
attr_accessor :expand
|
@@ -622,6 +2283,24 @@ module Stripe
|
|
622
2283
|
end
|
623
2284
|
end
|
624
2285
|
|
2286
|
+
class ListPreviewInvoiceLinesParams < Stripe::RequestParams
|
2287
|
+
# 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.
|
2288
|
+
attr_accessor :ending_before
|
2289
|
+
# Specifies which fields in the response should be expanded.
|
2290
|
+
attr_accessor :expand
|
2291
|
+
# A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
|
2292
|
+
attr_accessor :limit
|
2293
|
+
# A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
|
2294
|
+
attr_accessor :starting_after
|
2295
|
+
|
2296
|
+
def initialize(ending_before: nil, expand: nil, limit: nil, starting_after: nil)
|
2297
|
+
@ending_before = ending_before
|
2298
|
+
@expand = expand
|
2299
|
+
@limit = limit
|
2300
|
+
@starting_after = starting_after
|
2301
|
+
end
|
2302
|
+
end
|
2303
|
+
|
625
2304
|
# Accepts the specified quote.
|
626
2305
|
def accept(quote, params = {}, opts = {})
|
627
2306
|
request(
|
@@ -665,6 +2344,39 @@ module Stripe
|
|
665
2344
|
request(method: :get, path: "/v1/quotes", params: params, opts: opts, base_address: :api)
|
666
2345
|
end
|
667
2346
|
|
2347
|
+
# Preview the invoice line items that would be generated by accepting the quote.
|
2348
|
+
def list_preview_invoice_lines(quote, preview_invoice, params = {}, opts = {})
|
2349
|
+
request(
|
2350
|
+
method: :get,
|
2351
|
+
path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(quote), preview_invoice: CGI.escape(preview_invoice) }),
|
2352
|
+
params: params,
|
2353
|
+
opts: opts,
|
2354
|
+
base_address: :api
|
2355
|
+
)
|
2356
|
+
end
|
2357
|
+
|
2358
|
+
# Converts a stale quote to draft.
|
2359
|
+
def mark_draft(quote, params = {}, opts = {})
|
2360
|
+
request(
|
2361
|
+
method: :post,
|
2362
|
+
path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(quote) }),
|
2363
|
+
params: params,
|
2364
|
+
opts: opts,
|
2365
|
+
base_address: :api
|
2366
|
+
)
|
2367
|
+
end
|
2368
|
+
|
2369
|
+
# Converts a draft or open quote to stale.
|
2370
|
+
def mark_stale(quote, params = {}, opts = {})
|
2371
|
+
request(
|
2372
|
+
method: :post,
|
2373
|
+
path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(quote) }),
|
2374
|
+
params: params,
|
2375
|
+
opts: opts,
|
2376
|
+
base_address: :api
|
2377
|
+
)
|
2378
|
+
end
|
2379
|
+
|
668
2380
|
# Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf)
|
669
2381
|
def pdf(quote, params = {}, opts = {}, &read_body_chunk_block)
|
670
2382
|
opts = { api_base: APIRequestor.active_requestor.config.uploads_base }.merge(opts)
|
@@ -678,6 +2390,17 @@ module Stripe
|
|
678
2390
|
)
|
679
2391
|
end
|
680
2392
|
|
2393
|
+
# Recompute the upcoming invoice estimate for the quote.
|
2394
|
+
def reestimate(quote, params = {}, opts = {})
|
2395
|
+
request(
|
2396
|
+
method: :post,
|
2397
|
+
path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(quote) }),
|
2398
|
+
params: params,
|
2399
|
+
opts: opts,
|
2400
|
+
base_address: :api
|
2401
|
+
)
|
2402
|
+
end
|
2403
|
+
|
681
2404
|
# Retrieves the quote with the given ID.
|
682
2405
|
def retrieve(quote, params = {}, opts = {})
|
683
2406
|
request(
|