stripe 14.0.0 → 14.1.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 +1513 -670
- data/OPENAPI_VERSION +1 -1
- 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 +75 -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_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_money_management_financial_account_created_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_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_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/object_types.rb +48 -0
- data/lib/stripe/request_signing_authenticator.rb +79 -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 +247 -1
- data/lib/stripe/resources/balance_settings.rb +101 -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 +1454 -0
- data/lib/stripe/resources/checkout/session.rb +260 -4
- data/lib/stripe/resources/confirmation_token.rb +234 -0
- data/lib/stripe/resources/coupon.rb +1 -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 +33 -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/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 +1176 -16
- data/lib/stripe/resources/invoice_item.rb +78 -2
- data/lib/stripe/resources/invoice_line_item.rb +55 -1
- data/lib/stripe/resources/invoice_payment.rb +2 -53
- data/lib/stripe/resources/issuing/cardholder.rb +2 -1
- data/lib/stripe/resources/issuing/credit_underwriting_record.rb +602 -0
- data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +82 -0
- data/lib/stripe/resources/issuing/fraud_liability_debit.rb +86 -0
- data/lib/stripe/resources/issuing/settlement.rb +53 -0
- data/lib/stripe/resources/issuing/transaction.rb +6 -0
- data/lib/stripe/resources/line_item.rb +37 -0
- data/lib/stripe/resources/mandate.rb +24 -0
- data/lib/stripe/resources/margin.rb +115 -0
- data/lib/stripe/resources/order.rb +2859 -0
- data/lib/stripe/resources/payment_attempt_record.rb +1078 -0
- data/lib/stripe/resources/payment_intent.rb +5233 -431
- data/lib/stripe/resources/payment_method.rb +196 -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/product.rb +59 -0
- data/lib/stripe/resources/promotion_code.rb +10 -0
- data/lib/stripe/resources/quote.rb +2042 -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 +337 -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 +292 -9
- data/lib/stripe/resources/subscription_item.rb +84 -3
- data/lib/stripe/resources/subscription_schedule.rb +1007 -10
- data/lib/stripe/resources/tax/association.rb +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/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 +1715 -0
- data/lib/stripe/resources/v2/core/account_link.rb +54 -0
- data/lib/stripe/resources/v2/core/person.rb +272 -0
- data/lib/stripe/resources/v2/core/vault/gb_bank_account.rb +72 -0
- data/lib/stripe/resources/v2/core/vault/us_bank_account.rb +37 -0
- data/lib/stripe/resources/v2/financial_address_credit_simulation.rb +18 -0
- data/lib/stripe/resources/v2/financial_address_generated_microdeposits.rb +20 -0
- data/lib/stripe/resources/v2/money_management/adjustment.rb +49 -0
- data/lib/stripe/resources/v2/money_management/financial_account.rb +56 -0
- data/lib/stripe/resources/v2/money_management/financial_address.rb +66 -0
- data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +92 -0
- data/lib/stripe/resources/v2/money_management/outbound_payment.rb +127 -0
- data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +74 -0
- data/lib/stripe/resources/v2/money_management/outbound_setup_intent.rb +43 -0
- data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +115 -0
- data/lib/stripe/resources/v2/money_management/payout_method.rb +73 -0
- data/lib/stripe/resources/v2/money_management/payout_methods_bank_account_spec.rb +47 -0
- data/lib/stripe/resources/v2/money_management/received_credit.rb +134 -0
- data/lib/stripe/resources/v2/money_management/received_debit.rb +106 -0
- data/lib/stripe/resources/v2/money_management/transaction.rb +76 -0
- data/lib/stripe/resources/v2/money_management/transaction_entry.rb +66 -0
- data/lib/stripe/resources.rb +85 -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 +217 -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 +1334 -0
- data/lib/stripe/services/checkout/session_service.rb +172 -2
- data/lib/stripe/services/credit_note_service.rb +4 -0
- data/lib/stripe/services/customer_session_service.rb +4 -1
- data/lib/stripe/services/external_account_service.rb +206 -0
- 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/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_payment_service.rb +5 -33
- data/lib/stripe/services/invoice_service.rb +1088 -17
- 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/lib/stripe/services/payment_intent_service.rb +4625 -252
- 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/product_service.rb +38 -0
- data/lib/stripe/services/promotion_code_service.rb +8 -0
- data/{rbi/stripe/services/quote_line_item_service.rbi → lib/stripe/services/quote_line_service.rb} +20 -16
- data/{rbi/stripe/services/credit_note_line_item_service.rbi → lib/stripe/services/quote_preview_invoice_service.rb} +20 -16
- data/{rbi/stripe/services/payment_link_line_item_service.rbi → lib/stripe/services/quote_preview_subscription_schedule_service.rb} +20 -16
- data/lib/stripe/services/quote_service.rb +1726 -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 +911 -10
- data/lib/stripe/services/subscription_service.rb +253 -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 +148 -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/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 +10 -2
- data/lib/stripe/services/v2/core/account_link_service.rb +76 -0
- data/lib/stripe/services/v2/core/account_service.rb +4130 -0
- data/lib/stripe/services/v2/core/accounts/person_service.rb +1040 -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 +80 -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 +49 -0
- data/lib/stripe/stripe_configuration.rb +3 -1
- data/lib/stripe/util.rb +7 -1
- data/lib/stripe/version.rb +1 -1
- data/lib/stripe.rb +55 -0
- data/rbi/stripe.rbi +189274 -0
- data/stripe.gemspec +4 -1
- metadata +140 -324
- data/rbi/stripe/resources/account.rbi +0 -4840
- 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 -2054
- data/rbi/stripe/resources/checkout/session.rbi +0 -3951
- 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 -1793
- 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 -146
- 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 -3733
- 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 -18
- data/rbi/stripe/resources/mandate.rbi +0 -187
- data/rbi/stripe/resources/payment_intent.rbi +0 -9731
- data/rbi/stripe/resources/payment_link.rbi +0 -1801
- data/rbi/stripe/resources/payment_method.rbi +0 -1822
- data/rbi/stripe/resources/payment_method_configuration.rbi +0 -3154
- data/rbi/stripe/resources/payment_method_domain.rbi +0 -212
- data/rbi/stripe/resources/payout.rbi +0 -300
- data/rbi/stripe/resources/person.rbi +0 -371
- 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 -1123
- 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 -516
- 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 -3860
- 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 -2485
- 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 -1217
- 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_external_account_service.rbi +0 -306
- 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 -923
- data/rbi/stripe/services/account_service.rbi +0 -4143
- 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 -2585
- 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 -7759
- data/rbi/stripe/services/payment_link_service.rbi +0 -1352
- data/rbi/stripe/services/payment_method_configuration_service.rbi +0 -2211
- data/rbi/stripe/services/payment_method_domain_service.rbi +0 -112
- data/rbi/stripe/services/payment_method_service.rbi +0 -840
- 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 -3596
- 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_line_item_service.rbi +0 -33
- data/rbi/stripe/services/tax/calculation_service.rbi +0 -230
- data/rbi/stripe/services/tax/registration_service.rbi +0 -1689
- 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 -746
- data/rbi/stripe/services/test_helpers/customer_service.rbi +0 -33
- data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +0 -848
- data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +0 -76
- data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +0 -69
- data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +0 -711
- data/rbi/stripe/services/test_helpers/issuing_service.rbi +0 -14
- data/rbi/stripe/services/test_helpers/refund_service.rbi +0 -22
- data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +0 -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 -1189
- 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 -36
- data/rbi/stripe/services/v2/core_service.rbi +0 -12
- data/rbi/stripe/services/v2_services.rbi +0 -10
- data/rbi/stripe/services/webhook_endpoint_service.rbi +0 -131
@@ -3,10 +3,11 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
class InvoiceService < StripeService
|
6
|
-
attr_reader :line_items
|
6
|
+
attr_reader :payments, :line_items
|
7
7
|
|
8
8
|
def initialize(requestor)
|
9
9
|
super(requestor)
|
10
|
+
@payments = Stripe::InvoicePaymentService.new(@requestor)
|
10
11
|
@line_items = Stripe::InvoiceLineItemService.new(@requestor)
|
11
12
|
end
|
12
13
|
|
@@ -23,6 +24,24 @@ module Stripe
|
|
23
24
|
end
|
24
25
|
|
25
26
|
class UpdateParams < Stripe::RequestParams
|
27
|
+
class AmountsDue < Stripe::RequestParams
|
28
|
+
# The amount in cents (or local equivalent).
|
29
|
+
attr_accessor :amount
|
30
|
+
# Number of days from when invoice is finalized until the payment is due.
|
31
|
+
attr_accessor :days_until_due
|
32
|
+
# An arbitrary string attached to the object. Often useful for displaying to users.
|
33
|
+
attr_accessor :description
|
34
|
+
# Date on which a payment plan’s payment is due.
|
35
|
+
attr_accessor :due_date
|
36
|
+
|
37
|
+
def initialize(amount: nil, days_until_due: nil, description: nil, due_date: nil)
|
38
|
+
@amount = amount
|
39
|
+
@days_until_due = days_until_due
|
40
|
+
@description = description
|
41
|
+
@due_date = due_date
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
26
45
|
class AutomaticTax < Stripe::RequestParams
|
27
46
|
class Liability < Stripe::RequestParams
|
28
47
|
# The connected account being referenced when `type` is `account`.
|
@@ -59,16 +78,44 @@ module Stripe
|
|
59
78
|
end
|
60
79
|
|
61
80
|
class Discount < Stripe::RequestParams
|
81
|
+
class DiscountEnd < Stripe::RequestParams
|
82
|
+
class Duration < Stripe::RequestParams
|
83
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
84
|
+
attr_accessor :interval
|
85
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
86
|
+
attr_accessor :interval_count
|
87
|
+
|
88
|
+
def initialize(interval: nil, interval_count: nil)
|
89
|
+
@interval = interval
|
90
|
+
@interval_count = interval_count
|
91
|
+
end
|
92
|
+
end
|
93
|
+
# Time span for the redeemed discount.
|
94
|
+
attr_accessor :duration
|
95
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
96
|
+
attr_accessor :timestamp
|
97
|
+
# The type of calculation made to determine when the discount ends.
|
98
|
+
attr_accessor :type
|
99
|
+
|
100
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
101
|
+
@duration = duration
|
102
|
+
@timestamp = timestamp
|
103
|
+
@type = type
|
104
|
+
end
|
105
|
+
end
|
62
106
|
# ID of the coupon to create a new discount for.
|
63
107
|
attr_accessor :coupon
|
64
108
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
65
109
|
attr_accessor :discount
|
110
|
+
# Details to determine how long the discount should be applied for.
|
111
|
+
attr_accessor :discount_end
|
66
112
|
# ID of the promotion code to create a new discount for.
|
67
113
|
attr_accessor :promotion_code
|
68
114
|
|
69
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
115
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
70
116
|
@coupon = coupon
|
71
117
|
@discount = discount
|
118
|
+
@discount_end = discount_end
|
72
119
|
@promotion_code = promotion_code
|
73
120
|
end
|
74
121
|
end
|
@@ -188,6 +235,9 @@ module Stripe
|
|
188
235
|
end
|
189
236
|
end
|
190
237
|
|
238
|
+
class IdBankTransfer < Stripe::RequestParams
|
239
|
+
end
|
240
|
+
|
191
241
|
class Konbini < Stripe::RequestParams
|
192
242
|
end
|
193
243
|
|
@@ -199,9 +249,12 @@ module Stripe
|
|
199
249
|
class Filters < Stripe::RequestParams
|
200
250
|
# The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
|
201
251
|
attr_accessor :account_subcategories
|
252
|
+
# ID of the institution to use to filter for selectable accounts.
|
253
|
+
attr_accessor :institution
|
202
254
|
|
203
|
-
def initialize(account_subcategories: nil)
|
255
|
+
def initialize(account_subcategories: nil, institution: nil)
|
204
256
|
@account_subcategories = account_subcategories
|
257
|
+
@institution = institution
|
205
258
|
end
|
206
259
|
end
|
207
260
|
# Provide filters for the linked accounts that the customer can select for the payment method.
|
@@ -235,6 +288,8 @@ module Stripe
|
|
235
288
|
attr_accessor :card
|
236
289
|
# If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
|
237
290
|
attr_accessor :customer_balance
|
291
|
+
# If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice’s PaymentIntent.
|
292
|
+
attr_accessor :id_bank_transfer
|
238
293
|
# If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
|
239
294
|
attr_accessor :konbini
|
240
295
|
# If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
|
@@ -247,6 +302,7 @@ module Stripe
|
|
247
302
|
bancontact: nil,
|
248
303
|
card: nil,
|
249
304
|
customer_balance: nil,
|
305
|
+
id_bank_transfer: nil,
|
250
306
|
konbini: nil,
|
251
307
|
sepa_debit: nil,
|
252
308
|
us_bank_account: nil
|
@@ -255,6 +311,7 @@ module Stripe
|
|
255
311
|
@bancontact = bancontact
|
256
312
|
@card = card
|
257
313
|
@customer_balance = customer_balance
|
314
|
+
@id_bank_transfer = id_bank_transfer
|
258
315
|
@konbini = konbini
|
259
316
|
@sepa_debit = sepa_debit
|
260
317
|
@us_bank_account = us_bank_account
|
@@ -466,6 +523,8 @@ module Stripe
|
|
466
523
|
end
|
467
524
|
# The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
|
468
525
|
attr_accessor :account_tax_ids
|
526
|
+
# List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`.
|
527
|
+
attr_accessor :amounts_due
|
469
528
|
# A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees).
|
470
529
|
attr_accessor :application_fee_amount
|
471
530
|
# Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice.
|
@@ -480,6 +539,8 @@ module Stripe
|
|
480
539
|
attr_accessor :custom_fields
|
481
540
|
# The number of days from which the invoice is created until it is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices.
|
482
541
|
attr_accessor :days_until_due
|
542
|
+
# The ids of the margins to apply to the invoice. Can be overridden by line item `margins`.
|
543
|
+
attr_accessor :default_margins
|
483
544
|
# ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
|
484
545
|
attr_accessor :default_payment_method
|
485
546
|
# ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
|
@@ -521,6 +582,7 @@ module Stripe
|
|
521
582
|
|
522
583
|
def initialize(
|
523
584
|
account_tax_ids: nil,
|
585
|
+
amounts_due: nil,
|
524
586
|
application_fee_amount: nil,
|
525
587
|
auto_advance: nil,
|
526
588
|
automatic_tax: nil,
|
@@ -528,6 +590,7 @@ module Stripe
|
|
528
590
|
collection_method: nil,
|
529
591
|
custom_fields: nil,
|
530
592
|
days_until_due: nil,
|
593
|
+
default_margins: nil,
|
531
594
|
default_payment_method: nil,
|
532
595
|
default_source: nil,
|
533
596
|
default_tax_rates: nil,
|
@@ -549,6 +612,7 @@ module Stripe
|
|
549
612
|
transfer_data: nil
|
550
613
|
)
|
551
614
|
@account_tax_ids = account_tax_ids
|
615
|
+
@amounts_due = amounts_due
|
552
616
|
@application_fee_amount = application_fee_amount
|
553
617
|
@auto_advance = auto_advance
|
554
618
|
@automatic_tax = automatic_tax
|
@@ -556,6 +620,7 @@ module Stripe
|
|
556
620
|
@collection_method = collection_method
|
557
621
|
@custom_fields = custom_fields
|
558
622
|
@days_until_due = days_until_due
|
623
|
+
@default_margins = default_margins
|
559
624
|
@default_payment_method = default_payment_method
|
560
625
|
@default_source = default_source
|
561
626
|
@default_tax_rates = default_tax_rates
|
@@ -620,6 +685,8 @@ module Stripe
|
|
620
685
|
attr_accessor :created
|
621
686
|
# Only return invoices for the customer specified by this customer ID.
|
622
687
|
attr_accessor :customer
|
688
|
+
# Attribute for param field customer_account
|
689
|
+
attr_accessor :customer_account
|
623
690
|
# Attribute for param field due_date
|
624
691
|
attr_accessor :due_date
|
625
692
|
# 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.
|
@@ -639,6 +706,7 @@ module Stripe
|
|
639
706
|
collection_method: nil,
|
640
707
|
created: nil,
|
641
708
|
customer: nil,
|
709
|
+
customer_account: nil,
|
642
710
|
due_date: nil,
|
643
711
|
ending_before: nil,
|
644
712
|
expand: nil,
|
@@ -650,6 +718,7 @@ module Stripe
|
|
650
718
|
@collection_method = collection_method
|
651
719
|
@created = created
|
652
720
|
@customer = customer
|
721
|
+
@customer_account = customer_account
|
653
722
|
@due_date = due_date
|
654
723
|
@ending_before = ending_before
|
655
724
|
@expand = expand
|
@@ -661,6 +730,24 @@ module Stripe
|
|
661
730
|
end
|
662
731
|
|
663
732
|
class CreateParams < Stripe::RequestParams
|
733
|
+
class AmountsDue < Stripe::RequestParams
|
734
|
+
# The amount in cents (or local equivalent).
|
735
|
+
attr_accessor :amount
|
736
|
+
# Number of days from when invoice is finalized until the payment is due.
|
737
|
+
attr_accessor :days_until_due
|
738
|
+
# An arbitrary string attached to the object. Often useful for displaying to users.
|
739
|
+
attr_accessor :description
|
740
|
+
# Date on which a payment plan’s payment is due.
|
741
|
+
attr_accessor :due_date
|
742
|
+
|
743
|
+
def initialize(amount: nil, days_until_due: nil, description: nil, due_date: nil)
|
744
|
+
@amount = amount
|
745
|
+
@days_until_due = days_until_due
|
746
|
+
@description = description
|
747
|
+
@due_date = due_date
|
748
|
+
end
|
749
|
+
end
|
750
|
+
|
664
751
|
class AutomaticTax < Stripe::RequestParams
|
665
752
|
class Liability < Stripe::RequestParams
|
666
753
|
# The connected account being referenced when `type` is `account`.
|
@@ -697,16 +784,44 @@ module Stripe
|
|
697
784
|
end
|
698
785
|
|
699
786
|
class Discount < Stripe::RequestParams
|
787
|
+
class DiscountEnd < Stripe::RequestParams
|
788
|
+
class Duration < Stripe::RequestParams
|
789
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
790
|
+
attr_accessor :interval
|
791
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
792
|
+
attr_accessor :interval_count
|
793
|
+
|
794
|
+
def initialize(interval: nil, interval_count: nil)
|
795
|
+
@interval = interval
|
796
|
+
@interval_count = interval_count
|
797
|
+
end
|
798
|
+
end
|
799
|
+
# Time span for the redeemed discount.
|
800
|
+
attr_accessor :duration
|
801
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
802
|
+
attr_accessor :timestamp
|
803
|
+
# The type of calculation made to determine when the discount ends.
|
804
|
+
attr_accessor :type
|
805
|
+
|
806
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
807
|
+
@duration = duration
|
808
|
+
@timestamp = timestamp
|
809
|
+
@type = type
|
810
|
+
end
|
811
|
+
end
|
700
812
|
# ID of the coupon to create a new discount for.
|
701
813
|
attr_accessor :coupon
|
702
814
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
703
815
|
attr_accessor :discount
|
816
|
+
# Details to determine how long the discount should be applied for.
|
817
|
+
attr_accessor :discount_end
|
704
818
|
# ID of the promotion code to create a new discount for.
|
705
819
|
attr_accessor :promotion_code
|
706
820
|
|
707
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
821
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
708
822
|
@coupon = coupon
|
709
823
|
@discount = discount
|
824
|
+
@discount_end = discount_end
|
710
825
|
@promotion_code = promotion_code
|
711
826
|
end
|
712
827
|
end
|
@@ -838,6 +953,9 @@ module Stripe
|
|
838
953
|
end
|
839
954
|
end
|
840
955
|
|
956
|
+
class IdBankTransfer < Stripe::RequestParams
|
957
|
+
end
|
958
|
+
|
841
959
|
class Konbini < Stripe::RequestParams
|
842
960
|
end
|
843
961
|
|
@@ -849,9 +967,12 @@ module Stripe
|
|
849
967
|
class Filters < Stripe::RequestParams
|
850
968
|
# The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
|
851
969
|
attr_accessor :account_subcategories
|
970
|
+
# ID of the institution to use to filter for selectable accounts.
|
971
|
+
attr_accessor :institution
|
852
972
|
|
853
|
-
def initialize(account_subcategories: nil)
|
973
|
+
def initialize(account_subcategories: nil, institution: nil)
|
854
974
|
@account_subcategories = account_subcategories
|
975
|
+
@institution = institution
|
855
976
|
end
|
856
977
|
end
|
857
978
|
# Provide filters for the linked accounts that the customer can select for the payment method.
|
@@ -885,6 +1006,8 @@ module Stripe
|
|
885
1006
|
attr_accessor :card
|
886
1007
|
# If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
|
887
1008
|
attr_accessor :customer_balance
|
1009
|
+
# If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice’s PaymentIntent.
|
1010
|
+
attr_accessor :id_bank_transfer
|
888
1011
|
# If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
|
889
1012
|
attr_accessor :konbini
|
890
1013
|
# If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
|
@@ -897,6 +1020,7 @@ module Stripe
|
|
897
1020
|
bancontact: nil,
|
898
1021
|
card: nil,
|
899
1022
|
customer_balance: nil,
|
1023
|
+
id_bank_transfer: nil,
|
900
1024
|
konbini: nil,
|
901
1025
|
sepa_debit: nil,
|
902
1026
|
us_bank_account: nil
|
@@ -905,6 +1029,7 @@ module Stripe
|
|
905
1029
|
@bancontact = bancontact
|
906
1030
|
@card = card
|
907
1031
|
@customer_balance = customer_balance
|
1032
|
+
@id_bank_transfer = id_bank_transfer
|
908
1033
|
@konbini = konbini
|
909
1034
|
@sepa_debit = sepa_debit
|
910
1035
|
@us_bank_account = us_bank_account
|
@@ -1116,6 +1241,8 @@ module Stripe
|
|
1116
1241
|
end
|
1117
1242
|
# The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
|
1118
1243
|
attr_accessor :account_tax_ids
|
1244
|
+
# List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`.
|
1245
|
+
attr_accessor :amounts_due
|
1119
1246
|
# A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees).
|
1120
1247
|
attr_accessor :application_fee_amount
|
1121
1248
|
# Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action.
|
@@ -1132,8 +1259,12 @@ module Stripe
|
|
1132
1259
|
attr_accessor :custom_fields
|
1133
1260
|
# The ID of the customer who will be billed.
|
1134
1261
|
attr_accessor :customer
|
1262
|
+
# The ID of the account who will be billed.
|
1263
|
+
attr_accessor :customer_account
|
1135
1264
|
# The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`.
|
1136
1265
|
attr_accessor :days_until_due
|
1266
|
+
# The ids of the margins to apply to the invoice. Can be overridden by line item `margins`.
|
1267
|
+
attr_accessor :default_margins
|
1137
1268
|
# ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
|
1138
1269
|
attr_accessor :default_payment_method
|
1139
1270
|
# ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
|
@@ -1181,6 +1312,7 @@ module Stripe
|
|
1181
1312
|
|
1182
1313
|
def initialize(
|
1183
1314
|
account_tax_ids: nil,
|
1315
|
+
amounts_due: nil,
|
1184
1316
|
application_fee_amount: nil,
|
1185
1317
|
auto_advance: nil,
|
1186
1318
|
automatic_tax: nil,
|
@@ -1189,7 +1321,9 @@ module Stripe
|
|
1189
1321
|
currency: nil,
|
1190
1322
|
custom_fields: nil,
|
1191
1323
|
customer: nil,
|
1324
|
+
customer_account: nil,
|
1192
1325
|
days_until_due: nil,
|
1326
|
+
default_margins: nil,
|
1193
1327
|
default_payment_method: nil,
|
1194
1328
|
default_source: nil,
|
1195
1329
|
default_tax_rates: nil,
|
@@ -1214,6 +1348,7 @@ module Stripe
|
|
1214
1348
|
transfer_data: nil
|
1215
1349
|
)
|
1216
1350
|
@account_tax_ids = account_tax_ids
|
1351
|
+
@amounts_due = amounts_due
|
1217
1352
|
@application_fee_amount = application_fee_amount
|
1218
1353
|
@auto_advance = auto_advance
|
1219
1354
|
@automatic_tax = automatic_tax
|
@@ -1222,7 +1357,9 @@ module Stripe
|
|
1222
1357
|
@currency = currency
|
1223
1358
|
@custom_fields = custom_fields
|
1224
1359
|
@customer = customer
|
1360
|
+
@customer_account = customer_account
|
1225
1361
|
@days_until_due = days_until_due
|
1362
|
+
@default_margins = default_margins
|
1226
1363
|
@default_payment_method = default_payment_method
|
1227
1364
|
@default_source = default_source
|
1228
1365
|
@default_tax_rates = default_tax_rates
|
@@ -1269,16 +1406,44 @@ module Stripe
|
|
1269
1406
|
class AddLinesParams < Stripe::RequestParams
|
1270
1407
|
class Line < Stripe::RequestParams
|
1271
1408
|
class Discount < Stripe::RequestParams
|
1409
|
+
class DiscountEnd < Stripe::RequestParams
|
1410
|
+
class Duration < Stripe::RequestParams
|
1411
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1412
|
+
attr_accessor :interval
|
1413
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1414
|
+
attr_accessor :interval_count
|
1415
|
+
|
1416
|
+
def initialize(interval: nil, interval_count: nil)
|
1417
|
+
@interval = interval
|
1418
|
+
@interval_count = interval_count
|
1419
|
+
end
|
1420
|
+
end
|
1421
|
+
# Time span for the redeemed discount.
|
1422
|
+
attr_accessor :duration
|
1423
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1424
|
+
attr_accessor :timestamp
|
1425
|
+
# The type of calculation made to determine when the discount ends.
|
1426
|
+
attr_accessor :type
|
1427
|
+
|
1428
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
1429
|
+
@duration = duration
|
1430
|
+
@timestamp = timestamp
|
1431
|
+
@type = type
|
1432
|
+
end
|
1433
|
+
end
|
1272
1434
|
# ID of the coupon to create a new discount for.
|
1273
1435
|
attr_accessor :coupon
|
1274
1436
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
1275
1437
|
attr_accessor :discount
|
1438
|
+
# Details to determine how long the discount should be applied for.
|
1439
|
+
attr_accessor :discount_end
|
1276
1440
|
# ID of the promotion code to create a new discount for.
|
1277
1441
|
attr_accessor :promotion_code
|
1278
1442
|
|
1279
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1443
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
1280
1444
|
@coupon = coupon
|
1281
1445
|
@discount = discount
|
1446
|
+
@discount_end = discount_end
|
1282
1447
|
@promotion_code = promotion_code
|
1283
1448
|
end
|
1284
1449
|
end
|
@@ -1431,6 +1596,8 @@ module Stripe
|
|
1431
1596
|
attr_accessor :discounts
|
1432
1597
|
# ID of an unassigned invoice item to assign to this invoice. If not provided, a new item will be created.
|
1433
1598
|
attr_accessor :invoice_item
|
1599
|
+
# The IDs of the margins to apply to the line item. When set, the `default_margins` on the invoice do not apply to this line item.
|
1600
|
+
attr_accessor :margins
|
1434
1601
|
# 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`.
|
1435
1602
|
attr_accessor :metadata
|
1436
1603
|
# The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
|
@@ -1452,6 +1619,7 @@ module Stripe
|
|
1452
1619
|
discountable: nil,
|
1453
1620
|
discounts: nil,
|
1454
1621
|
invoice_item: nil,
|
1622
|
+
margins: nil,
|
1455
1623
|
metadata: nil,
|
1456
1624
|
period: nil,
|
1457
1625
|
price_data: nil,
|
@@ -1465,6 +1633,7 @@ module Stripe
|
|
1465
1633
|
@discountable = discountable
|
1466
1634
|
@discounts = discounts
|
1467
1635
|
@invoice_item = invoice_item
|
1636
|
+
@margins = margins
|
1468
1637
|
@metadata = metadata
|
1469
1638
|
@period = period
|
1470
1639
|
@price_data = price_data
|
@@ -1488,6 +1657,78 @@ module Stripe
|
|
1488
1657
|
end
|
1489
1658
|
end
|
1490
1659
|
|
1660
|
+
class AttachPaymentParams < Stripe::RequestParams
|
1661
|
+
class PaymentRecordData < Stripe::RequestParams
|
1662
|
+
# The amount that was paid out of band.
|
1663
|
+
attr_accessor :amount
|
1664
|
+
# The currency that was paid out of band.
|
1665
|
+
attr_accessor :currency
|
1666
|
+
# 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`.
|
1667
|
+
attr_accessor :metadata
|
1668
|
+
# The type of money movement for this out of band payment record.
|
1669
|
+
attr_accessor :money_movement_type
|
1670
|
+
# The timestamp when this out of band payment was paid.
|
1671
|
+
attr_accessor :paid_at
|
1672
|
+
# The reference for this out of band payment record.
|
1673
|
+
attr_accessor :payment_reference
|
1674
|
+
|
1675
|
+
def initialize(
|
1676
|
+
amount: nil,
|
1677
|
+
currency: nil,
|
1678
|
+
metadata: nil,
|
1679
|
+
money_movement_type: nil,
|
1680
|
+
paid_at: nil,
|
1681
|
+
payment_reference: nil
|
1682
|
+
)
|
1683
|
+
@amount = amount
|
1684
|
+
@currency = currency
|
1685
|
+
@metadata = metadata
|
1686
|
+
@money_movement_type = money_movement_type
|
1687
|
+
@paid_at = paid_at
|
1688
|
+
@payment_reference = payment_reference
|
1689
|
+
end
|
1690
|
+
end
|
1691
|
+
# The portion of the `amount` on the PaymentIntent or out of band payment to apply to this invoice. It defaults to the entire amount.
|
1692
|
+
attr_accessor :amount_requested
|
1693
|
+
# Specifies which fields in the response should be expanded.
|
1694
|
+
attr_accessor :expand
|
1695
|
+
# The ID of the PaymentIntent to attach to the invoice.
|
1696
|
+
attr_accessor :payment_intent
|
1697
|
+
# The ID of the PaymentRecord to attach to the invoice.
|
1698
|
+
attr_accessor :payment_record
|
1699
|
+
# The PaymentRecord data for attaching an out of band payment to the invoice.
|
1700
|
+
attr_accessor :payment_record_data
|
1701
|
+
|
1702
|
+
def initialize(
|
1703
|
+
amount_requested: nil,
|
1704
|
+
expand: nil,
|
1705
|
+
payment_intent: nil,
|
1706
|
+
payment_record: nil,
|
1707
|
+
payment_record_data: nil
|
1708
|
+
)
|
1709
|
+
@amount_requested = amount_requested
|
1710
|
+
@expand = expand
|
1711
|
+
@payment_intent = payment_intent
|
1712
|
+
@payment_record = payment_record
|
1713
|
+
@payment_record_data = payment_record_data
|
1714
|
+
end
|
1715
|
+
end
|
1716
|
+
|
1717
|
+
class AttachPaymentIntentParams < Stripe::RequestParams
|
1718
|
+
# The portion of the PaymentIntent’s `amount` that should be applied to thisinvoice. Defaults to the entire amount.
|
1719
|
+
attr_accessor :amount_requested
|
1720
|
+
# Specifies which fields in the response should be expanded.
|
1721
|
+
attr_accessor :expand
|
1722
|
+
# The ID of the PaymentIntent to attach to the invoice.
|
1723
|
+
attr_accessor :payment_intent
|
1724
|
+
|
1725
|
+
def initialize(amount_requested: nil, expand: nil, payment_intent: nil)
|
1726
|
+
@amount_requested = amount_requested
|
1727
|
+
@expand = expand
|
1728
|
+
@payment_intent = payment_intent
|
1729
|
+
end
|
1730
|
+
end
|
1731
|
+
|
1491
1732
|
class FinalizeInvoiceParams < Stripe::RequestParams
|
1492
1733
|
# Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action.
|
1493
1734
|
attr_accessor :auto_advance
|
@@ -1584,16 +1825,44 @@ module Stripe
|
|
1584
1825
|
class UpdateLinesParams < Stripe::RequestParams
|
1585
1826
|
class Line < Stripe::RequestParams
|
1586
1827
|
class Discount < Stripe::RequestParams
|
1828
|
+
class DiscountEnd < Stripe::RequestParams
|
1829
|
+
class Duration < Stripe::RequestParams
|
1830
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1831
|
+
attr_accessor :interval
|
1832
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1833
|
+
attr_accessor :interval_count
|
1834
|
+
|
1835
|
+
def initialize(interval: nil, interval_count: nil)
|
1836
|
+
@interval = interval
|
1837
|
+
@interval_count = interval_count
|
1838
|
+
end
|
1839
|
+
end
|
1840
|
+
# Time span for the redeemed discount.
|
1841
|
+
attr_accessor :duration
|
1842
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1843
|
+
attr_accessor :timestamp
|
1844
|
+
# The type of calculation made to determine when the discount ends.
|
1845
|
+
attr_accessor :type
|
1846
|
+
|
1847
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
1848
|
+
@duration = duration
|
1849
|
+
@timestamp = timestamp
|
1850
|
+
@type = type
|
1851
|
+
end
|
1852
|
+
end
|
1587
1853
|
# ID of the coupon to create a new discount for.
|
1588
1854
|
attr_accessor :coupon
|
1589
1855
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
1590
1856
|
attr_accessor :discount
|
1857
|
+
# Details to determine how long the discount should be applied for.
|
1858
|
+
attr_accessor :discount_end
|
1591
1859
|
# ID of the promotion code to create a new discount for.
|
1592
1860
|
attr_accessor :promotion_code
|
1593
1861
|
|
1594
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1862
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
1595
1863
|
@coupon = coupon
|
1596
1864
|
@discount = discount
|
1865
|
+
@discount_end = discount_end
|
1597
1866
|
@promotion_code = promotion_code
|
1598
1867
|
end
|
1599
1868
|
end
|
@@ -1746,6 +2015,8 @@ module Stripe
|
|
1746
2015
|
attr_accessor :discounts
|
1747
2016
|
# ID of an existing line item on the invoice.
|
1748
2017
|
attr_accessor :id
|
2018
|
+
# The IDs of the margins to apply to the line item. When set, the `default_margins` on the invoice do not apply to this line item.
|
2019
|
+
attr_accessor :margins
|
1749
2020
|
# 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`. For [type=subscription](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data.
|
1750
2021
|
attr_accessor :metadata
|
1751
2022
|
# The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
|
@@ -1767,6 +2038,7 @@ module Stripe
|
|
1767
2038
|
discountable: nil,
|
1768
2039
|
discounts: nil,
|
1769
2040
|
id: nil,
|
2041
|
+
margins: nil,
|
1770
2042
|
metadata: nil,
|
1771
2043
|
period: nil,
|
1772
2044
|
price_data: nil,
|
@@ -1780,6 +2052,7 @@ module Stripe
|
|
1780
2052
|
@discountable = discountable
|
1781
2053
|
@discounts = discounts
|
1782
2054
|
@id = id
|
2055
|
+
@margins = margins
|
1783
2056
|
@metadata = metadata
|
1784
2057
|
@period = period
|
1785
2058
|
@price_data = price_data
|
@@ -1954,32 +2227,88 @@ module Stripe
|
|
1954
2227
|
end
|
1955
2228
|
|
1956
2229
|
class Discount < Stripe::RequestParams
|
2230
|
+
class DiscountEnd < Stripe::RequestParams
|
2231
|
+
class Duration < Stripe::RequestParams
|
2232
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
2233
|
+
attr_accessor :interval
|
2234
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
2235
|
+
attr_accessor :interval_count
|
2236
|
+
|
2237
|
+
def initialize(interval: nil, interval_count: nil)
|
2238
|
+
@interval = interval
|
2239
|
+
@interval_count = interval_count
|
2240
|
+
end
|
2241
|
+
end
|
2242
|
+
# Time span for the redeemed discount.
|
2243
|
+
attr_accessor :duration
|
2244
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
2245
|
+
attr_accessor :timestamp
|
2246
|
+
# The type of calculation made to determine when the discount ends.
|
2247
|
+
attr_accessor :type
|
2248
|
+
|
2249
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
2250
|
+
@duration = duration
|
2251
|
+
@timestamp = timestamp
|
2252
|
+
@type = type
|
2253
|
+
end
|
2254
|
+
end
|
1957
2255
|
# ID of the coupon to create a new discount for.
|
1958
2256
|
attr_accessor :coupon
|
1959
2257
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
1960
2258
|
attr_accessor :discount
|
2259
|
+
# Details to determine how long the discount should be applied for.
|
2260
|
+
attr_accessor :discount_end
|
1961
2261
|
# ID of the promotion code to create a new discount for.
|
1962
2262
|
attr_accessor :promotion_code
|
1963
2263
|
|
1964
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
2264
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
1965
2265
|
@coupon = coupon
|
1966
2266
|
@discount = discount
|
2267
|
+
@discount_end = discount_end
|
1967
2268
|
@promotion_code = promotion_code
|
1968
2269
|
end
|
1969
2270
|
end
|
1970
2271
|
|
1971
2272
|
class InvoiceItem < Stripe::RequestParams
|
1972
2273
|
class Discount < Stripe::RequestParams
|
2274
|
+
class DiscountEnd < Stripe::RequestParams
|
2275
|
+
class Duration < Stripe::RequestParams
|
2276
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
2277
|
+
attr_accessor :interval
|
2278
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
2279
|
+
attr_accessor :interval_count
|
2280
|
+
|
2281
|
+
def initialize(interval: nil, interval_count: nil)
|
2282
|
+
@interval = interval
|
2283
|
+
@interval_count = interval_count
|
2284
|
+
end
|
2285
|
+
end
|
2286
|
+
# Time span for the redeemed discount.
|
2287
|
+
attr_accessor :duration
|
2288
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
2289
|
+
attr_accessor :timestamp
|
2290
|
+
# The type of calculation made to determine when the discount ends.
|
2291
|
+
attr_accessor :type
|
2292
|
+
|
2293
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
2294
|
+
@duration = duration
|
2295
|
+
@timestamp = timestamp
|
2296
|
+
@type = type
|
2297
|
+
end
|
2298
|
+
end
|
1973
2299
|
# ID of the coupon to create a new discount for.
|
1974
2300
|
attr_accessor :coupon
|
1975
2301
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
1976
2302
|
attr_accessor :discount
|
2303
|
+
# Details to determine how long the discount should be applied for.
|
2304
|
+
attr_accessor :discount_end
|
1977
2305
|
# ID of the promotion code to create a new discount for.
|
1978
2306
|
attr_accessor :promotion_code
|
1979
2307
|
|
1980
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
2308
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
1981
2309
|
@coupon = coupon
|
1982
2310
|
@discount = discount
|
2311
|
+
@discount_end = discount_end
|
1983
2312
|
@promotion_code = promotion_code
|
1984
2313
|
end
|
1985
2314
|
end
|
@@ -2105,19 +2434,499 @@ module Stripe
|
|
2105
2434
|
end
|
2106
2435
|
|
2107
2436
|
class ScheduleDetails < Stripe::RequestParams
|
2437
|
+
class Amendment < Stripe::RequestParams
|
2438
|
+
class AmendmentEnd < Stripe::RequestParams
|
2439
|
+
class DiscountEnd < Stripe::RequestParams
|
2440
|
+
# The ID of a specific discount.
|
2441
|
+
attr_accessor :discount
|
2442
|
+
|
2443
|
+
def initialize(discount: nil)
|
2444
|
+
@discount = discount
|
2445
|
+
end
|
2446
|
+
end
|
2447
|
+
|
2448
|
+
class Duration < Stripe::RequestParams
|
2449
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
2450
|
+
attr_accessor :interval
|
2451
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
2452
|
+
attr_accessor :interval_count
|
2453
|
+
|
2454
|
+
def initialize(interval: nil, interval_count: nil)
|
2455
|
+
@interval = interval
|
2456
|
+
@interval_count = interval_count
|
2457
|
+
end
|
2458
|
+
end
|
2459
|
+
# Use the `end` time of a given discount.
|
2460
|
+
attr_accessor :discount_end
|
2461
|
+
# Time span for the amendment starting from the `amendment_start`.
|
2462
|
+
attr_accessor :duration
|
2463
|
+
# A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
|
2464
|
+
attr_accessor :timestamp
|
2465
|
+
# Select one of three ways to pass the `amendment_end`.
|
2466
|
+
attr_accessor :type
|
2467
|
+
|
2468
|
+
def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
|
2469
|
+
@discount_end = discount_end
|
2470
|
+
@duration = duration
|
2471
|
+
@timestamp = timestamp
|
2472
|
+
@type = type
|
2473
|
+
end
|
2474
|
+
end
|
2475
|
+
|
2476
|
+
class AmendmentStart < Stripe::RequestParams
|
2477
|
+
class AmendmentEnd < Stripe::RequestParams
|
2478
|
+
# The position of the previous amendment in the `amendments` array after which this amendment should begin. Indexes start from 0 and must be less than the index of the current amendment in the array.
|
2479
|
+
attr_accessor :index
|
2480
|
+
|
2481
|
+
def initialize(index: nil)
|
2482
|
+
@index = index
|
2483
|
+
end
|
2484
|
+
end
|
2485
|
+
|
2486
|
+
class DiscountEnd < Stripe::RequestParams
|
2487
|
+
# The ID of a specific discount.
|
2488
|
+
attr_accessor :discount
|
2489
|
+
|
2490
|
+
def initialize(discount: nil)
|
2491
|
+
@discount = discount
|
2492
|
+
end
|
2493
|
+
end
|
2494
|
+
# Details of another amendment in the same array, immediately after which this amendment should begin.
|
2495
|
+
attr_accessor :amendment_end
|
2496
|
+
# Use the `end` time of a given discount.
|
2497
|
+
attr_accessor :discount_end
|
2498
|
+
# A precise Unix timestamp for the amendment to start.
|
2499
|
+
attr_accessor :timestamp
|
2500
|
+
# Select one of three ways to pass the `amendment_start`.
|
2501
|
+
attr_accessor :type
|
2502
|
+
|
2503
|
+
def initialize(amendment_end: nil, discount_end: nil, timestamp: nil, type: nil)
|
2504
|
+
@amendment_end = amendment_end
|
2505
|
+
@discount_end = discount_end
|
2506
|
+
@timestamp = timestamp
|
2507
|
+
@type = type
|
2508
|
+
end
|
2509
|
+
end
|
2510
|
+
|
2511
|
+
class DiscountAction < Stripe::RequestParams
|
2512
|
+
class Add < Stripe::RequestParams
|
2513
|
+
class DiscountEnd < Stripe::RequestParams
|
2514
|
+
# The type of calculation made to determine when the discount ends.
|
2515
|
+
attr_accessor :type
|
2516
|
+
|
2517
|
+
def initialize(type: nil)
|
2518
|
+
@type = type
|
2519
|
+
end
|
2520
|
+
end
|
2521
|
+
# The coupon code to redeem.
|
2522
|
+
attr_accessor :coupon
|
2523
|
+
# An ID of an existing discount for a coupon that was already redeemed.
|
2524
|
+
attr_accessor :discount
|
2525
|
+
# Details to determine how long the discount should be applied for.
|
2526
|
+
attr_accessor :discount_end
|
2527
|
+
# 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.
|
2528
|
+
attr_accessor :index
|
2529
|
+
# The promotion code to redeem.
|
2530
|
+
attr_accessor :promotion_code
|
2531
|
+
|
2532
|
+
def initialize(
|
2533
|
+
coupon: nil,
|
2534
|
+
discount: nil,
|
2535
|
+
discount_end: nil,
|
2536
|
+
index: nil,
|
2537
|
+
promotion_code: nil
|
2538
|
+
)
|
2539
|
+
@coupon = coupon
|
2540
|
+
@discount = discount
|
2541
|
+
@discount_end = discount_end
|
2542
|
+
@index = index
|
2543
|
+
@promotion_code = promotion_code
|
2544
|
+
end
|
2545
|
+
end
|
2546
|
+
|
2547
|
+
class Remove < Stripe::RequestParams
|
2548
|
+
# The coupon code to remove from the `discounts` array.
|
2549
|
+
attr_accessor :coupon
|
2550
|
+
# The ID of a discount to remove from the `discounts` array.
|
2551
|
+
attr_accessor :discount
|
2552
|
+
# The ID of a promotion code to remove from the `discounts` array.
|
2553
|
+
attr_accessor :promotion_code
|
2554
|
+
|
2555
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
2556
|
+
@coupon = coupon
|
2557
|
+
@discount = discount
|
2558
|
+
@promotion_code = promotion_code
|
2559
|
+
end
|
2560
|
+
end
|
2561
|
+
|
2562
|
+
class Set < Stripe::RequestParams
|
2563
|
+
# The coupon code to replace the `discounts` array with.
|
2564
|
+
attr_accessor :coupon
|
2565
|
+
# An ID of an existing discount to replace the `discounts` array with.
|
2566
|
+
attr_accessor :discount
|
2567
|
+
# An ID of an existing promotion code to replace the `discounts` array with.
|
2568
|
+
attr_accessor :promotion_code
|
2569
|
+
|
2570
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
2571
|
+
@coupon = coupon
|
2572
|
+
@discount = discount
|
2573
|
+
@promotion_code = promotion_code
|
2574
|
+
end
|
2575
|
+
end
|
2576
|
+
# Details of the discount to add.
|
2577
|
+
attr_accessor :add
|
2578
|
+
# Details of the discount to remove.
|
2579
|
+
attr_accessor :remove
|
2580
|
+
# Details of the discount to replace the existing discounts with.
|
2581
|
+
attr_accessor :set
|
2582
|
+
# Determines the type of discount action.
|
2583
|
+
attr_accessor :type
|
2584
|
+
|
2585
|
+
def initialize(add: nil, remove: nil, set: nil, type: nil)
|
2586
|
+
@add = add
|
2587
|
+
@remove = remove
|
2588
|
+
@set = set
|
2589
|
+
@type = type
|
2590
|
+
end
|
2591
|
+
end
|
2592
|
+
|
2593
|
+
class ItemAction < Stripe::RequestParams
|
2594
|
+
class Add < Stripe::RequestParams
|
2595
|
+
class Discount < Stripe::RequestParams
|
2596
|
+
class DiscountEnd < Stripe::RequestParams
|
2597
|
+
class Duration < Stripe::RequestParams
|
2598
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
2599
|
+
attr_accessor :interval
|
2600
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
2601
|
+
attr_accessor :interval_count
|
2602
|
+
|
2603
|
+
def initialize(interval: nil, interval_count: nil)
|
2604
|
+
@interval = interval
|
2605
|
+
@interval_count = interval_count
|
2606
|
+
end
|
2607
|
+
end
|
2608
|
+
# Time span for the redeemed discount.
|
2609
|
+
attr_accessor :duration
|
2610
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
2611
|
+
attr_accessor :timestamp
|
2612
|
+
# The type of calculation made to determine when the discount ends.
|
2613
|
+
attr_accessor :type
|
2614
|
+
|
2615
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
2616
|
+
@duration = duration
|
2617
|
+
@timestamp = timestamp
|
2618
|
+
@type = type
|
2619
|
+
end
|
2620
|
+
end
|
2621
|
+
# ID of the coupon to create a new discount for.
|
2622
|
+
attr_accessor :coupon
|
2623
|
+
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
2624
|
+
attr_accessor :discount
|
2625
|
+
# Details to determine how long the discount should be applied for.
|
2626
|
+
attr_accessor :discount_end
|
2627
|
+
# ID of the promotion code to create a new discount for.
|
2628
|
+
attr_accessor :promotion_code
|
2629
|
+
|
2630
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
2631
|
+
@coupon = coupon
|
2632
|
+
@discount = discount
|
2633
|
+
@discount_end = discount_end
|
2634
|
+
@promotion_code = promotion_code
|
2635
|
+
end
|
2636
|
+
end
|
2637
|
+
|
2638
|
+
class Trial < Stripe::RequestParams
|
2639
|
+
# 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.
|
2640
|
+
attr_accessor :converts_to
|
2641
|
+
# Determines the type of trial for this item.
|
2642
|
+
attr_accessor :type
|
2643
|
+
|
2644
|
+
def initialize(converts_to: nil, type: nil)
|
2645
|
+
@converts_to = converts_to
|
2646
|
+
@type = type
|
2647
|
+
end
|
2648
|
+
end
|
2649
|
+
# The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
|
2650
|
+
attr_accessor :discounts
|
2651
|
+
# 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`.
|
2652
|
+
attr_accessor :metadata
|
2653
|
+
# The ID of the price object.
|
2654
|
+
attr_accessor :price
|
2655
|
+
# Quantity for this item.
|
2656
|
+
attr_accessor :quantity
|
2657
|
+
# 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`.
|
2658
|
+
attr_accessor :tax_rates
|
2659
|
+
# Options that configure the trial on the subscription item.
|
2660
|
+
attr_accessor :trial
|
2661
|
+
|
2662
|
+
def initialize(
|
2663
|
+
discounts: nil,
|
2664
|
+
metadata: nil,
|
2665
|
+
price: nil,
|
2666
|
+
quantity: nil,
|
2667
|
+
tax_rates: nil,
|
2668
|
+
trial: nil
|
2669
|
+
)
|
2670
|
+
@discounts = discounts
|
2671
|
+
@metadata = metadata
|
2672
|
+
@price = price
|
2673
|
+
@quantity = quantity
|
2674
|
+
@tax_rates = tax_rates
|
2675
|
+
@trial = trial
|
2676
|
+
end
|
2677
|
+
end
|
2678
|
+
|
2679
|
+
class Remove < Stripe::RequestParams
|
2680
|
+
# ID of a price to remove.
|
2681
|
+
attr_accessor :price
|
2682
|
+
|
2683
|
+
def initialize(price: nil)
|
2684
|
+
@price = price
|
2685
|
+
end
|
2686
|
+
end
|
2687
|
+
|
2688
|
+
class Set < Stripe::RequestParams
|
2689
|
+
class Discount < Stripe::RequestParams
|
2690
|
+
class DiscountEnd < Stripe::RequestParams
|
2691
|
+
class Duration < Stripe::RequestParams
|
2692
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
2693
|
+
attr_accessor :interval
|
2694
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
2695
|
+
attr_accessor :interval_count
|
2696
|
+
|
2697
|
+
def initialize(interval: nil, interval_count: nil)
|
2698
|
+
@interval = interval
|
2699
|
+
@interval_count = interval_count
|
2700
|
+
end
|
2701
|
+
end
|
2702
|
+
# Time span for the redeemed discount.
|
2703
|
+
attr_accessor :duration
|
2704
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
2705
|
+
attr_accessor :timestamp
|
2706
|
+
# The type of calculation made to determine when the discount ends.
|
2707
|
+
attr_accessor :type
|
2708
|
+
|
2709
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
2710
|
+
@duration = duration
|
2711
|
+
@timestamp = timestamp
|
2712
|
+
@type = type
|
2713
|
+
end
|
2714
|
+
end
|
2715
|
+
# ID of the coupon to create a new discount for.
|
2716
|
+
attr_accessor :coupon
|
2717
|
+
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
2718
|
+
attr_accessor :discount
|
2719
|
+
# Details to determine how long the discount should be applied for.
|
2720
|
+
attr_accessor :discount_end
|
2721
|
+
# ID of the promotion code to create a new discount for.
|
2722
|
+
attr_accessor :promotion_code
|
2723
|
+
|
2724
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
2725
|
+
@coupon = coupon
|
2726
|
+
@discount = discount
|
2727
|
+
@discount_end = discount_end
|
2728
|
+
@promotion_code = promotion_code
|
2729
|
+
end
|
2730
|
+
end
|
2731
|
+
|
2732
|
+
class Trial < Stripe::RequestParams
|
2733
|
+
# 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.
|
2734
|
+
attr_accessor :converts_to
|
2735
|
+
# Determines the type of trial for this item.
|
2736
|
+
attr_accessor :type
|
2737
|
+
|
2738
|
+
def initialize(converts_to: nil, type: nil)
|
2739
|
+
@converts_to = converts_to
|
2740
|
+
@type = type
|
2741
|
+
end
|
2742
|
+
end
|
2743
|
+
# 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`.
|
2744
|
+
attr_accessor :discounts
|
2745
|
+
# 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`.
|
2746
|
+
attr_accessor :metadata
|
2747
|
+
# The ID of the price object.
|
2748
|
+
attr_accessor :price
|
2749
|
+
# 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`.
|
2750
|
+
attr_accessor :quantity
|
2751
|
+
# 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`.
|
2752
|
+
attr_accessor :tax_rates
|
2753
|
+
# 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`.
|
2754
|
+
attr_accessor :trial
|
2755
|
+
|
2756
|
+
def initialize(
|
2757
|
+
discounts: nil,
|
2758
|
+
metadata: nil,
|
2759
|
+
price: nil,
|
2760
|
+
quantity: nil,
|
2761
|
+
tax_rates: nil,
|
2762
|
+
trial: nil
|
2763
|
+
)
|
2764
|
+
@discounts = discounts
|
2765
|
+
@metadata = metadata
|
2766
|
+
@price = price
|
2767
|
+
@quantity = quantity
|
2768
|
+
@tax_rates = tax_rates
|
2769
|
+
@trial = trial
|
2770
|
+
end
|
2771
|
+
end
|
2772
|
+
# Details of the subscription item to add. If an item with the same `price` exists, it will be replaced by this new item. Otherwise, it adds the new item.
|
2773
|
+
attr_accessor :add
|
2774
|
+
# Details of the subscription item to remove.
|
2775
|
+
attr_accessor :remove
|
2776
|
+
# Details of the subscription item to replace the existing items with. If an item with the `set[price]` already exists, the `items` array is not cleared. Instead, all of the other `set` properties that are passed in this request will replace the existing values for the configuration item.
|
2777
|
+
attr_accessor :set
|
2778
|
+
# Determines the type of item action.
|
2779
|
+
attr_accessor :type
|
2780
|
+
|
2781
|
+
def initialize(add: nil, remove: nil, set: nil, type: nil)
|
2782
|
+
@add = add
|
2783
|
+
@remove = remove
|
2784
|
+
@set = set
|
2785
|
+
@type = type
|
2786
|
+
end
|
2787
|
+
end
|
2788
|
+
|
2789
|
+
class MetadataAction < Stripe::RequestParams
|
2790
|
+
# Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
|
2791
|
+
attr_accessor :add
|
2792
|
+
# Keys to remove from schedule phase metadata.
|
2793
|
+
attr_accessor :remove
|
2794
|
+
# Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
|
2795
|
+
attr_accessor :set
|
2796
|
+
# Select one of three ways to update phase-level `metadata` on subscription schedules.
|
2797
|
+
attr_accessor :type
|
2798
|
+
|
2799
|
+
def initialize(add: nil, remove: nil, set: nil, type: nil)
|
2800
|
+
@add = add
|
2801
|
+
@remove = remove
|
2802
|
+
@set = set
|
2803
|
+
@type = type
|
2804
|
+
end
|
2805
|
+
end
|
2806
|
+
|
2807
|
+
class SetPauseCollection < Stripe::RequestParams
|
2808
|
+
class Set < Stripe::RequestParams
|
2809
|
+
# The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
2810
|
+
attr_accessor :behavior
|
2811
|
+
|
2812
|
+
def initialize(behavior: nil)
|
2813
|
+
@behavior = behavior
|
2814
|
+
end
|
2815
|
+
end
|
2816
|
+
# Details of the pause_collection behavior to apply to the amendment.
|
2817
|
+
attr_accessor :set
|
2818
|
+
# Determines the type of the pause_collection amendment.
|
2819
|
+
attr_accessor :type
|
2820
|
+
|
2821
|
+
def initialize(set: nil, type: nil)
|
2822
|
+
@set = set
|
2823
|
+
@type = type
|
2824
|
+
end
|
2825
|
+
end
|
2826
|
+
|
2827
|
+
class TrialSettings < Stripe::RequestParams
|
2828
|
+
class EndBehavior < Stripe::RequestParams
|
2829
|
+
# Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
2830
|
+
attr_accessor :prorate_up_front
|
2831
|
+
|
2832
|
+
def initialize(prorate_up_front: nil)
|
2833
|
+
@prorate_up_front = prorate_up_front
|
2834
|
+
end
|
2835
|
+
end
|
2836
|
+
# Defines how the subscription should behave when a trial ends.
|
2837
|
+
attr_accessor :end_behavior
|
2838
|
+
|
2839
|
+
def initialize(end_behavior: nil)
|
2840
|
+
@end_behavior = end_behavior
|
2841
|
+
end
|
2842
|
+
end
|
2843
|
+
# Details to identify the end of the time range modified by the proposed change. If not supplied, the amendment is considered a point-in-time operation that only affects the exact timestamp at `amendment_start`, and a restricted set of attributes is supported on the amendment.
|
2844
|
+
attr_accessor :amendment_end
|
2845
|
+
# Details to identify the earliest timestamp where the proposed change should take effect.
|
2846
|
+
attr_accessor :amendment_start
|
2847
|
+
# For point-in-time amendments (having no `amendment_end`), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the `amendment_start` timestamp.For time-span based amendments (having both `amendment_start` and `amendment_end`), the only value valid is `automatic`, which removes any previously configured billing cycle anchor resets scheduled to occur during the window of time spanned by the amendment.
|
2848
|
+
attr_accessor :billing_cycle_anchor
|
2849
|
+
# Changes to the coupons being redeemed or discounts being applied during the amendment time span.
|
2850
|
+
attr_accessor :discount_actions
|
2851
|
+
# Changes to the subscription items during the amendment time span.
|
2852
|
+
attr_accessor :item_actions
|
2853
|
+
# Instructions for how to modify phase metadata
|
2854
|
+
attr_accessor :metadata_actions
|
2855
|
+
# Changes to how Stripe handles prorations during the amendment time span. Affects if and how prorations are created when a future phase starts. In cases where the amendment changes the currently active phase, it is used to determine whether or how to prorate now, at the time of the request. Also supported as a point-in-time operation when `amendment_end` is `null`.
|
2856
|
+
attr_accessor :proration_behavior
|
2857
|
+
# Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
|
2858
|
+
attr_accessor :set_pause_collection
|
2859
|
+
# Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
|
2860
|
+
attr_accessor :set_schedule_end
|
2861
|
+
# Settings related to subscription trials.
|
2862
|
+
attr_accessor :trial_settings
|
2863
|
+
|
2864
|
+
def initialize(
|
2865
|
+
amendment_end: nil,
|
2866
|
+
amendment_start: nil,
|
2867
|
+
billing_cycle_anchor: nil,
|
2868
|
+
discount_actions: nil,
|
2869
|
+
item_actions: nil,
|
2870
|
+
metadata_actions: nil,
|
2871
|
+
proration_behavior: nil,
|
2872
|
+
set_pause_collection: nil,
|
2873
|
+
set_schedule_end: nil,
|
2874
|
+
trial_settings: nil
|
2875
|
+
)
|
2876
|
+
@amendment_end = amendment_end
|
2877
|
+
@amendment_start = amendment_start
|
2878
|
+
@billing_cycle_anchor = billing_cycle_anchor
|
2879
|
+
@discount_actions = discount_actions
|
2880
|
+
@item_actions = item_actions
|
2881
|
+
@metadata_actions = metadata_actions
|
2882
|
+
@proration_behavior = proration_behavior
|
2883
|
+
@set_pause_collection = set_pause_collection
|
2884
|
+
@set_schedule_end = set_schedule_end
|
2885
|
+
@trial_settings = trial_settings
|
2886
|
+
end
|
2887
|
+
end
|
2888
|
+
|
2108
2889
|
class Phase < Stripe::RequestParams
|
2109
2890
|
class AddInvoiceItem < Stripe::RequestParams
|
2110
2891
|
class Discount < Stripe::RequestParams
|
2892
|
+
class DiscountEnd < Stripe::RequestParams
|
2893
|
+
class Duration < Stripe::RequestParams
|
2894
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
2895
|
+
attr_accessor :interval
|
2896
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
2897
|
+
attr_accessor :interval_count
|
2898
|
+
|
2899
|
+
def initialize(interval: nil, interval_count: nil)
|
2900
|
+
@interval = interval
|
2901
|
+
@interval_count = interval_count
|
2902
|
+
end
|
2903
|
+
end
|
2904
|
+
# Time span for the redeemed discount.
|
2905
|
+
attr_accessor :duration
|
2906
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
2907
|
+
attr_accessor :timestamp
|
2908
|
+
# The type of calculation made to determine when the discount ends.
|
2909
|
+
attr_accessor :type
|
2910
|
+
|
2911
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
2912
|
+
@duration = duration
|
2913
|
+
@timestamp = timestamp
|
2914
|
+
@type = type
|
2915
|
+
end
|
2916
|
+
end
|
2111
2917
|
# ID of the coupon to create a new discount for.
|
2112
2918
|
attr_accessor :coupon
|
2113
2919
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
2114
2920
|
attr_accessor :discount
|
2921
|
+
# Details to determine how long the discount should be applied for.
|
2922
|
+
attr_accessor :discount_end
|
2115
2923
|
# ID of the promotion code to create a new discount for.
|
2116
2924
|
attr_accessor :promotion_code
|
2117
2925
|
|
2118
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
2926
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
2119
2927
|
@coupon = coupon
|
2120
2928
|
@discount = discount
|
2929
|
+
@discount_end = discount_end
|
2121
2930
|
@promotion_code = promotion_code
|
2122
2931
|
end
|
2123
2932
|
end
|
@@ -2198,16 +3007,44 @@ module Stripe
|
|
2198
3007
|
end
|
2199
3008
|
|
2200
3009
|
class Discount < Stripe::RequestParams
|
3010
|
+
class DiscountEnd < Stripe::RequestParams
|
3011
|
+
class Duration < Stripe::RequestParams
|
3012
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
3013
|
+
attr_accessor :interval
|
3014
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
3015
|
+
attr_accessor :interval_count
|
3016
|
+
|
3017
|
+
def initialize(interval: nil, interval_count: nil)
|
3018
|
+
@interval = interval
|
3019
|
+
@interval_count = interval_count
|
3020
|
+
end
|
3021
|
+
end
|
3022
|
+
# Time span for the redeemed discount.
|
3023
|
+
attr_accessor :duration
|
3024
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
3025
|
+
attr_accessor :timestamp
|
3026
|
+
# The type of calculation made to determine when the discount ends.
|
3027
|
+
attr_accessor :type
|
3028
|
+
|
3029
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
3030
|
+
@duration = duration
|
3031
|
+
@timestamp = timestamp
|
3032
|
+
@type = type
|
3033
|
+
end
|
3034
|
+
end
|
2201
3035
|
# ID of the coupon to create a new discount for.
|
2202
3036
|
attr_accessor :coupon
|
2203
3037
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
2204
3038
|
attr_accessor :discount
|
3039
|
+
# Details to determine how long the discount should be applied for.
|
3040
|
+
attr_accessor :discount_end
|
2205
3041
|
# ID of the promotion code to create a new discount for.
|
2206
3042
|
attr_accessor :promotion_code
|
2207
3043
|
|
2208
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
3044
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
2209
3045
|
@coupon = coupon
|
2210
3046
|
@discount = discount
|
3047
|
+
@discount_end = discount_end
|
2211
3048
|
@promotion_code = promotion_code
|
2212
3049
|
end
|
2213
3050
|
end
|
@@ -2240,16 +3077,44 @@ module Stripe
|
|
2240
3077
|
|
2241
3078
|
class Item < Stripe::RequestParams
|
2242
3079
|
class Discount < Stripe::RequestParams
|
3080
|
+
class DiscountEnd < Stripe::RequestParams
|
3081
|
+
class Duration < Stripe::RequestParams
|
3082
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
3083
|
+
attr_accessor :interval
|
3084
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
3085
|
+
attr_accessor :interval_count
|
3086
|
+
|
3087
|
+
def initialize(interval: nil, interval_count: nil)
|
3088
|
+
@interval = interval
|
3089
|
+
@interval_count = interval_count
|
3090
|
+
end
|
3091
|
+
end
|
3092
|
+
# Time span for the redeemed discount.
|
3093
|
+
attr_accessor :duration
|
3094
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
3095
|
+
attr_accessor :timestamp
|
3096
|
+
# The type of calculation made to determine when the discount ends.
|
3097
|
+
attr_accessor :type
|
3098
|
+
|
3099
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
3100
|
+
@duration = duration
|
3101
|
+
@timestamp = timestamp
|
3102
|
+
@type = type
|
3103
|
+
end
|
3104
|
+
end
|
2243
3105
|
# ID of the coupon to create a new discount for.
|
2244
3106
|
attr_accessor :coupon
|
2245
3107
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
2246
3108
|
attr_accessor :discount
|
3109
|
+
# Details to determine how long the discount should be applied for.
|
3110
|
+
attr_accessor :discount_end
|
2247
3111
|
# ID of the promotion code to create a new discount for.
|
2248
3112
|
attr_accessor :promotion_code
|
2249
3113
|
|
2250
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
3114
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
2251
3115
|
@coupon = coupon
|
2252
3116
|
@discount = discount
|
3117
|
+
@discount_end = discount_end
|
2253
3118
|
@promotion_code = promotion_code
|
2254
3119
|
end
|
2255
3120
|
end
|
@@ -2295,6 +3160,18 @@ module Stripe
|
|
2295
3160
|
@unit_amount_decimal = unit_amount_decimal
|
2296
3161
|
end
|
2297
3162
|
end
|
3163
|
+
|
3164
|
+
class Trial < Stripe::RequestParams
|
3165
|
+
# 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.
|
3166
|
+
attr_accessor :converts_to
|
3167
|
+
# Determines the type of trial for this item.
|
3168
|
+
attr_accessor :type
|
3169
|
+
|
3170
|
+
def initialize(converts_to: nil, type: nil)
|
3171
|
+
@converts_to = converts_to
|
3172
|
+
@type = type
|
3173
|
+
end
|
3174
|
+
end
|
2298
3175
|
# The coupons to redeem into discounts for the subscription item.
|
2299
3176
|
attr_accessor :discounts
|
2300
3177
|
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`.
|
@@ -2309,6 +3186,8 @@ module Stripe
|
|
2309
3186
|
attr_accessor :quantity
|
2310
3187
|
# A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
|
2311
3188
|
attr_accessor :tax_rates
|
3189
|
+
# Options that configure the trial on the subscription item.
|
3190
|
+
attr_accessor :trial
|
2312
3191
|
|
2313
3192
|
def initialize(
|
2314
3193
|
discounts: nil,
|
@@ -2317,7 +3196,8 @@ module Stripe
|
|
2317
3196
|
price: nil,
|
2318
3197
|
price_data: nil,
|
2319
3198
|
quantity: nil,
|
2320
|
-
tax_rates: nil
|
3199
|
+
tax_rates: nil,
|
3200
|
+
trial: nil
|
2321
3201
|
)
|
2322
3202
|
@discounts = discounts
|
2323
3203
|
@metadata = metadata
|
@@ -2326,6 +3206,16 @@ module Stripe
|
|
2326
3206
|
@price_data = price_data
|
2327
3207
|
@quantity = quantity
|
2328
3208
|
@tax_rates = tax_rates
|
3209
|
+
@trial = trial
|
3210
|
+
end
|
3211
|
+
end
|
3212
|
+
|
3213
|
+
class PauseCollection < Stripe::RequestParams
|
3214
|
+
# The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
3215
|
+
attr_accessor :behavior
|
3216
|
+
|
3217
|
+
def initialize(behavior: nil)
|
3218
|
+
@behavior = behavior
|
2329
3219
|
end
|
2330
3220
|
end
|
2331
3221
|
|
@@ -2340,6 +3230,23 @@ module Stripe
|
|
2340
3230
|
@destination = destination
|
2341
3231
|
end
|
2342
3232
|
end
|
3233
|
+
|
3234
|
+
class TrialSettings < Stripe::RequestParams
|
3235
|
+
class EndBehavior < Stripe::RequestParams
|
3236
|
+
# Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
3237
|
+
attr_accessor :prorate_up_front
|
3238
|
+
|
3239
|
+
def initialize(prorate_up_front: nil)
|
3240
|
+
@prorate_up_front = prorate_up_front
|
3241
|
+
end
|
3242
|
+
end
|
3243
|
+
# Defines how the subscription should behave when a trial ends.
|
3244
|
+
attr_accessor :end_behavior
|
3245
|
+
|
3246
|
+
def initialize(end_behavior: nil)
|
3247
|
+
@end_behavior = end_behavior
|
3248
|
+
end
|
3249
|
+
end
|
2343
3250
|
# A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items.
|
2344
3251
|
attr_accessor :add_invoice_items
|
2345
3252
|
# A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
|
@@ -2372,6 +3279,8 @@ module Stripe
|
|
2372
3279
|
attr_accessor :metadata
|
2373
3280
|
# The account on behalf of which to charge, for each of the associated subscription's invoices.
|
2374
3281
|
attr_accessor :on_behalf_of
|
3282
|
+
# If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment).
|
3283
|
+
attr_accessor :pause_collection
|
2375
3284
|
# Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase.
|
2376
3285
|
attr_accessor :proration_behavior
|
2377
3286
|
# The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
|
@@ -2380,8 +3289,12 @@ module Stripe
|
|
2380
3289
|
attr_accessor :transfer_data
|
2381
3290
|
# If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
|
2382
3291
|
attr_accessor :trial
|
3292
|
+
# Specify trial behavior when crossing phase boundaries
|
3293
|
+
attr_accessor :trial_continuation
|
2383
3294
|
# Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial`
|
2384
3295
|
attr_accessor :trial_end
|
3296
|
+
# Settings related to subscription trials.
|
3297
|
+
attr_accessor :trial_settings
|
2385
3298
|
|
2386
3299
|
def initialize(
|
2387
3300
|
add_invoice_items: nil,
|
@@ -2400,11 +3313,14 @@ module Stripe
|
|
2400
3313
|
iterations: nil,
|
2401
3314
|
metadata: nil,
|
2402
3315
|
on_behalf_of: nil,
|
3316
|
+
pause_collection: nil,
|
2403
3317
|
proration_behavior: nil,
|
2404
3318
|
start_date: nil,
|
2405
3319
|
transfer_data: nil,
|
2406
3320
|
trial: nil,
|
2407
|
-
|
3321
|
+
trial_continuation: nil,
|
3322
|
+
trial_end: nil,
|
3323
|
+
trial_settings: nil
|
2408
3324
|
)
|
2409
3325
|
@add_invoice_items = add_invoice_items
|
2410
3326
|
@application_fee_percent = application_fee_percent
|
@@ -2422,23 +3338,91 @@ module Stripe
|
|
2422
3338
|
@iterations = iterations
|
2423
3339
|
@metadata = metadata
|
2424
3340
|
@on_behalf_of = on_behalf_of
|
3341
|
+
@pause_collection = pause_collection
|
2425
3342
|
@proration_behavior = proration_behavior
|
2426
3343
|
@start_date = start_date
|
2427
3344
|
@transfer_data = transfer_data
|
2428
3345
|
@trial = trial
|
3346
|
+
@trial_continuation = trial_continuation
|
2429
3347
|
@trial_end = trial_end
|
3348
|
+
@trial_settings = trial_settings
|
3349
|
+
end
|
3350
|
+
end
|
3351
|
+
|
3352
|
+
class Prebilling < Stripe::RequestParams
|
3353
|
+
class BillUntil < Stripe::RequestParams
|
3354
|
+
class AmendmentEnd < Stripe::RequestParams
|
3355
|
+
# The position of the amendment in the `amendments` array at which prebilling should end. Indexes start from 0 and must be less than the total number of supplied amendments.
|
3356
|
+
attr_accessor :index
|
3357
|
+
|
3358
|
+
def initialize(index: nil)
|
3359
|
+
@index = index
|
3360
|
+
end
|
3361
|
+
end
|
3362
|
+
|
3363
|
+
class Duration < Stripe::RequestParams
|
3364
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
3365
|
+
attr_accessor :interval
|
3366
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
3367
|
+
attr_accessor :interval_count
|
3368
|
+
|
3369
|
+
def initialize(interval: nil, interval_count: nil)
|
3370
|
+
@interval = interval
|
3371
|
+
@interval_count = interval_count
|
3372
|
+
end
|
3373
|
+
end
|
3374
|
+
# End the prebilled period when a specified amendment ends.
|
3375
|
+
attr_accessor :amendment_end
|
3376
|
+
# Time span for prebilling, starting from `bill_from`.
|
3377
|
+
attr_accessor :duration
|
3378
|
+
# End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
|
3379
|
+
attr_accessor :timestamp
|
3380
|
+
# Select one of several ways to pass the `bill_until` value.
|
3381
|
+
attr_accessor :type
|
3382
|
+
|
3383
|
+
def initialize(amendment_end: nil, duration: nil, timestamp: nil, type: nil)
|
3384
|
+
@amendment_end = amendment_end
|
3385
|
+
@duration = duration
|
3386
|
+
@timestamp = timestamp
|
3387
|
+
@type = type
|
3388
|
+
end
|
3389
|
+
end
|
3390
|
+
# The end of the prebilled time period.
|
3391
|
+
attr_accessor :bill_until
|
3392
|
+
# This is used to determine the number of billing cycles to prebill.
|
3393
|
+
attr_accessor :iterations
|
3394
|
+
|
3395
|
+
def initialize(bill_until: nil, iterations: nil)
|
3396
|
+
@bill_until = bill_until
|
3397
|
+
@iterations = iterations
|
2430
3398
|
end
|
2431
3399
|
end
|
3400
|
+
# Changes to apply to the phases of the subscription schedule, in the order provided.
|
3401
|
+
attr_accessor :amendments
|
3402
|
+
# 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.
|
3403
|
+
attr_accessor :billing_behavior
|
2432
3404
|
# Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
|
2433
3405
|
attr_accessor :end_behavior
|
2434
3406
|
# List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase.
|
2435
3407
|
attr_accessor :phases
|
3408
|
+
# Provide any time periods to bill in advance.
|
3409
|
+
attr_accessor :prebilling
|
2436
3410
|
# In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.
|
2437
3411
|
attr_accessor :proration_behavior
|
2438
3412
|
|
2439
|
-
def initialize(
|
3413
|
+
def initialize(
|
3414
|
+
amendments: nil,
|
3415
|
+
billing_behavior: nil,
|
3416
|
+
end_behavior: nil,
|
3417
|
+
phases: nil,
|
3418
|
+
prebilling: nil,
|
3419
|
+
proration_behavior: nil
|
3420
|
+
)
|
3421
|
+
@amendments = amendments
|
3422
|
+
@billing_behavior = billing_behavior
|
2440
3423
|
@end_behavior = end_behavior
|
2441
3424
|
@phases = phases
|
3425
|
+
@prebilling = prebilling
|
2442
3426
|
@proration_behavior = proration_behavior
|
2443
3427
|
end
|
2444
3428
|
end
|
@@ -2446,16 +3430,44 @@ module Stripe
|
|
2446
3430
|
class SubscriptionDetails < Stripe::RequestParams
|
2447
3431
|
class Item < Stripe::RequestParams
|
2448
3432
|
class Discount < Stripe::RequestParams
|
3433
|
+
class DiscountEnd < Stripe::RequestParams
|
3434
|
+
class Duration < Stripe::RequestParams
|
3435
|
+
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
3436
|
+
attr_accessor :interval
|
3437
|
+
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
3438
|
+
attr_accessor :interval_count
|
3439
|
+
|
3440
|
+
def initialize(interval: nil, interval_count: nil)
|
3441
|
+
@interval = interval
|
3442
|
+
@interval_count = interval_count
|
3443
|
+
end
|
3444
|
+
end
|
3445
|
+
# Time span for the redeemed discount.
|
3446
|
+
attr_accessor :duration
|
3447
|
+
# A precise Unix timestamp for the discount to end. Must be in the future.
|
3448
|
+
attr_accessor :timestamp
|
3449
|
+
# The type of calculation made to determine when the discount ends.
|
3450
|
+
attr_accessor :type
|
3451
|
+
|
3452
|
+
def initialize(duration: nil, timestamp: nil, type: nil)
|
3453
|
+
@duration = duration
|
3454
|
+
@timestamp = timestamp
|
3455
|
+
@type = type
|
3456
|
+
end
|
3457
|
+
end
|
2449
3458
|
# ID of the coupon to create a new discount for.
|
2450
3459
|
attr_accessor :coupon
|
2451
3460
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
2452
3461
|
attr_accessor :discount
|
3462
|
+
# Details to determine how long the discount should be applied for.
|
3463
|
+
attr_accessor :discount_end
|
2453
3464
|
# ID of the promotion code to create a new discount for.
|
2454
3465
|
attr_accessor :promotion_code
|
2455
3466
|
|
2456
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
3467
|
+
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
2457
3468
|
@coupon = coupon
|
2458
3469
|
@discount = discount
|
3470
|
+
@discount_end = discount_end
|
2459
3471
|
@promotion_code = promotion_code
|
2460
3472
|
end
|
2461
3473
|
end
|
@@ -2546,6 +3558,15 @@ module Stripe
|
|
2546
3558
|
@tax_rates = tax_rates
|
2547
3559
|
end
|
2548
3560
|
end
|
3561
|
+
|
3562
|
+
class Prebilling < Stripe::RequestParams
|
3563
|
+
# This is used to determine the number of billing cycles to prebill.
|
3564
|
+
attr_accessor :iterations
|
3565
|
+
|
3566
|
+
def initialize(iterations: nil)
|
3567
|
+
@iterations = iterations
|
3568
|
+
end
|
3569
|
+
end
|
2549
3570
|
# For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`.
|
2550
3571
|
attr_accessor :billing_cycle_anchor
|
2551
3572
|
# A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.
|
@@ -2558,6 +3579,8 @@ module Stripe
|
|
2558
3579
|
attr_accessor :default_tax_rates
|
2559
3580
|
# A list of up to 20 subscription items, each with an attached price.
|
2560
3581
|
attr_accessor :items
|
3582
|
+
# The pre-billing to apply to the subscription as a preview.
|
3583
|
+
attr_accessor :prebilling
|
2561
3584
|
# Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`.
|
2562
3585
|
attr_accessor :proration_behavior
|
2563
3586
|
# If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'.
|
@@ -2576,6 +3599,7 @@ module Stripe
|
|
2576
3599
|
cancel_now: nil,
|
2577
3600
|
default_tax_rates: nil,
|
2578
3601
|
items: nil,
|
3602
|
+
prebilling: nil,
|
2579
3603
|
proration_behavior: nil,
|
2580
3604
|
proration_date: nil,
|
2581
3605
|
resume_at: nil,
|
@@ -2588,6 +3612,7 @@ module Stripe
|
|
2588
3612
|
@cancel_now = cancel_now
|
2589
3613
|
@default_tax_rates = default_tax_rates
|
2590
3614
|
@items = items
|
3615
|
+
@prebilling = prebilling
|
2591
3616
|
@proration_behavior = proration_behavior
|
2592
3617
|
@proration_date = proration_date
|
2593
3618
|
@resume_at = resume_at
|
@@ -2601,6 +3626,8 @@ module Stripe
|
|
2601
3626
|
attr_accessor :currency
|
2602
3627
|
# The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
|
2603
3628
|
attr_accessor :customer
|
3629
|
+
# The identifier of the account whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_account`, `customer_details`, `subscription`, or `schedule` must be set.
|
3630
|
+
attr_accessor :customer_account
|
2604
3631
|
# Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
|
2605
3632
|
attr_accessor :customer_details
|
2606
3633
|
# The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts.
|
@@ -2628,6 +3655,7 @@ module Stripe
|
|
2628
3655
|
automatic_tax: nil,
|
2629
3656
|
currency: nil,
|
2630
3657
|
customer: nil,
|
3658
|
+
customer_account: nil,
|
2631
3659
|
customer_details: nil,
|
2632
3660
|
discounts: nil,
|
2633
3661
|
expand: nil,
|
@@ -2643,6 +3671,7 @@ module Stripe
|
|
2643
3671
|
@automatic_tax = automatic_tax
|
2644
3672
|
@currency = currency
|
2645
3673
|
@customer = customer
|
3674
|
+
@customer_account = customer_account
|
2646
3675
|
@customer_details = customer_details
|
2647
3676
|
@discounts = discounts
|
2648
3677
|
@expand = expand
|
@@ -2668,12 +3697,54 @@ module Stripe
|
|
2668
3697
|
)
|
2669
3698
|
end
|
2670
3699
|
|
3700
|
+
# Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of payments.
|
3701
|
+
#
|
3702
|
+
# For Out of Band Payment, the payment is credited to the invoice immediately, increasing the amount_paid
|
3703
|
+
# of the invoice and subsequently transitioning the status of the invoice to paid if necessary.
|
3704
|
+
#
|
3705
|
+
# For the PaymentIntent, when the PaymentIntent's status changes to succeeded, the payment is credited
|
3706
|
+
# to the invoice, increasing its amount_paid. When the invoice is fully paid, the
|
3707
|
+
# invoice's status becomes paid.
|
3708
|
+
#
|
3709
|
+
# If the PaymentIntent's status is already succeeded when it's attached, it's
|
3710
|
+
# credited to the invoice immediately.
|
3711
|
+
#
|
3712
|
+
# See: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create) to learn more.
|
3713
|
+
def attach_payment(invoice, params = {}, opts = {})
|
3714
|
+
request(
|
3715
|
+
method: :post,
|
3716
|
+
path: format("/v1/invoices/%<invoice>s/attach_payment", { invoice: CGI.escape(invoice) }),
|
3717
|
+
params: params,
|
3718
|
+
opts: opts,
|
3719
|
+
base_address: :api
|
3720
|
+
)
|
3721
|
+
end
|
3722
|
+
|
3723
|
+
# Attaches a PaymentIntent to the invoice, adding it to the list of payments.
|
3724
|
+
# When the PaymentIntent's status changes to succeeded, the payment is credited
|
3725
|
+
# to the invoice, increasing its amount_paid. When the invoice is fully paid, the
|
3726
|
+
# invoice's status becomes paid.
|
3727
|
+
#
|
3728
|
+
# If the PaymentIntent's status is already succeeded when it is attached, it is
|
3729
|
+
# credited to the invoice immediately.
|
3730
|
+
#
|
3731
|
+
# Related guide: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create)
|
3732
|
+
def attach_payment_intent(invoice, params = {}, opts = {})
|
3733
|
+
request(
|
3734
|
+
method: :post,
|
3735
|
+
path: format("/v1/invoices/%<invoice>s/attach_payment_intent", { invoice: CGI.escape(invoice) }),
|
3736
|
+
params: params,
|
3737
|
+
opts: opts,
|
3738
|
+
base_address: :api
|
3739
|
+
)
|
3740
|
+
end
|
3741
|
+
|
2671
3742
|
# This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or <a href="#send_invoice">send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers.
|
2672
3743
|
def create(params = {}, opts = {})
|
2673
3744
|
request(method: :post, path: "/v1/invoices", params: params, opts: opts, base_address: :api)
|
2674
3745
|
end
|
2675
3746
|
|
2676
|
-
# At any time, you can preview the upcoming invoice for a
|
3747
|
+
# At any time, you can preview the upcoming invoice for a subscription or subscription schedule. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.
|
2677
3748
|
#
|
2678
3749
|
# Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
|
2679
3750
|
#
|