stripe 13.6.0.pre.beta.1 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +699 -1457
- data/OPENAPI_VERSION +1 -1
- data/README.md +29 -0
- data/VERSION +1 -1
- data/lib/stripe/api_requestor.rb +2 -0
- data/lib/stripe/api_version.rb +1 -1
- data/lib/stripe/errors.rb +0 -7
- data/lib/stripe/object_types.rb +0 -26
- data/lib/stripe/resources/account.rb +83 -614
- data/lib/stripe/resources/account_session.rb +1 -247
- data/lib/stripe/resources/apple_pay_domain.rb +0 -9
- data/lib/stripe/resources/application_fee.rb +1 -10
- data/lib/stripe/resources/balance.rb +0 -9
- data/lib/stripe/resources/balance_transaction.rb +2 -11
- data/lib/stripe/resources/bank_account.rb +1 -1
- data/lib/stripe/resources/billing/alert.rb +0 -9
- data/lib/stripe/resources/billing/credit_balance_summary.rb +0 -48
- data/lib/stripe/resources/billing/credit_balance_transaction.rb +0 -9
- data/lib/stripe/resources/billing/credit_grant.rb +4 -13
- data/lib/stripe/resources/billing/meter.rb +1 -10
- data/lib/stripe/resources/billing_portal/configuration.rb +0 -9
- data/lib/stripe/resources/card.rb +2 -4
- data/lib/stripe/resources/charge.rb +35 -1457
- data/lib/stripe/resources/checkout/session.rb +100 -293
- data/lib/stripe/resources/climate/order.rb +0 -9
- data/lib/stripe/resources/climate/product.rb +0 -9
- data/lib/stripe/resources/climate/supplier.rb +0 -9
- data/lib/stripe/resources/confirmation_token.rb +74 -156
- data/lib/stripe/resources/country_spec.rb +0 -9
- data/lib/stripe/resources/coupon.rb +0 -9
- data/lib/stripe/resources/credit_note.rb +14 -35
- data/lib/stripe/resources/credit_note_line_item.rb +14 -12
- data/lib/stripe/resources/customer.rb +12 -28
- data/lib/stripe/resources/customer_balance_transaction.rb +3 -1
- data/lib/stripe/resources/dispute.rb +0 -9
- data/lib/stripe/resources/entitlements/active_entitlement.rb +0 -9
- data/lib/stripe/resources/entitlements/feature.rb +0 -9
- data/lib/stripe/resources/event.rb +0 -40
- data/lib/stripe/resources/exchange_rate.rb +0 -9
- data/lib/stripe/resources/file.rb +0 -9
- data/lib/stripe/resources/file_link.rb +0 -9
- data/lib/stripe/resources/financial_connections/account.rb +0 -23
- data/lib/stripe/resources/financial_connections/session.rb +1 -65
- data/lib/stripe/resources/financial_connections/transaction.rb +0 -9
- data/lib/stripe/resources/forwarding/request.rb +0 -9
- data/lib/stripe/resources/identity/verification_report.rb +0 -9
- data/lib/stripe/resources/identity/verification_session.rb +0 -9
- data/lib/stripe/resources/invoice.rb +225 -5120
- data/lib/stripe/resources/invoice_item.rb +65 -110
- data/lib/stripe/resources/invoice_line_item.rb +106 -89
- data/lib/stripe/resources/invoice_payment.rb +53 -4
- data/lib/stripe/resources/invoice_rendering_template.rb +0 -12
- data/lib/stripe/resources/issuing/authorization.rb +0 -9
- data/lib/stripe/resources/issuing/card.rb +0 -9
- data/lib/stripe/resources/issuing/cardholder.rb +1 -11
- data/lib/stripe/resources/issuing/dispute.rb +0 -9
- data/lib/stripe/resources/issuing/personalization_design.rb +0 -9
- data/lib/stripe/resources/issuing/physical_bundle.rb +0 -9
- data/lib/stripe/resources/issuing/token.rb +0 -9
- data/lib/stripe/resources/issuing/transaction.rb +0 -15
- data/lib/stripe/resources/line_item.rb +0 -28
- data/lib/stripe/resources/mandate.rb +6 -33
- data/lib/stripe/resources/payment_intent.rb +642 -4975
- data/lib/stripe/resources/payment_link.rb +84 -15
- data/lib/stripe/resources/payment_method.rb +74 -187
- data/lib/stripe/resources/payment_method_configuration.rb +87 -214
- data/lib/stripe/resources/payment_method_domain.rb +9 -18
- data/lib/stripe/resources/payout.rb +0 -9
- data/lib/stripe/resources/person.rb +9 -9
- data/lib/stripe/resources/plan.rb +0 -15
- data/lib/stripe/resources/price.rb +2 -47
- data/lib/stripe/resources/product.rb +0 -68
- data/lib/stripe/resources/promotion_code.rb +0 -9
- data/lib/stripe/resources/quote.rb +8 -2037
- data/lib/stripe/resources/radar/early_fraud_warning.rb +0 -9
- data/lib/stripe/resources/radar/value_list.rb +0 -9
- data/lib/stripe/resources/radar/value_list_item.rb +0 -9
- data/lib/stripe/resources/refund.rb +13 -18
- data/lib/stripe/resources/reporting/report_run.rb +0 -9
- data/lib/stripe/resources/reporting/report_type.rb +0 -9
- data/lib/stripe/resources/review.rb +2 -11
- data/lib/stripe/resources/setup_attempt.rb +11 -16
- data/lib/stripe/resources/setup_intent.rb +158 -540
- data/lib/stripe/resources/shipping_rate.rb +0 -9
- data/lib/stripe/resources/sigma/scheduled_query_run.rb +0 -9
- data/lib/stripe/resources/source.rb +0 -41
- data/lib/stripe/resources/subscription.rb +14 -385
- data/lib/stripe/resources/subscription_item.rb +9 -134
- data/lib/stripe/resources/subscription_schedule.rb +14 -1135
- data/lib/stripe/resources/tax/calculation.rb +0 -9
- data/lib/stripe/resources/tax/registration.rb +1 -10
- data/lib/stripe/resources/tax/settings.rb +0 -9
- data/lib/stripe/resources/tax/transaction.rb +0 -9
- data/lib/stripe/resources/tax_code.rb +0 -9
- data/lib/stripe/resources/tax_id.rb +0 -9
- data/lib/stripe/resources/tax_rate.rb +0 -9
- data/lib/stripe/resources/terminal/configuration.rb +214 -14
- data/lib/stripe/resources/terminal/location.rb +0 -9
- data/lib/stripe/resources/terminal/reader.rb +0 -408
- data/lib/stripe/resources/test_helpers/test_clock.rb +0 -9
- data/lib/stripe/resources/token.rb +1 -10
- data/lib/stripe/resources/topup.rb +0 -9
- data/lib/stripe/resources/transfer.rb +0 -9
- data/lib/stripe/resources/treasury/credit_reversal.rb +0 -9
- data/lib/stripe/resources/treasury/debit_reversal.rb +0 -9
- data/lib/stripe/resources/treasury/financial_account.rb +4 -32
- data/lib/stripe/resources/treasury/financial_account_features.rb +0 -2
- data/lib/stripe/resources/treasury/inbound_transfer.rb +0 -9
- data/lib/stripe/resources/treasury/outbound_payment.rb +0 -9
- data/lib/stripe/resources/treasury/outbound_transfer.rb +0 -46
- data/lib/stripe/resources/treasury/received_credit.rb +1 -47
- data/lib/stripe/resources/treasury/received_debit.rb +1 -49
- data/lib/stripe/resources/treasury/transaction.rb +0 -9
- data/lib/stripe/resources/treasury/transaction_entry.rb +0 -9
- data/lib/stripe/resources/v2/event.rb +1 -0
- data/lib/stripe/resources/v2/event_destination.rb +1 -0
- data/lib/stripe/resources/webhook_endpoint.rb +0 -9
- data/lib/stripe/resources.rb +0 -25
- data/lib/stripe/services/account_external_account_service.rb +1 -1
- data/lib/stripe/services/account_service.rb +68 -509
- data/lib/stripe/services/account_session_service.rb +1 -217
- data/lib/stripe/services/balance_transaction_service.rb +1 -1
- data/lib/stripe/services/billing/credit_balance_summary_service.rb +2 -2
- data/lib/stripe/services/billing/credit_grant_service.rb +2 -2
- data/lib/stripe/services/billing/meter_service.rb +1 -1
- data/lib/stripe/services/charge_service.rb +1 -1335
- data/lib/stripe/services/checkout/session_service.rb +60 -168
- data/lib/stripe/services/credit_note_preview_lines_service.rb +0 -4
- data/lib/stripe/services/credit_note_service.rb +0 -8
- data/lib/stripe/services/customer_service.rb +0 -16
- data/lib/stripe/services/financial_connections/account_service.rb +1 -3
- data/lib/stripe/services/financial_connections/session_service.rb +1 -30
- data/lib/stripe/services/financial_connections_service.rb +1 -2
- data/lib/stripe/services/invoice_item_service.rb +34 -88
- data/lib/stripe/services/invoice_line_item_service.rb +25 -41
- data/lib/stripe/services/invoice_payment_service.rb +33 -5
- data/lib/stripe/services/invoice_service.rb +210 -3147
- data/lib/stripe/services/issuing/cardholder_service.rb +1 -2
- data/lib/stripe/services/issuing/transaction_service.rb +0 -4
- data/lib/stripe/services/issuing_service.rb +1 -5
- data/lib/stripe/services/payment_intent_service.rb +568 -4513
- data/lib/stripe/services/payment_link_service.rb +59 -6
- data/lib/stripe/services/payment_method_configuration_service.rb +62 -146
- data/lib/stripe/services/payment_method_domain_service.rb +6 -6
- data/lib/stripe/services/payment_method_service.rb +49 -119
- data/lib/stripe/services/plan_service.rb +0 -4
- data/lib/stripe/services/price_service.rb +2 -25
- data/lib/stripe/services/product_service.rb +0 -38
- data/lib/stripe/services/quote_service.rb +9 -1716
- data/lib/stripe/services/setup_intent_service.rb +158 -492
- data/lib/stripe/services/subscription_item_service.rb +5 -111
- data/lib/stripe/services/subscription_schedule_service.rb +14 -1005
- data/lib/stripe/services/subscription_service.rb +13 -323
- data/lib/stripe/services/tax/registration_service.rb +1 -1
- data/lib/stripe/services/tax_service.rb +1 -3
- data/lib/stripe/services/terminal/configuration_service.rb +170 -4
- data/lib/stripe/services/terminal/reader_service.rb +0 -177
- data/lib/stripe/services/terminal_service.rb +1 -2
- data/lib/stripe/services/test_helpers/confirmation_token_service.rb +49 -87
- data/lib/stripe/services/test_helpers/terminal/reader_service.rb +0 -43
- data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +1 -25
- data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +1 -25
- data/lib/stripe/services/token_service.rb +1 -1
- data/lib/stripe/services/treasury/financial_account_features_service.rb +1 -4
- data/lib/stripe/services/treasury/financial_account_service.rb +3 -17
- data/lib/stripe/services/treasury/outbound_transfer_service.rb +0 -24
- data/lib/stripe/services/v1_services.rb +2 -8
- data/lib/stripe/services/v2/core/event_destination_service.rb +1 -4
- data/lib/stripe/services/v2/core/event_service.rb +1 -4
- data/lib/stripe/services.rb +0 -27
- data/lib/stripe/stripe_client.rb +1 -0
- data/lib/stripe/stripe_configuration.rb +1 -3
- data/lib/stripe/util.rb +1 -7
- data/lib/stripe/version.rb +1 -1
- data/lib/stripe.rb +0 -45
- data/rbi/stripe/resources/account.rbi +1131 -1479
- data/rbi/stripe/resources/account_link.rbi +9 -9
- data/rbi/stripe/resources/account_session.rbi +118 -367
- data/rbi/stripe/resources/apple_pay_domain.rbi +8 -15
- data/rbi/stripe/resources/application_fee.rbi +15 -20
- data/rbi/stripe/resources/apps/secret.rbi +20 -20
- data/rbi/stripe/resources/balance.rbi +0 -7
- data/rbi/stripe/resources/balance_transaction.rbi +19 -24
- data/rbi/stripe/resources/bank_account.rbi +1 -1
- data/rbi/stripe/resources/billing/alert.rbi +23 -28
- data/rbi/stripe/resources/billing/credit_balance_summary.rbi +0 -53
- data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +6 -13
- data/rbi/stripe/resources/billing/credit_grant.rbi +30 -37
- data/rbi/stripe/resources/billing/meter.rbi +19 -26
- data/rbi/stripe/resources/billing/meter_event.rbi +4 -4
- data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +5 -5
- data/rbi/stripe/resources/billing_portal/configuration.rbi +86 -81
- data/rbi/stripe/resources/billing_portal/session.rbi +31 -27
- data/rbi/stripe/resources/card.rbi +2 -5
- data/rbi/stripe/resources/charge.rbi +136 -1576
- data/rbi/stripe/resources/checkout/session.rbi +631 -748
- data/rbi/stripe/resources/climate/order.rbi +20 -25
- data/rbi/stripe/resources/climate/product.rbi +5 -12
- data/rbi/stripe/resources/climate/supplier.rbi +5 -12
- data/rbi/stripe/resources/confirmation_token.rbi +274 -268
- data/rbi/stripe/resources/country_spec.rbi +5 -12
- data/rbi/stripe/resources/coupon.rbi +34 -39
- data/rbi/stripe/resources/credit_note.rbi +134 -146
- data/rbi/stripe/resources/credit_note_line_item.rbi +20 -18
- data/rbi/stripe/resources/customer.rbi +172 -164
- data/rbi/stripe/resources/customer_balance_transaction.rbi +4 -1
- data/rbi/stripe/resources/customer_session.rbi +19 -15
- data/rbi/stripe/resources/dispute.rbi +92 -95
- data/rbi/stripe/resources/entitlements/active_entitlement.rbi +5 -12
- data/rbi/stripe/resources/entitlements/feature.rbi +15 -22
- data/rbi/stripe/resources/ephemeral_key.rbi +2 -2
- data/rbi/stripe/resources/event.rbi +16 -60
- data/rbi/stripe/resources/exchange_rate.rbi +5 -12
- data/rbi/stripe/resources/file.rbi +20 -25
- data/rbi/stripe/resources/file_link.rbi +23 -28
- data/rbi/stripe/resources/financial_connections/account.rbi +25 -44
- data/rbi/stripe/resources/financial_connections/session.rbi +12 -75
- data/rbi/stripe/resources/financial_connections/transaction.rbi +16 -19
- data/rbi/stripe/resources/forwarding/request.rbi +21 -24
- data/rbi/stripe/resources/identity/verification_report.rbi +18 -21
- data/rbi/stripe/resources/identity/verification_session.rbi +60 -61
- data/rbi/stripe/resources/invoice.rbi +723 -5918
- data/rbi/stripe/resources/invoice_item.rbi +138 -177
- data/rbi/stripe/resources/invoice_line_item.rbi +199 -264
- data/rbi/stripe/resources/invoice_payment.rbi +51 -7
- data/rbi/stripe/resources/invoice_rendering_template.rbi +10 -20
- data/rbi/stripe/resources/issuing/authorization.rbi +216 -199
- data/rbi/stripe/resources/issuing/card.rbi +104 -101
- data/rbi/stripe/resources/issuing/cardholder.rbi +120 -108
- data/rbi/stripe/resources/issuing/dispute.rbi +164 -151
- data/rbi/stripe/resources/issuing/personalization_design.rbi +61 -56
- data/rbi/stripe/resources/issuing/physical_bundle.rbi +7 -14
- data/rbi/stripe/resources/issuing/token.rbi +16 -21
- data/rbi/stripe/resources/issuing/transaction.rbi +180 -176
- data/rbi/stripe/resources/line_item.rbi +0 -36
- data/rbi/stripe/resources/mandate.rbi +8 -40
- data/rbi/stripe/resources/payment_intent.rbi +2252 -6482
- data/rbi/stripe/resources/payment_link.rbi +346 -211
- data/rbi/stripe/resources/payment_method.rbi +226 -330
- data/rbi/stripe/resources/payment_method_configuration.rbi +602 -685
- data/rbi/stripe/resources/payment_method_domain.rbi +26 -31
- data/rbi/stripe/resources/payout.rbi +43 -42
- data/rbi/stripe/resources/person.rbi +9 -9
- data/rbi/stripe/resources/plan.rbi +51 -63
- data/rbi/stripe/resources/price.rbi +114 -151
- data/rbi/stripe/resources/product.rbi +90 -152
- data/rbi/stripe/resources/promotion_code.rbi +42 -47
- data/rbi/stripe/resources/quote.rbi +168 -2231
- data/rbi/stripe/resources/radar/early_fraud_warning.rbi +17 -20
- data/rbi/stripe/resources/radar/value_list.rbi +24 -29
- data/rbi/stripe/resources/radar/value_list_item.rbi +18 -21
- data/rbi/stripe/resources/refund.rbi +52 -51
- data/rbi/stripe/resources/reporting/report_run.rbi +27 -30
- data/rbi/stripe/resources/reporting/report_type.rbi +2 -9
- data/rbi/stripe/resources/review.rbi +17 -22
- data/rbi/stripe/resources/setup_attempt.rbi +25 -32
- data/rbi/stripe/resources/setup_intent.rbi +900 -1102
- data/rbi/stripe/resources/shipping_rate.rbi +41 -46
- data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +5 -12
- data/rbi/stripe/resources/source.rbi +132 -179
- data/rbi/stripe/resources/subscription.rbi +363 -707
- data/rbi/stripe/resources/subscription_item.rbi +69 -177
- data/rbi/stripe/resources/subscription_schedule.rbi +289 -1447
- data/rbi/stripe/resources/tax/calculation.rbi +43 -48
- data/rbi/stripe/resources/tax/registration.rbi +217 -170
- data/rbi/stripe/resources/tax/settings.rbi +14 -21
- data/rbi/stripe/resources/tax/transaction.rbi +20 -25
- data/rbi/stripe/resources/tax_code.rbi +5 -12
- data/rbi/stripe/resources/tax_id.rbi +15 -22
- data/rbi/stripe/resources/tax_rate.rbi +34 -39
- data/rbi/stripe/resources/terminal/configuration.rbi +457 -212
- data/rbi/stripe/resources/terminal/connection_token.rbi +3 -3
- data/rbi/stripe/resources/terminal/location.rbi +28 -35
- data/rbi/stripe/resources/terminal/reader.rbi +71 -441
- data/rbi/stripe/resources/test_helpers/test_clock.rbi +12 -17
- data/rbi/stripe/resources/token.rbi +288 -263
- data/rbi/stripe/resources/topup.rbi +35 -38
- data/rbi/stripe/resources/transfer.rbi +27 -32
- data/rbi/stripe/resources/treasury/credit_reversal.rbi +10 -17
- data/rbi/stripe/resources/treasury/debit_reversal.rbi +11 -18
- data/rbi/stripe/resources/treasury/financial_account.rbi +125 -130
- data/rbi/stripe/resources/treasury/financial_account_features.rbi +0 -3
- data/rbi/stripe/resources/treasury/inbound_transfer.rbi +22 -29
- data/rbi/stripe/resources/treasury/outbound_payment.rbi +82 -79
- data/rbi/stripe/resources/treasury/outbound_transfer.rbi +44 -86
- data/rbi/stripe/resources/treasury/received_credit.rbi +18 -64
- data/rbi/stripe/resources/treasury/received_debit.rbi +17 -66
- data/rbi/stripe/resources/treasury/transaction.rbi +27 -28
- data/rbi/stripe/resources/treasury/transaction_entry.rbi +25 -26
- data/rbi/stripe/resources/v2/amount.rbi +1 -1
- data/rbi/stripe/resources/v2/event.rbi +1 -0
- data/rbi/stripe/resources/v2/event_destination.rbi +1 -0
- data/rbi/stripe/resources/webhook_endpoint.rbi +18 -25
- data/rbi/stripe/services/account_capability_service.rbi +7 -7
- data/rbi/stripe/services/account_external_account_service.rbi +52 -52
- data/rbi/stripe/services/account_link_service.rbi +9 -9
- data/rbi/stripe/services/account_login_link_service.rbi +2 -2
- data/rbi/stripe/services/account_person_service.rbi +221 -201
- data/rbi/stripe/services/account_service.rbi +1221 -1345
- data/rbi/stripe/services/account_session_service.rbi +115 -346
- data/rbi/stripe/services/apple_pay_domain_service.rbi +10 -10
- data/rbi/stripe/services/application_fee_refund_service.rbi +16 -14
- data/rbi/stripe/services/application_fee_service.rbi +18 -14
- data/rbi/stripe/services/apps/secret_service.rbi +20 -20
- data/rbi/stripe/services/balance_service.rbi +2 -2
- data/rbi/stripe/services/balance_transaction_service.rbi +22 -18
- data/rbi/stripe/services/billing/alert_service.rbi +23 -23
- data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +10 -10
- data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +8 -8
- data/rbi/stripe/services/billing/credit_grant_service.rbi +32 -30
- data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +7 -5
- data/rbi/stripe/services/billing/meter_event_service.rbi +4 -4
- data/rbi/stripe/services/billing/meter_event_summary_service.rbi +6 -6
- data/rbi/stripe/services/billing/meter_service.rbi +21 -21
- data/rbi/stripe/services/billing_portal/configuration_service.rbi +90 -76
- data/rbi/stripe/services/billing_portal/session_service.rbi +29 -27
- data/rbi/stripe/services/charge_service.rbi +96 -1464
- data/rbi/stripe/services/checkout/session_line_item_service.rbi +5 -5
- data/rbi/stripe/services/checkout/session_service.rbi +555 -591
- data/rbi/stripe/services/climate/order_service.rbi +22 -20
- data/rbi/stripe/services/climate/product_service.rbi +7 -7
- data/rbi/stripe/services/climate/supplier_service.rbi +7 -7
- data/rbi/stripe/services/confirmation_token_service.rbi +2 -2
- data/rbi/stripe/services/country_spec_service.rbi +7 -7
- data/rbi/stripe/services/coupon_service.rbi +40 -34
- data/rbi/stripe/services/credit_note_line_item_service.rbi +5 -5
- data/rbi/stripe/services/credit_note_preview_lines_service.rbi +35 -35
- data/rbi/stripe/services/credit_note_service.rbi +81 -85
- data/rbi/stripe/services/customer_balance_transaction_service.rbi +15 -15
- data/rbi/stripe/services/customer_cash_balance_service.rbi +7 -7
- data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +7 -7
- data/rbi/stripe/services/customer_funding_instructions_service.rbi +5 -5
- data/rbi/stripe/services/customer_payment_method_service.rbi +9 -9
- data/rbi/stripe/services/customer_payment_source_service.rbi +48 -44
- data/rbi/stripe/services/customer_service.rbi +143 -139
- data/rbi/stripe/services/customer_session_service.rbi +21 -15
- data/rbi/stripe/services/customer_tax_id_service.rbi +9 -9
- data/rbi/stripe/services/dispute_service.rbi +92 -90
- data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +7 -7
- data/rbi/stripe/services/entitlements/feature_service.rbi +17 -17
- data/rbi/stripe/services/ephemeral_key_service.rbi +8 -8
- data/rbi/stripe/services/event_service.rbi +18 -16
- data/rbi/stripe/services/exchange_rate_service.rbi +7 -7
- data/rbi/stripe/services/file_link_service.rbi +25 -23
- data/rbi/stripe/services/file_service.rbi +22 -20
- data/rbi/stripe/services/financial_connections/account_owner_service.rbi +5 -5
- data/rbi/stripe/services/financial_connections/account_service.rbi +22 -21
- data/rbi/stripe/services/financial_connections/session_service.rbi +16 -39
- data/rbi/stripe/services/financial_connections/transaction_service.rbi +16 -14
- data/rbi/stripe/services/financial_connections_service.rbi +0 -1
- data/rbi/stripe/services/forwarding/request_service.rbi +21 -19
- data/rbi/stripe/services/identity/verification_report_service.rbi +18 -16
- data/rbi/stripe/services/identity/verification_session_service.rbi +62 -56
- data/rbi/stripe/services/invoice_item_service.rbi +99 -155
- data/rbi/stripe/services/invoice_line_item_service.rbi +71 -82
- data/rbi/stripe/services/invoice_payment_service.rbi +39 -12
- data/rbi/stripe/services/invoice_rendering_template_service.rbi +13 -13
- data/rbi/stripe/services/invoice_service.rbi +679 -3799
- data/rbi/stripe/services/issuing/authorization_service.rbi +32 -26
- data/rbi/stripe/services/issuing/card_service.rbi +102 -86
- data/rbi/stripe/services/issuing/cardholder_service.rbi +122 -103
- data/rbi/stripe/services/issuing/dispute_service.rbi +152 -146
- data/rbi/stripe/services/issuing/personalization_design_service.rbi +52 -42
- data/rbi/stripe/services/issuing/physical_bundle_service.rbi +9 -9
- data/rbi/stripe/services/issuing/token_service.rbi +20 -16
- data/rbi/stripe/services/issuing/transaction_service.rbi +25 -23
- data/rbi/stripe/services/issuing_service.rbi +0 -3
- data/rbi/stripe/services/mandate_service.rbi +2 -2
- data/rbi/stripe/services/payment_intent_service.rbi +2312 -6081
- data/rbi/stripe/services/payment_link_line_item_service.rbi +5 -5
- data/rbi/stripe/services/payment_link_service.rbi +303 -201
- data/rbi/stripe/services/payment_method_configuration_service.rbi +616 -620
- data/rbi/stripe/services/payment_method_domain_service.rbi +25 -23
- data/rbi/stripe/services/payment_method_service.rbi +192 -249
- data/rbi/stripe/services/payout_service.rbi +45 -37
- data/rbi/stripe/services/plan_service.rbi +53 -55
- data/rbi/stripe/services/price_service.rbi +124 -129
- data/rbi/stripe/services/product_feature_service.rbi +9 -9
- data/rbi/stripe/services/product_service.rbi +94 -122
- data/rbi/stripe/services/promotion_code_service.rbi +46 -42
- data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +5 -5
- data/rbi/stripe/services/quote_line_item_service.rbi +5 -5
- data/rbi/stripe/services/quote_service.rbi +159 -1863
- data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +17 -15
- data/rbi/stripe/services/radar/value_list_item_service.rbi +20 -16
- data/rbi/stripe/services/radar/value_list_service.rbi +28 -24
- data/rbi/stripe/services/refund_service.rbi +37 -33
- data/rbi/stripe/services/reporting/report_run_service.rbi +29 -25
- data/rbi/stripe/services/reporting/report_type_service.rbi +4 -4
- data/rbi/stripe/services/review_service.rbi +17 -15
- data/rbi/stripe/services/setup_attempt_service.rbi +13 -11
- data/rbi/stripe/services/setup_intent_service.rbi +1028 -1062
- data/rbi/stripe/services/shipping_rate_service.rbi +47 -41
- data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +7 -7
- data/rbi/stripe/services/source_service.rbi +149 -133
- data/rbi/stripe/services/source_transaction_service.rbi +5 -5
- data/rbi/stripe/services/subscription_item_service.rbi +61 -159
- data/rbi/stripe/services/subscription_schedule_service.rbi +289 -1305
- data/rbi/stripe/services/subscription_service.rbi +366 -640
- data/rbi/stripe/services/tax/calculation_line_item_service.rbi +5 -5
- data/rbi/stripe/services/tax/calculation_service.rbi +40 -38
- data/rbi/stripe/services/tax/registration_service.rbi +337 -165
- data/rbi/stripe/services/tax/settings_service.rbi +16 -16
- data/rbi/stripe/services/tax/transaction_line_item_service.rbi +5 -5
- data/rbi/stripe/services/tax/transaction_service.rbi +19 -15
- data/rbi/stripe/services/tax_code_service.rbi +7 -7
- data/rbi/stripe/services/tax_id_service.rbi +17 -17
- data/rbi/stripe/services/tax_rate_service.rbi +36 -34
- data/rbi/stripe/services/tax_service.rbi +0 -2
- data/rbi/stripe/services/terminal/configuration_service.rbi +464 -204
- data/rbi/stripe/services/terminal/connection_token_service.rbi +3 -3
- data/rbi/stripe/services/terminal/location_service.rbi +30 -30
- data/rbi/stripe/services/terminal/reader_service.rbi +57 -226
- data/rbi/stripe/services/terminal_service.rbi +0 -1
- data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +157 -198
- data/rbi/stripe/services/test_helpers/customer_service.rbi +3 -3
- data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +180 -168
- data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +10 -10
- data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +11 -9
- data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +151 -145
- data/rbi/stripe/services/test_helpers/refund_service.rbi +2 -2
- data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +10 -39
- data/rbi/stripe/services/test_helpers/test_clock_service.rbi +14 -12
- data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +9 -9
- data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +20 -18
- data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +20 -18
- data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +11 -38
- data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +11 -38
- data/rbi/stripe/services/token_service.rbi +292 -258
- data/rbi/stripe/services/topup_service.rbi +37 -33
- data/rbi/stripe/services/transfer_reversal_service.rbi +18 -16
- data/rbi/stripe/services/transfer_service.rbi +29 -27
- data/rbi/stripe/services/treasury/credit_reversal_service.rbi +12 -12
- data/rbi/stripe/services/treasury/debit_reversal_service.rbi +13 -13
- data/rbi/stripe/services/treasury/financial_account_features_service.rbi +23 -26
- data/rbi/stripe/services/treasury/financial_account_service.rbi +92 -96
- data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +15 -15
- data/rbi/stripe/services/treasury/outbound_payment_service.rbi +60 -56
- data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +24 -49
- data/rbi/stripe/services/treasury/received_credit_service.rbi +11 -9
- data/rbi/stripe/services/treasury/received_debit_service.rbi +8 -8
- data/rbi/stripe/services/treasury/transaction_entry_service.rbi +25 -21
- data/rbi/stripe/services/treasury/transaction_service.rbi +31 -23
- data/rbi/stripe/services/v1_services.rbi +1 -7
- data/rbi/stripe/services/v2/billing/meter_event_service.rbi +3 -3
- data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +3 -3
- data/rbi/stripe/services/v2/core/event_destination_service.rbi +21 -24
- data/rbi/stripe/services/v2/core/event_service.rbi +3 -6
- data/rbi/stripe/services/webhook_endpoint_service.rbi +20 -20
- metadata +4 -109
- data/lib/stripe/request_signing_authenticator.rb +0 -79
- data/lib/stripe/resources/account_notice.rb +0 -132
- data/lib/stripe/resources/billing/meter_error_report.rb +0 -59
- data/lib/stripe/resources/capital/financing_offer.rb +0 -188
- data/lib/stripe/resources/capital/financing_summary.rb +0 -64
- data/lib/stripe/resources/capital/financing_transaction.rb +0 -123
- data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +0 -27
- data/lib/stripe/resources/financial_connections/institution.rb +0 -99
- data/lib/stripe/resources/gift_cards/card.rb +0 -217
- data/lib/stripe/resources/gift_cards/transaction.rb +0 -281
- data/lib/stripe/resources/issuing/credit_underwriting_record.rb +0 -611
- data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +0 -84
- data/lib/stripe/resources/issuing/fraud_liability_debit.rb +0 -95
- data/lib/stripe/resources/issuing/settlement.rb +0 -49
- data/lib/stripe/resources/margin.rb +0 -124
- data/lib/stripe/resources/order.rb +0 -2868
- data/lib/stripe/resources/payment_attempt_record.rb +0 -184
- data/lib/stripe/resources/payment_record.rb +0 -715
- data/lib/stripe/resources/quote_line.rb +0 -274
- data/lib/stripe/resources/quote_preview_invoice.rb +0 -652
- data/lib/stripe/resources/quote_preview_subscription_schedule.rb +0 -362
- data/lib/stripe/resources/tax/association.rb +0 -89
- data/lib/stripe/resources/tax/form.rb +0 -220
- data/lib/stripe/resources/terminal/reader_collected_data.rb +0 -40
- data/lib/stripe/resources/usage_record.rb +0 -30
- data/lib/stripe/resources/usage_record_summary.rb +0 -33
- data/lib/stripe/services/account_notice_service.rb +0 -101
- data/lib/stripe/services/capital/financing_offer_service.rb +0 -112
- data/lib/stripe/services/capital/financing_summary_service.rb +0 -28
- data/lib/stripe/services/capital/financing_transaction_service.rb +0 -79
- data/lib/stripe/services/capital_service.rb +0 -15
- data/lib/stripe/services/financial_connections/account_inferred_balance_service.rb +0 -37
- data/lib/stripe/services/financial_connections/institution_service.rb +0 -57
- data/lib/stripe/services/gift_cards/card_service.rb +0 -170
- data/lib/stripe/services/gift_cards/transaction_service.rb +0 -209
- data/lib/stripe/services/gift_cards_service.rb +0 -14
- data/lib/stripe/services/invoice_upcoming_lines_service.rb +0 -1881
- data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +0 -504
- data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +0 -66
- data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +0 -83
- data/lib/stripe/services/margin_service.rb +0 -119
- data/lib/stripe/services/order_line_item_service.rb +0 -35
- data/lib/stripe/services/order_service.rb +0 -2268
- data/lib/stripe/services/payment_attempt_record_service.rb +0 -49
- data/lib/stripe/services/payment_record_service.rb +0 -542
- data/lib/stripe/services/quote_line_service.rb +0 -35
- data/lib/stripe/services/quote_preview_invoice_service.rb +0 -35
- data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +0 -35
- data/lib/stripe/services/subscription_item_usage_record_service.rb +0 -41
- data/lib/stripe/services/subscription_item_usage_record_summary_service.rb +0 -37
- data/lib/stripe/services/tax/association_service.rb +0 -31
- data/lib/stripe/services/tax/form_service.rb +0 -100
- data/lib/stripe/services/terminal/reader_collected_data_service.rb +0 -28
- data/rbi/stripe/resources/account_notice.rbi +0 -139
- data/rbi/stripe/resources/billing/meter_error_report.rbi +0 -71
- data/rbi/stripe/resources/capital/financing_offer.rbi +0 -190
- data/rbi/stripe/resources/capital/financing_summary.rbi +0 -74
- data/rbi/stripe/resources/capital/financing_transaction.rbi +0 -130
- data/rbi/stripe/resources/financial_connections/account_inferred_balance.rbi +0 -27
- data/rbi/stripe/resources/financial_connections/institution.rbi +0 -99
- data/rbi/stripe/resources/gift_cards/card.rbi +0 -206
- data/rbi/stripe/resources/gift_cards/transaction.rbi +0 -257
- data/rbi/stripe/resources/issuing/credit_underwriting_record.rbi +0 -622
- data/rbi/stripe/resources/issuing/dispute_settlement_detail.rbi +0 -83
- data/rbi/stripe/resources/issuing/fraud_liability_debit.rbi +0 -90
- data/rbi/stripe/resources/issuing/settlement.rbi +0 -62
- data/rbi/stripe/resources/margin.rbi +0 -127
- data/rbi/stripe/resources/order.rbi +0 -3036
- data/rbi/stripe/resources/payment_attempt_record.rbi +0 -215
- data/rbi/stripe/resources/payment_record.rbi +0 -722
- data/rbi/stripe/resources/quote_line.rbi +0 -350
- data/rbi/stripe/resources/quote_preview_invoice.rbi +0 -850
- data/rbi/stripe/resources/quote_preview_subscription_schedule.rbi +0 -474
- data/rbi/stripe/resources/tax/association.rbi +0 -94
- data/rbi/stripe/resources/tax/form.rbi +0 -224
- data/rbi/stripe/resources/terminal/reader_collected_data.rbi +0 -41
- data/rbi/stripe/resources/usage_record.rbi +0 -32
- data/rbi/stripe/resources/usage_record_summary.rbi +0 -38
- data/rbi/stripe/services/account_notice_service.rbi +0 -90
- data/rbi/stripe/services/capital/financing_offer_service.rbi +0 -95
- data/rbi/stripe/services/capital/financing_summary_service.rbi +0 -22
- data/rbi/stripe/services/capital/financing_transaction_service.rbi +0 -68
- data/rbi/stripe/services/capital_service.rbi +0 -11
- data/rbi/stripe/services/financial_connections/account_inferred_balance_service.rbi +0 -33
- data/rbi/stripe/services/financial_connections/institution_service.rbi +0 -46
- data/rbi/stripe/services/gift_cards/card_service.rbi +0 -142
- data/rbi/stripe/services/gift_cards/transaction_service.rbi +0 -174
- data/rbi/stripe/services/gift_cards_service.rbi +0 -10
- data/rbi/stripe/services/invoice_upcoming_lines_service.rbi +0 -2023
- data/rbi/stripe/services/issuing/credit_underwriting_record_service.rbi +0 -498
- data/rbi/stripe/services/issuing/dispute_settlement_detail_service.rbi +0 -55
- data/rbi/stripe/services/issuing/fraud_liability_debit_service.rbi +0 -73
- data/rbi/stripe/services/margin_service.rbi +0 -104
- data/rbi/stripe/services/order_line_item_service.rbi +0 -31
- data/rbi/stripe/services/order_service.rbi +0 -2320
- data/rbi/stripe/services/payment_attempt_record_service.rbi +0 -36
- data/rbi/stripe/services/payment_record_service.rbi +0 -521
- data/rbi/stripe/services/quote_line_service.rbi +0 -31
- data/rbi/stripe/services/quote_preview_invoice_service.rbi +0 -31
- data/rbi/stripe/services/quote_preview_subscription_schedule_service.rbi +0 -31
- data/rbi/stripe/services/subscription_item_usage_record_service.rbi +0 -37
- data/rbi/stripe/services/subscription_item_usage_record_summary_service.rbi +0 -33
- data/rbi/stripe/services/tax/association_service.rbi +0 -25
- data/rbi/stripe/services/tax/form_service.rbi +0 -85
- data/rbi/stripe/services/terminal/reader_collected_data_service.rbi +0 -22
@@ -3,13 +3,11 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
class InvoiceService < StripeService
|
6
|
-
attr_reader :
|
6
|
+
attr_reader :line_items
|
7
7
|
|
8
8
|
def initialize(requestor)
|
9
9
|
super(requestor)
|
10
|
-
@payments = Stripe::InvoicePaymentService.new(@requestor)
|
11
10
|
@line_items = Stripe::InvoiceLineItemService.new(@requestor)
|
12
|
-
@upcoming_lines = Stripe::InvoiceUpcomingLinesService.new(@requestor)
|
13
11
|
end
|
14
12
|
|
15
13
|
class DeleteParams < Stripe::RequestParams
|
@@ -25,24 +23,6 @@ module Stripe
|
|
25
23
|
end
|
26
24
|
|
27
25
|
class UpdateParams < Stripe::RequestParams
|
28
|
-
class AmountsDue < Stripe::RequestParams
|
29
|
-
# The amount in cents (or local equivalent).
|
30
|
-
attr_accessor :amount
|
31
|
-
# Number of days from when invoice is finalized until the payment is due.
|
32
|
-
attr_accessor :days_until_due
|
33
|
-
# An arbitrary string attached to the object. Often useful for displaying to users.
|
34
|
-
attr_accessor :description
|
35
|
-
# Date on which a payment plan’s payment is due.
|
36
|
-
attr_accessor :due_date
|
37
|
-
|
38
|
-
def initialize(amount: nil, days_until_due: nil, description: nil, due_date: nil)
|
39
|
-
@amount = amount
|
40
|
-
@days_until_due = days_until_due
|
41
|
-
@description = description
|
42
|
-
@due_date = due_date
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
26
|
class AutomaticTax < Stripe::RequestParams
|
47
27
|
class Liability < Stripe::RequestParams
|
48
28
|
# The connected account being referenced when `type` is `account`.
|
@@ -79,44 +59,16 @@ module Stripe
|
|
79
59
|
end
|
80
60
|
|
81
61
|
class Discount < Stripe::RequestParams
|
82
|
-
class DiscountEnd < Stripe::RequestParams
|
83
|
-
class Duration < Stripe::RequestParams
|
84
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
85
|
-
attr_accessor :interval
|
86
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
87
|
-
attr_accessor :interval_count
|
88
|
-
|
89
|
-
def initialize(interval: nil, interval_count: nil)
|
90
|
-
@interval = interval
|
91
|
-
@interval_count = interval_count
|
92
|
-
end
|
93
|
-
end
|
94
|
-
# Time span for the redeemed discount.
|
95
|
-
attr_accessor :duration
|
96
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
97
|
-
attr_accessor :timestamp
|
98
|
-
# The type of calculation made to determine when the discount ends.
|
99
|
-
attr_accessor :type
|
100
|
-
|
101
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
102
|
-
@duration = duration
|
103
|
-
@timestamp = timestamp
|
104
|
-
@type = type
|
105
|
-
end
|
106
|
-
end
|
107
62
|
# ID of the coupon to create a new discount for.
|
108
63
|
attr_accessor :coupon
|
109
64
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
110
65
|
attr_accessor :discount
|
111
|
-
# Details to determine how long the discount should be applied for.
|
112
|
-
attr_accessor :discount_end
|
113
66
|
# ID of the promotion code to create a new discount for.
|
114
67
|
attr_accessor :promotion_code
|
115
68
|
|
116
|
-
def initialize(coupon: nil, discount: nil,
|
69
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
117
70
|
@coupon = coupon
|
118
71
|
@discount = discount
|
119
|
-
@discount_end = discount_end
|
120
72
|
@promotion_code = promotion_code
|
121
73
|
end
|
122
74
|
end
|
@@ -236,9 +188,6 @@ module Stripe
|
|
236
188
|
end
|
237
189
|
end
|
238
190
|
|
239
|
-
class IdBankTransfer < Stripe::RequestParams
|
240
|
-
end
|
241
|
-
|
242
191
|
class Konbini < Stripe::RequestParams
|
243
192
|
end
|
244
193
|
|
@@ -250,12 +199,9 @@ module Stripe
|
|
250
199
|
class Filters < Stripe::RequestParams
|
251
200
|
# The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
|
252
201
|
attr_accessor :account_subcategories
|
253
|
-
# ID of the institution to use to filter for selectable accounts.
|
254
|
-
attr_accessor :institution
|
255
202
|
|
256
|
-
def initialize(account_subcategories: nil
|
203
|
+
def initialize(account_subcategories: nil)
|
257
204
|
@account_subcategories = account_subcategories
|
258
|
-
@institution = institution
|
259
205
|
end
|
260
206
|
end
|
261
207
|
# Provide filters for the linked accounts that the customer can select for the payment method.
|
@@ -289,8 +235,6 @@ module Stripe
|
|
289
235
|
attr_accessor :card
|
290
236
|
# If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
|
291
237
|
attr_accessor :customer_balance
|
292
|
-
# 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.
|
293
|
-
attr_accessor :id_bank_transfer
|
294
238
|
# If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
|
295
239
|
attr_accessor :konbini
|
296
240
|
# 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.
|
@@ -303,7 +247,6 @@ module Stripe
|
|
303
247
|
bancontact: nil,
|
304
248
|
card: nil,
|
305
249
|
customer_balance: nil,
|
306
|
-
id_bank_transfer: nil,
|
307
250
|
konbini: nil,
|
308
251
|
sepa_debit: nil,
|
309
252
|
us_bank_account: nil
|
@@ -312,7 +255,6 @@ module Stripe
|
|
312
255
|
@bancontact = bancontact
|
313
256
|
@card = card
|
314
257
|
@customer_balance = customer_balance
|
315
|
-
@id_bank_transfer = id_bank_transfer
|
316
258
|
@konbini = konbini
|
317
259
|
@sepa_debit = sepa_debit
|
318
260
|
@us_bank_account = us_bank_account
|
@@ -524,8 +466,6 @@ module Stripe
|
|
524
466
|
end
|
525
467
|
# The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
|
526
468
|
attr_accessor :account_tax_ids
|
527
|
-
# List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`.
|
528
|
-
attr_accessor :amounts_due
|
529
469
|
# 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).
|
530
470
|
attr_accessor :application_fee_amount
|
531
471
|
# Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice.
|
@@ -540,8 +480,6 @@ module Stripe
|
|
540
480
|
attr_accessor :custom_fields
|
541
481
|
# 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.
|
542
482
|
attr_accessor :days_until_due
|
543
|
-
# The ids of the margins to apply to the invoice. Can be overridden by line item `margins`.
|
544
|
-
attr_accessor :default_margins
|
545
483
|
# 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.
|
546
484
|
attr_accessor :default_payment_method
|
547
485
|
# 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.
|
@@ -583,7 +521,6 @@ module Stripe
|
|
583
521
|
|
584
522
|
def initialize(
|
585
523
|
account_tax_ids: nil,
|
586
|
-
amounts_due: nil,
|
587
524
|
application_fee_amount: nil,
|
588
525
|
auto_advance: nil,
|
589
526
|
automatic_tax: nil,
|
@@ -591,7 +528,6 @@ module Stripe
|
|
591
528
|
collection_method: nil,
|
592
529
|
custom_fields: nil,
|
593
530
|
days_until_due: nil,
|
594
|
-
default_margins: nil,
|
595
531
|
default_payment_method: nil,
|
596
532
|
default_source: nil,
|
597
533
|
default_tax_rates: nil,
|
@@ -613,7 +549,6 @@ module Stripe
|
|
613
549
|
transfer_data: nil
|
614
550
|
)
|
615
551
|
@account_tax_ids = account_tax_ids
|
616
|
-
@amounts_due = amounts_due
|
617
552
|
@application_fee_amount = application_fee_amount
|
618
553
|
@auto_advance = auto_advance
|
619
554
|
@automatic_tax = automatic_tax
|
@@ -621,7 +556,6 @@ module Stripe
|
|
621
556
|
@collection_method = collection_method
|
622
557
|
@custom_fields = custom_fields
|
623
558
|
@days_until_due = days_until_due
|
624
|
-
@default_margins = default_margins
|
625
559
|
@default_payment_method = default_payment_method
|
626
560
|
@default_source = default_source
|
627
561
|
@default_tax_rates = default_tax_rates
|
@@ -727,24 +661,6 @@ module Stripe
|
|
727
661
|
end
|
728
662
|
|
729
663
|
class CreateParams < Stripe::RequestParams
|
730
|
-
class AmountsDue < Stripe::RequestParams
|
731
|
-
# The amount in cents (or local equivalent).
|
732
|
-
attr_accessor :amount
|
733
|
-
# Number of days from when invoice is finalized until the payment is due.
|
734
|
-
attr_accessor :days_until_due
|
735
|
-
# An arbitrary string attached to the object. Often useful for displaying to users.
|
736
|
-
attr_accessor :description
|
737
|
-
# Date on which a payment plan’s payment is due.
|
738
|
-
attr_accessor :due_date
|
739
|
-
|
740
|
-
def initialize(amount: nil, days_until_due: nil, description: nil, due_date: nil)
|
741
|
-
@amount = amount
|
742
|
-
@days_until_due = days_until_due
|
743
|
-
@description = description
|
744
|
-
@due_date = due_date
|
745
|
-
end
|
746
|
-
end
|
747
|
-
|
748
664
|
class AutomaticTax < Stripe::RequestParams
|
749
665
|
class Liability < Stripe::RequestParams
|
750
666
|
# The connected account being referenced when `type` is `account`.
|
@@ -781,44 +697,16 @@ module Stripe
|
|
781
697
|
end
|
782
698
|
|
783
699
|
class Discount < Stripe::RequestParams
|
784
|
-
class DiscountEnd < Stripe::RequestParams
|
785
|
-
class Duration < Stripe::RequestParams
|
786
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
787
|
-
attr_accessor :interval
|
788
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
789
|
-
attr_accessor :interval_count
|
790
|
-
|
791
|
-
def initialize(interval: nil, interval_count: nil)
|
792
|
-
@interval = interval
|
793
|
-
@interval_count = interval_count
|
794
|
-
end
|
795
|
-
end
|
796
|
-
# Time span for the redeemed discount.
|
797
|
-
attr_accessor :duration
|
798
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
799
|
-
attr_accessor :timestamp
|
800
|
-
# The type of calculation made to determine when the discount ends.
|
801
|
-
attr_accessor :type
|
802
|
-
|
803
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
804
|
-
@duration = duration
|
805
|
-
@timestamp = timestamp
|
806
|
-
@type = type
|
807
|
-
end
|
808
|
-
end
|
809
700
|
# ID of the coupon to create a new discount for.
|
810
701
|
attr_accessor :coupon
|
811
702
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
812
703
|
attr_accessor :discount
|
813
|
-
# Details to determine how long the discount should be applied for.
|
814
|
-
attr_accessor :discount_end
|
815
704
|
# ID of the promotion code to create a new discount for.
|
816
705
|
attr_accessor :promotion_code
|
817
706
|
|
818
|
-
def initialize(coupon: nil, discount: nil,
|
707
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
819
708
|
@coupon = coupon
|
820
709
|
@discount = discount
|
821
|
-
@discount_end = discount_end
|
822
710
|
@promotion_code = promotion_code
|
823
711
|
end
|
824
712
|
end
|
@@ -950,9 +838,6 @@ module Stripe
|
|
950
838
|
end
|
951
839
|
end
|
952
840
|
|
953
|
-
class IdBankTransfer < Stripe::RequestParams
|
954
|
-
end
|
955
|
-
|
956
841
|
class Konbini < Stripe::RequestParams
|
957
842
|
end
|
958
843
|
|
@@ -964,12 +849,9 @@ module Stripe
|
|
964
849
|
class Filters < Stripe::RequestParams
|
965
850
|
# The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
|
966
851
|
attr_accessor :account_subcategories
|
967
|
-
# ID of the institution to use to filter for selectable accounts.
|
968
|
-
attr_accessor :institution
|
969
852
|
|
970
|
-
def initialize(account_subcategories: nil
|
853
|
+
def initialize(account_subcategories: nil)
|
971
854
|
@account_subcategories = account_subcategories
|
972
|
-
@institution = institution
|
973
855
|
end
|
974
856
|
end
|
975
857
|
# Provide filters for the linked accounts that the customer can select for the payment method.
|
@@ -1003,8 +885,6 @@ module Stripe
|
|
1003
885
|
attr_accessor :card
|
1004
886
|
# If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
|
1005
887
|
attr_accessor :customer_balance
|
1006
|
-
# 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.
|
1007
|
-
attr_accessor :id_bank_transfer
|
1008
888
|
# If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
|
1009
889
|
attr_accessor :konbini
|
1010
890
|
# 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.
|
@@ -1017,7 +897,6 @@ module Stripe
|
|
1017
897
|
bancontact: nil,
|
1018
898
|
card: nil,
|
1019
899
|
customer_balance: nil,
|
1020
|
-
id_bank_transfer: nil,
|
1021
900
|
konbini: nil,
|
1022
901
|
sepa_debit: nil,
|
1023
902
|
us_bank_account: nil
|
@@ -1026,7 +905,6 @@ module Stripe
|
|
1026
905
|
@bancontact = bancontact
|
1027
906
|
@card = card
|
1028
907
|
@customer_balance = customer_balance
|
1029
|
-
@id_bank_transfer = id_bank_transfer
|
1030
908
|
@konbini = konbini
|
1031
909
|
@sepa_debit = sepa_debit
|
1032
910
|
@us_bank_account = us_bank_account
|
@@ -1238,8 +1116,6 @@ module Stripe
|
|
1238
1116
|
end
|
1239
1117
|
# The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
|
1240
1118
|
attr_accessor :account_tax_ids
|
1241
|
-
# List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`.
|
1242
|
-
attr_accessor :amounts_due
|
1243
1119
|
# 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).
|
1244
1120
|
attr_accessor :application_fee_amount
|
1245
1121
|
# 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.
|
@@ -1258,8 +1134,6 @@ module Stripe
|
|
1258
1134
|
attr_accessor :customer
|
1259
1135
|
# The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`.
|
1260
1136
|
attr_accessor :days_until_due
|
1261
|
-
# The ids of the margins to apply to the invoice. Can be overridden by line item `margins`.
|
1262
|
-
attr_accessor :default_margins
|
1263
1137
|
# 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.
|
1264
1138
|
attr_accessor :default_payment_method
|
1265
1139
|
# 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.
|
@@ -1307,7 +1181,6 @@ module Stripe
|
|
1307
1181
|
|
1308
1182
|
def initialize(
|
1309
1183
|
account_tax_ids: nil,
|
1310
|
-
amounts_due: nil,
|
1311
1184
|
application_fee_amount: nil,
|
1312
1185
|
auto_advance: nil,
|
1313
1186
|
automatic_tax: nil,
|
@@ -1317,7 +1190,6 @@ module Stripe
|
|
1317
1190
|
custom_fields: nil,
|
1318
1191
|
customer: nil,
|
1319
1192
|
days_until_due: nil,
|
1320
|
-
default_margins: nil,
|
1321
1193
|
default_payment_method: nil,
|
1322
1194
|
default_source: nil,
|
1323
1195
|
default_tax_rates: nil,
|
@@ -1342,7 +1214,6 @@ module Stripe
|
|
1342
1214
|
transfer_data: nil
|
1343
1215
|
)
|
1344
1216
|
@account_tax_ids = account_tax_ids
|
1345
|
-
@amounts_due = amounts_due
|
1346
1217
|
@application_fee_amount = application_fee_amount
|
1347
1218
|
@auto_advance = auto_advance
|
1348
1219
|
@automatic_tax = automatic_tax
|
@@ -1352,7 +1223,6 @@ module Stripe
|
|
1352
1223
|
@custom_fields = custom_fields
|
1353
1224
|
@customer = customer
|
1354
1225
|
@days_until_due = days_until_due
|
1355
|
-
@default_margins = default_margins
|
1356
1226
|
@default_payment_method = default_payment_method
|
1357
1227
|
@default_source = default_source
|
1358
1228
|
@default_tax_rates = default_tax_rates
|
@@ -1396,230 +1266,19 @@ module Stripe
|
|
1396
1266
|
end
|
1397
1267
|
end
|
1398
1268
|
|
1399
|
-
class
|
1400
|
-
class
|
1401
|
-
class Liability < Stripe::RequestParams
|
1402
|
-
# The connected account being referenced when `type` is `account`.
|
1403
|
-
attr_accessor :account
|
1404
|
-
# Type of the account referenced in the request.
|
1405
|
-
attr_accessor :type
|
1406
|
-
|
1407
|
-
def initialize(account: nil, type: nil)
|
1408
|
-
@account = account
|
1409
|
-
@type = type
|
1410
|
-
end
|
1411
|
-
end
|
1412
|
-
# Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.
|
1413
|
-
attr_accessor :enabled
|
1414
|
-
# The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
|
1415
|
-
attr_accessor :liability
|
1416
|
-
|
1417
|
-
def initialize(enabled: nil, liability: nil)
|
1418
|
-
@enabled = enabled
|
1419
|
-
@liability = liability
|
1420
|
-
end
|
1421
|
-
end
|
1422
|
-
|
1423
|
-
class CustomerDetails < Stripe::RequestParams
|
1424
|
-
class Address < Stripe::RequestParams
|
1425
|
-
# City, district, suburb, town, or village.
|
1426
|
-
attr_accessor :city
|
1427
|
-
# Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
|
1428
|
-
attr_accessor :country
|
1429
|
-
# Address line 1 (e.g., street, PO Box, or company name).
|
1430
|
-
attr_accessor :line1
|
1431
|
-
# Address line 2 (e.g., apartment, suite, unit, or building).
|
1432
|
-
attr_accessor :line2
|
1433
|
-
# ZIP or postal code.
|
1434
|
-
attr_accessor :postal_code
|
1435
|
-
# State, county, province, or region.
|
1436
|
-
attr_accessor :state
|
1437
|
-
|
1438
|
-
def initialize(
|
1439
|
-
city: nil,
|
1440
|
-
country: nil,
|
1441
|
-
line1: nil,
|
1442
|
-
line2: nil,
|
1443
|
-
postal_code: nil,
|
1444
|
-
state: nil
|
1445
|
-
)
|
1446
|
-
@city = city
|
1447
|
-
@country = country
|
1448
|
-
@line1 = line1
|
1449
|
-
@line2 = line2
|
1450
|
-
@postal_code = postal_code
|
1451
|
-
@state = state
|
1452
|
-
end
|
1453
|
-
end
|
1454
|
-
|
1455
|
-
class Shipping < Stripe::RequestParams
|
1456
|
-
class Address < Stripe::RequestParams
|
1457
|
-
# City, district, suburb, town, or village.
|
1458
|
-
attr_accessor :city
|
1459
|
-
# A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
|
1460
|
-
attr_accessor :country
|
1461
|
-
# Address line 1 (e.g., street, PO Box, or company name).
|
1462
|
-
attr_accessor :line1
|
1463
|
-
# Address line 2 (e.g., apartment, suite, unit, or building).
|
1464
|
-
attr_accessor :line2
|
1465
|
-
# ZIP or postal code.
|
1466
|
-
attr_accessor :postal_code
|
1467
|
-
# State, county, province, or region.
|
1468
|
-
attr_accessor :state
|
1469
|
-
|
1470
|
-
def initialize(
|
1471
|
-
city: nil,
|
1472
|
-
country: nil,
|
1473
|
-
line1: nil,
|
1474
|
-
line2: nil,
|
1475
|
-
postal_code: nil,
|
1476
|
-
state: nil
|
1477
|
-
)
|
1478
|
-
@city = city
|
1479
|
-
@country = country
|
1480
|
-
@line1 = line1
|
1481
|
-
@line2 = line2
|
1482
|
-
@postal_code = postal_code
|
1483
|
-
@state = state
|
1484
|
-
end
|
1485
|
-
end
|
1486
|
-
# Customer shipping address.
|
1487
|
-
attr_accessor :address
|
1488
|
-
# Customer name.
|
1489
|
-
attr_accessor :name
|
1490
|
-
# Customer phone (including extension).
|
1491
|
-
attr_accessor :phone
|
1492
|
-
|
1493
|
-
def initialize(address: nil, name: nil, phone: nil)
|
1494
|
-
@address = address
|
1495
|
-
@name = name
|
1496
|
-
@phone = phone
|
1497
|
-
end
|
1498
|
-
end
|
1499
|
-
|
1500
|
-
class Tax < Stripe::RequestParams
|
1501
|
-
# A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes.
|
1502
|
-
attr_accessor :ip_address
|
1503
|
-
|
1504
|
-
def initialize(ip_address: nil)
|
1505
|
-
@ip_address = ip_address
|
1506
|
-
end
|
1507
|
-
end
|
1508
|
-
|
1509
|
-
class TaxId < Stripe::RequestParams
|
1510
|
-
# Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin`
|
1511
|
-
attr_accessor :type
|
1512
|
-
# Value of the tax ID.
|
1513
|
-
attr_accessor :value
|
1514
|
-
|
1515
|
-
def initialize(type: nil, value: nil)
|
1516
|
-
@type = type
|
1517
|
-
@value = value
|
1518
|
-
end
|
1519
|
-
end
|
1520
|
-
# The customer's address.
|
1521
|
-
attr_accessor :address
|
1522
|
-
# The customer's shipping information. Appears on invoices emailed to this customer.
|
1523
|
-
attr_accessor :shipping
|
1524
|
-
# Tax details about the customer.
|
1525
|
-
attr_accessor :tax
|
1526
|
-
# The customer's tax exemption. One of `none`, `exempt`, or `reverse`.
|
1527
|
-
attr_accessor :tax_exempt
|
1528
|
-
# The customer's tax IDs.
|
1529
|
-
attr_accessor :tax_ids
|
1530
|
-
|
1531
|
-
def initialize(address: nil, shipping: nil, tax: nil, tax_exempt: nil, tax_ids: nil)
|
1532
|
-
@address = address
|
1533
|
-
@shipping = shipping
|
1534
|
-
@tax = tax
|
1535
|
-
@tax_exempt = tax_exempt
|
1536
|
-
@tax_ids = tax_ids
|
1537
|
-
end
|
1538
|
-
end
|
1539
|
-
|
1540
|
-
class Discount < Stripe::RequestParams
|
1541
|
-
class DiscountEnd < Stripe::RequestParams
|
1542
|
-
class Duration < Stripe::RequestParams
|
1543
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1544
|
-
attr_accessor :interval
|
1545
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1546
|
-
attr_accessor :interval_count
|
1547
|
-
|
1548
|
-
def initialize(interval: nil, interval_count: nil)
|
1549
|
-
@interval = interval
|
1550
|
-
@interval_count = interval_count
|
1551
|
-
end
|
1552
|
-
end
|
1553
|
-
# Time span for the redeemed discount.
|
1554
|
-
attr_accessor :duration
|
1555
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1556
|
-
attr_accessor :timestamp
|
1557
|
-
# The type of calculation made to determine when the discount ends.
|
1558
|
-
attr_accessor :type
|
1559
|
-
|
1560
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
1561
|
-
@duration = duration
|
1562
|
-
@timestamp = timestamp
|
1563
|
-
@type = type
|
1564
|
-
end
|
1565
|
-
end
|
1566
|
-
# ID of the coupon to create a new discount for.
|
1567
|
-
attr_accessor :coupon
|
1568
|
-
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
1569
|
-
attr_accessor :discount
|
1570
|
-
# Details to determine how long the discount should be applied for.
|
1571
|
-
attr_accessor :discount_end
|
1572
|
-
# ID of the promotion code to create a new discount for.
|
1573
|
-
attr_accessor :promotion_code
|
1574
|
-
|
1575
|
-
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
1576
|
-
@coupon = coupon
|
1577
|
-
@discount = discount
|
1578
|
-
@discount_end = discount_end
|
1579
|
-
@promotion_code = promotion_code
|
1580
|
-
end
|
1581
|
-
end
|
1582
|
-
|
1583
|
-
class InvoiceItem < Stripe::RequestParams
|
1269
|
+
class AddLinesParams < Stripe::RequestParams
|
1270
|
+
class Line < Stripe::RequestParams
|
1584
1271
|
class Discount < Stripe::RequestParams
|
1585
|
-
class DiscountEnd < Stripe::RequestParams
|
1586
|
-
class Duration < Stripe::RequestParams
|
1587
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1588
|
-
attr_accessor :interval
|
1589
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1590
|
-
attr_accessor :interval_count
|
1591
|
-
|
1592
|
-
def initialize(interval: nil, interval_count: nil)
|
1593
|
-
@interval = interval
|
1594
|
-
@interval_count = interval_count
|
1595
|
-
end
|
1596
|
-
end
|
1597
|
-
# Time span for the redeemed discount.
|
1598
|
-
attr_accessor :duration
|
1599
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1600
|
-
attr_accessor :timestamp
|
1601
|
-
# The type of calculation made to determine when the discount ends.
|
1602
|
-
attr_accessor :type
|
1603
|
-
|
1604
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
1605
|
-
@duration = duration
|
1606
|
-
@timestamp = timestamp
|
1607
|
-
@type = type
|
1608
|
-
end
|
1609
|
-
end
|
1610
1272
|
# ID of the coupon to create a new discount for.
|
1611
1273
|
attr_accessor :coupon
|
1612
1274
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
1613
1275
|
attr_accessor :discount
|
1614
|
-
# Details to determine how long the discount should be applied for.
|
1615
|
-
attr_accessor :discount_end
|
1616
1276
|
# ID of the promotion code to create a new discount for.
|
1617
1277
|
attr_accessor :promotion_code
|
1618
1278
|
|
1619
|
-
def initialize(coupon: nil, discount: nil,
|
1279
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1620
1280
|
@coupon = coupon
|
1621
1281
|
@discount = discount
|
1622
|
-
@discount_end = discount_end
|
1623
1282
|
@promotion_code = promotion_code
|
1624
1283
|
end
|
1625
1284
|
end
|
@@ -1637,13 +1296,35 @@ module Stripe
|
|
1637
1296
|
end
|
1638
1297
|
|
1639
1298
|
class PriceData < Stripe::RequestParams
|
1299
|
+
class ProductData < Stripe::RequestParams
|
1300
|
+
# The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
|
1301
|
+
attr_accessor :description
|
1302
|
+
# A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
|
1303
|
+
attr_accessor :images
|
1304
|
+
# 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`.
|
1305
|
+
attr_accessor :metadata
|
1306
|
+
# The product's name, meant to be displayable to the customer.
|
1307
|
+
attr_accessor :name
|
1308
|
+
# A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
|
1309
|
+
attr_accessor :tax_code
|
1310
|
+
|
1311
|
+
def initialize(description: nil, images: nil, metadata: nil, name: nil, tax_code: nil)
|
1312
|
+
@description = description
|
1313
|
+
@images = images
|
1314
|
+
@metadata = metadata
|
1315
|
+
@name = name
|
1316
|
+
@tax_code = tax_code
|
1317
|
+
end
|
1318
|
+
end
|
1640
1319
|
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
1641
1320
|
attr_accessor :currency
|
1642
|
-
# The ID of the
|
1321
|
+
# The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required.
|
1643
1322
|
attr_accessor :product
|
1323
|
+
# Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required.
|
1324
|
+
attr_accessor :product_data
|
1644
1325
|
# Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
|
1645
1326
|
attr_accessor :tax_behavior
|
1646
|
-
# A
|
1327
|
+
# A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
|
1647
1328
|
attr_accessor :unit_amount
|
1648
1329
|
# Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
|
1649
1330
|
attr_accessor :unit_amount_decimal
|
@@ -1651,1708 +1332,26 @@ module Stripe
|
|
1651
1332
|
def initialize(
|
1652
1333
|
currency: nil,
|
1653
1334
|
product: nil,
|
1335
|
+
product_data: nil,
|
1654
1336
|
tax_behavior: nil,
|
1655
1337
|
unit_amount: nil,
|
1656
1338
|
unit_amount_decimal: nil
|
1657
1339
|
)
|
1658
1340
|
@currency = currency
|
1659
1341
|
@product = product
|
1342
|
+
@product_data = product_data
|
1660
1343
|
@tax_behavior = tax_behavior
|
1661
1344
|
@unit_amount = unit_amount
|
1662
1345
|
@unit_amount_decimal = unit_amount_decimal
|
1663
1346
|
end
|
1664
1347
|
end
|
1665
|
-
# The integer amount in cents (or local equivalent) of previewed invoice item.
|
1666
|
-
attr_accessor :amount
|
1667
|
-
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Only applicable to new invoice items.
|
1668
|
-
attr_accessor :currency
|
1669
|
-
# An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
|
1670
|
-
attr_accessor :description
|
1671
|
-
# Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items.
|
1672
|
-
attr_accessor :discountable
|
1673
|
-
# The coupons to redeem into discounts for the invoice item in the preview.
|
1674
|
-
attr_accessor :discounts
|
1675
|
-
# The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice.
|
1676
|
-
attr_accessor :invoiceitem
|
1677
|
-
# 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`.
|
1678
|
-
attr_accessor :metadata
|
1679
|
-
# 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.
|
1680
|
-
attr_accessor :period
|
1681
|
-
# The ID of the price object. One of `price` or `price_data` is required.
|
1682
|
-
attr_accessor :price
|
1683
|
-
# Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
|
1684
|
-
attr_accessor :price_data
|
1685
|
-
# Non-negative integer. The quantity of units for the invoice item.
|
1686
|
-
attr_accessor :quantity
|
1687
|
-
# Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
|
1688
|
-
attr_accessor :tax_behavior
|
1689
|
-
# A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
|
1690
|
-
attr_accessor :tax_code
|
1691
|
-
# The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item.
|
1692
|
-
attr_accessor :tax_rates
|
1693
|
-
# The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount.
|
1694
|
-
attr_accessor :unit_amount
|
1695
|
-
# Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
|
1696
|
-
attr_accessor :unit_amount_decimal
|
1697
|
-
|
1698
|
-
def initialize(
|
1699
|
-
amount: nil,
|
1700
|
-
currency: nil,
|
1701
|
-
description: nil,
|
1702
|
-
discountable: nil,
|
1703
|
-
discounts: nil,
|
1704
|
-
invoiceitem: nil,
|
1705
|
-
metadata: nil,
|
1706
|
-
period: nil,
|
1707
|
-
price: nil,
|
1708
|
-
price_data: nil,
|
1709
|
-
quantity: nil,
|
1710
|
-
tax_behavior: nil,
|
1711
|
-
tax_code: nil,
|
1712
|
-
tax_rates: nil,
|
1713
|
-
unit_amount: nil,
|
1714
|
-
unit_amount_decimal: nil
|
1715
|
-
)
|
1716
|
-
@amount = amount
|
1717
|
-
@currency = currency
|
1718
|
-
@description = description
|
1719
|
-
@discountable = discountable
|
1720
|
-
@discounts = discounts
|
1721
|
-
@invoiceitem = invoiceitem
|
1722
|
-
@metadata = metadata
|
1723
|
-
@period = period
|
1724
|
-
@price = price
|
1725
|
-
@price_data = price_data
|
1726
|
-
@quantity = quantity
|
1727
|
-
@tax_behavior = tax_behavior
|
1728
|
-
@tax_code = tax_code
|
1729
|
-
@tax_rates = tax_rates
|
1730
|
-
@unit_amount = unit_amount
|
1731
|
-
@unit_amount_decimal = unit_amount_decimal
|
1732
|
-
end
|
1733
|
-
end
|
1734
|
-
|
1735
|
-
class Issuer < Stripe::RequestParams
|
1736
|
-
# The connected account being referenced when `type` is `account`.
|
1737
|
-
attr_accessor :account
|
1738
|
-
# Type of the account referenced in the request.
|
1739
|
-
attr_accessor :type
|
1740
|
-
|
1741
|
-
def initialize(account: nil, type: nil)
|
1742
|
-
@account = account
|
1743
|
-
@type = type
|
1744
|
-
end
|
1745
|
-
end
|
1746
|
-
|
1747
|
-
class ScheduleDetails < Stripe::RequestParams
|
1748
|
-
class Amendment < Stripe::RequestParams
|
1749
|
-
class AmendmentEnd < Stripe::RequestParams
|
1750
|
-
class DiscountEnd < Stripe::RequestParams
|
1751
|
-
# The ID of a specific discount.
|
1752
|
-
attr_accessor :discount
|
1753
|
-
|
1754
|
-
def initialize(discount: nil)
|
1755
|
-
@discount = discount
|
1756
|
-
end
|
1757
|
-
end
|
1758
|
-
|
1759
|
-
class Duration < Stripe::RequestParams
|
1760
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1761
|
-
attr_accessor :interval
|
1762
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1763
|
-
attr_accessor :interval_count
|
1764
|
-
|
1765
|
-
def initialize(interval: nil, interval_count: nil)
|
1766
|
-
@interval = interval
|
1767
|
-
@interval_count = interval_count
|
1768
|
-
end
|
1769
|
-
end
|
1770
|
-
# Use the `end` time of a given discount.
|
1771
|
-
attr_accessor :discount_end
|
1772
|
-
# Time span for the amendment starting from the `amendment_start`.
|
1773
|
-
attr_accessor :duration
|
1774
|
-
# A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
|
1775
|
-
attr_accessor :timestamp
|
1776
|
-
# Select one of three ways to pass the `amendment_end`.
|
1777
|
-
attr_accessor :type
|
1778
|
-
|
1779
|
-
def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
|
1780
|
-
@discount_end = discount_end
|
1781
|
-
@duration = duration
|
1782
|
-
@timestamp = timestamp
|
1783
|
-
@type = type
|
1784
|
-
end
|
1785
|
-
end
|
1786
|
-
|
1787
|
-
class AmendmentStart < Stripe::RequestParams
|
1788
|
-
class AmendmentEnd < Stripe::RequestParams
|
1789
|
-
# 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.
|
1790
|
-
attr_accessor :index
|
1791
|
-
|
1792
|
-
def initialize(index: nil)
|
1793
|
-
@index = index
|
1794
|
-
end
|
1795
|
-
end
|
1796
|
-
|
1797
|
-
class DiscountEnd < Stripe::RequestParams
|
1798
|
-
# The ID of a specific discount.
|
1799
|
-
attr_accessor :discount
|
1800
|
-
|
1801
|
-
def initialize(discount: nil)
|
1802
|
-
@discount = discount
|
1803
|
-
end
|
1804
|
-
end
|
1805
|
-
# Details of another amendment in the same array, immediately after which this amendment should begin.
|
1806
|
-
attr_accessor :amendment_end
|
1807
|
-
# Use the `end` time of a given discount.
|
1808
|
-
attr_accessor :discount_end
|
1809
|
-
# A precise Unix timestamp for the amendment to start.
|
1810
|
-
attr_accessor :timestamp
|
1811
|
-
# Select one of three ways to pass the `amendment_start`.
|
1812
|
-
attr_accessor :type
|
1813
|
-
|
1814
|
-
def initialize(amendment_end: nil, discount_end: nil, timestamp: nil, type: nil)
|
1815
|
-
@amendment_end = amendment_end
|
1816
|
-
@discount_end = discount_end
|
1817
|
-
@timestamp = timestamp
|
1818
|
-
@type = type
|
1819
|
-
end
|
1820
|
-
end
|
1821
|
-
|
1822
|
-
class DiscountAction < Stripe::RequestParams
|
1823
|
-
class Add < Stripe::RequestParams
|
1824
|
-
class DiscountEnd < Stripe::RequestParams
|
1825
|
-
# The type of calculation made to determine when the discount ends.
|
1826
|
-
attr_accessor :type
|
1827
|
-
|
1828
|
-
def initialize(type: nil)
|
1829
|
-
@type = type
|
1830
|
-
end
|
1831
|
-
end
|
1832
|
-
# The coupon code to redeem.
|
1833
|
-
attr_accessor :coupon
|
1834
|
-
# An ID of an existing discount for a coupon that was already redeemed.
|
1835
|
-
attr_accessor :discount
|
1836
|
-
# Details to determine how long the discount should be applied for.
|
1837
|
-
attr_accessor :discount_end
|
1838
|
-
# 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.
|
1839
|
-
attr_accessor :index
|
1840
|
-
# The promotion code to redeem.
|
1841
|
-
attr_accessor :promotion_code
|
1842
|
-
|
1843
|
-
def initialize(
|
1844
|
-
coupon: nil,
|
1845
|
-
discount: nil,
|
1846
|
-
discount_end: nil,
|
1847
|
-
index: nil,
|
1848
|
-
promotion_code: nil
|
1849
|
-
)
|
1850
|
-
@coupon = coupon
|
1851
|
-
@discount = discount
|
1852
|
-
@discount_end = discount_end
|
1853
|
-
@index = index
|
1854
|
-
@promotion_code = promotion_code
|
1855
|
-
end
|
1856
|
-
end
|
1857
|
-
|
1858
|
-
class Remove < Stripe::RequestParams
|
1859
|
-
# The coupon code to remove from the `discounts` array.
|
1860
|
-
attr_accessor :coupon
|
1861
|
-
# The ID of a discount to remove from the `discounts` array.
|
1862
|
-
attr_accessor :discount
|
1863
|
-
# The ID of a promotion code to remove from the `discounts` array.
|
1864
|
-
attr_accessor :promotion_code
|
1865
|
-
|
1866
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1867
|
-
@coupon = coupon
|
1868
|
-
@discount = discount
|
1869
|
-
@promotion_code = promotion_code
|
1870
|
-
end
|
1871
|
-
end
|
1872
|
-
|
1873
|
-
class Set < Stripe::RequestParams
|
1874
|
-
# The coupon code to replace the `discounts` array with.
|
1875
|
-
attr_accessor :coupon
|
1876
|
-
# An ID of an existing discount to replace the `discounts` array with.
|
1877
|
-
attr_accessor :discount
|
1878
|
-
# An ID of an existing promotion code to replace the `discounts` array with.
|
1879
|
-
attr_accessor :promotion_code
|
1880
|
-
|
1881
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
1882
|
-
@coupon = coupon
|
1883
|
-
@discount = discount
|
1884
|
-
@promotion_code = promotion_code
|
1885
|
-
end
|
1886
|
-
end
|
1887
|
-
# Details of the discount to add.
|
1888
|
-
attr_accessor :add
|
1889
|
-
# Details of the discount to remove.
|
1890
|
-
attr_accessor :remove
|
1891
|
-
# Details of the discount to replace the existing discounts with.
|
1892
|
-
attr_accessor :set
|
1893
|
-
# Determines the type of discount action.
|
1894
|
-
attr_accessor :type
|
1895
|
-
|
1896
|
-
def initialize(add: nil, remove: nil, set: nil, type: nil)
|
1897
|
-
@add = add
|
1898
|
-
@remove = remove
|
1899
|
-
@set = set
|
1900
|
-
@type = type
|
1901
|
-
end
|
1902
|
-
end
|
1903
|
-
|
1904
|
-
class ItemAction < Stripe::RequestParams
|
1905
|
-
class Add < Stripe::RequestParams
|
1906
|
-
class Discount < Stripe::RequestParams
|
1907
|
-
class DiscountEnd < Stripe::RequestParams
|
1908
|
-
class Duration < Stripe::RequestParams
|
1909
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
1910
|
-
attr_accessor :interval
|
1911
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
1912
|
-
attr_accessor :interval_count
|
1913
|
-
|
1914
|
-
def initialize(interval: nil, interval_count: nil)
|
1915
|
-
@interval = interval
|
1916
|
-
@interval_count = interval_count
|
1917
|
-
end
|
1918
|
-
end
|
1919
|
-
# Time span for the redeemed discount.
|
1920
|
-
attr_accessor :duration
|
1921
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
1922
|
-
attr_accessor :timestamp
|
1923
|
-
# The type of calculation made to determine when the discount ends.
|
1924
|
-
attr_accessor :type
|
1925
|
-
|
1926
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
1927
|
-
@duration = duration
|
1928
|
-
@timestamp = timestamp
|
1929
|
-
@type = type
|
1930
|
-
end
|
1931
|
-
end
|
1932
|
-
# ID of the coupon to create a new discount for.
|
1933
|
-
attr_accessor :coupon
|
1934
|
-
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
1935
|
-
attr_accessor :discount
|
1936
|
-
# Details to determine how long the discount should be applied for.
|
1937
|
-
attr_accessor :discount_end
|
1938
|
-
# ID of the promotion code to create a new discount for.
|
1939
|
-
attr_accessor :promotion_code
|
1940
|
-
|
1941
|
-
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
1942
|
-
@coupon = coupon
|
1943
|
-
@discount = discount
|
1944
|
-
@discount_end = discount_end
|
1945
|
-
@promotion_code = promotion_code
|
1946
|
-
end
|
1947
|
-
end
|
1948
|
-
|
1949
|
-
class Trial < Stripe::RequestParams
|
1950
|
-
# 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.
|
1951
|
-
attr_accessor :converts_to
|
1952
|
-
# Determines the type of trial for this item.
|
1953
|
-
attr_accessor :type
|
1954
|
-
|
1955
|
-
def initialize(converts_to: nil, type: nil)
|
1956
|
-
@converts_to = converts_to
|
1957
|
-
@type = type
|
1958
|
-
end
|
1959
|
-
end
|
1960
|
-
# The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
|
1961
|
-
attr_accessor :discounts
|
1962
|
-
# 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`.
|
1963
|
-
attr_accessor :metadata
|
1964
|
-
# The ID of the price object.
|
1965
|
-
attr_accessor :price
|
1966
|
-
# Quantity for this item.
|
1967
|
-
attr_accessor :quantity
|
1968
|
-
# 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`.
|
1969
|
-
attr_accessor :tax_rates
|
1970
|
-
# Options that configure the trial on the subscription item.
|
1971
|
-
attr_accessor :trial
|
1972
|
-
|
1973
|
-
def initialize(
|
1974
|
-
discounts: nil,
|
1975
|
-
metadata: nil,
|
1976
|
-
price: nil,
|
1977
|
-
quantity: nil,
|
1978
|
-
tax_rates: nil,
|
1979
|
-
trial: nil
|
1980
|
-
)
|
1981
|
-
@discounts = discounts
|
1982
|
-
@metadata = metadata
|
1983
|
-
@price = price
|
1984
|
-
@quantity = quantity
|
1985
|
-
@tax_rates = tax_rates
|
1986
|
-
@trial = trial
|
1987
|
-
end
|
1988
|
-
end
|
1989
|
-
|
1990
|
-
class Remove < Stripe::RequestParams
|
1991
|
-
# ID of a price to remove.
|
1992
|
-
attr_accessor :price
|
1993
|
-
|
1994
|
-
def initialize(price: nil)
|
1995
|
-
@price = price
|
1996
|
-
end
|
1997
|
-
end
|
1998
|
-
|
1999
|
-
class Set < Stripe::RequestParams
|
2000
|
-
class Discount < Stripe::RequestParams
|
2001
|
-
class DiscountEnd < Stripe::RequestParams
|
2002
|
-
class Duration < Stripe::RequestParams
|
2003
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
2004
|
-
attr_accessor :interval
|
2005
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
2006
|
-
attr_accessor :interval_count
|
2007
|
-
|
2008
|
-
def initialize(interval: nil, interval_count: nil)
|
2009
|
-
@interval = interval
|
2010
|
-
@interval_count = interval_count
|
2011
|
-
end
|
2012
|
-
end
|
2013
|
-
# Time span for the redeemed discount.
|
2014
|
-
attr_accessor :duration
|
2015
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
2016
|
-
attr_accessor :timestamp
|
2017
|
-
# The type of calculation made to determine when the discount ends.
|
2018
|
-
attr_accessor :type
|
2019
|
-
|
2020
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
2021
|
-
@duration = duration
|
2022
|
-
@timestamp = timestamp
|
2023
|
-
@type = type
|
2024
|
-
end
|
2025
|
-
end
|
2026
|
-
# ID of the coupon to create a new discount for.
|
2027
|
-
attr_accessor :coupon
|
2028
|
-
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
2029
|
-
attr_accessor :discount
|
2030
|
-
# Details to determine how long the discount should be applied for.
|
2031
|
-
attr_accessor :discount_end
|
2032
|
-
# ID of the promotion code to create a new discount for.
|
2033
|
-
attr_accessor :promotion_code
|
2034
|
-
|
2035
|
-
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
2036
|
-
@coupon = coupon
|
2037
|
-
@discount = discount
|
2038
|
-
@discount_end = discount_end
|
2039
|
-
@promotion_code = promotion_code
|
2040
|
-
end
|
2041
|
-
end
|
2042
|
-
|
2043
|
-
class Trial < Stripe::RequestParams
|
2044
|
-
# 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.
|
2045
|
-
attr_accessor :converts_to
|
2046
|
-
# Determines the type of trial for this item.
|
2047
|
-
attr_accessor :type
|
2048
|
-
|
2049
|
-
def initialize(converts_to: nil, type: nil)
|
2050
|
-
@converts_to = converts_to
|
2051
|
-
@type = type
|
2052
|
-
end
|
2053
|
-
end
|
2054
|
-
# 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`.
|
2055
|
-
attr_accessor :discounts
|
2056
|
-
# 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`.
|
2057
|
-
attr_accessor :metadata
|
2058
|
-
# The ID of the price object.
|
2059
|
-
attr_accessor :price
|
2060
|
-
# 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`.
|
2061
|
-
attr_accessor :quantity
|
2062
|
-
# 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`.
|
2063
|
-
attr_accessor :tax_rates
|
2064
|
-
# 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`.
|
2065
|
-
attr_accessor :trial
|
2066
|
-
|
2067
|
-
def initialize(
|
2068
|
-
discounts: nil,
|
2069
|
-
metadata: nil,
|
2070
|
-
price: nil,
|
2071
|
-
quantity: nil,
|
2072
|
-
tax_rates: nil,
|
2073
|
-
trial: nil
|
2074
|
-
)
|
2075
|
-
@discounts = discounts
|
2076
|
-
@metadata = metadata
|
2077
|
-
@price = price
|
2078
|
-
@quantity = quantity
|
2079
|
-
@tax_rates = tax_rates
|
2080
|
-
@trial = trial
|
2081
|
-
end
|
2082
|
-
end
|
2083
|
-
# 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.
|
2084
|
-
attr_accessor :add
|
2085
|
-
# Details of the subscription item to remove.
|
2086
|
-
attr_accessor :remove
|
2087
|
-
# 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.
|
2088
|
-
attr_accessor :set
|
2089
|
-
# Determines the type of item action.
|
2090
|
-
attr_accessor :type
|
2091
|
-
|
2092
|
-
def initialize(add: nil, remove: nil, set: nil, type: nil)
|
2093
|
-
@add = add
|
2094
|
-
@remove = remove
|
2095
|
-
@set = set
|
2096
|
-
@type = type
|
2097
|
-
end
|
2098
|
-
end
|
2099
|
-
|
2100
|
-
class MetadataAction < Stripe::RequestParams
|
2101
|
-
# Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
|
2102
|
-
attr_accessor :add
|
2103
|
-
# Keys to remove from schedule phase metadata.
|
2104
|
-
attr_accessor :remove
|
2105
|
-
# Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
|
2106
|
-
attr_accessor :set
|
2107
|
-
# Select one of three ways to update phase-level `metadata` on subscription schedules.
|
2108
|
-
attr_accessor :type
|
2109
|
-
|
2110
|
-
def initialize(add: nil, remove: nil, set: nil, type: nil)
|
2111
|
-
@add = add
|
2112
|
-
@remove = remove
|
2113
|
-
@set = set
|
2114
|
-
@type = type
|
2115
|
-
end
|
2116
|
-
end
|
2117
|
-
|
2118
|
-
class SetPauseCollection < Stripe::RequestParams
|
2119
|
-
class Set < Stripe::RequestParams
|
2120
|
-
# The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
2121
|
-
attr_accessor :behavior
|
2122
|
-
|
2123
|
-
def initialize(behavior: nil)
|
2124
|
-
@behavior = behavior
|
2125
|
-
end
|
2126
|
-
end
|
2127
|
-
# Details of the pause_collection behavior to apply to the amendment.
|
2128
|
-
attr_accessor :set
|
2129
|
-
# Determines the type of the pause_collection amendment.
|
2130
|
-
attr_accessor :type
|
2131
|
-
|
2132
|
-
def initialize(set: nil, type: nil)
|
2133
|
-
@set = set
|
2134
|
-
@type = type
|
2135
|
-
end
|
2136
|
-
end
|
2137
|
-
|
2138
|
-
class TrialSettings < Stripe::RequestParams
|
2139
|
-
class EndBehavior < Stripe::RequestParams
|
2140
|
-
# Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
2141
|
-
attr_accessor :prorate_up_front
|
2142
|
-
|
2143
|
-
def initialize(prorate_up_front: nil)
|
2144
|
-
@prorate_up_front = prorate_up_front
|
2145
|
-
end
|
2146
|
-
end
|
2147
|
-
# Defines how the subscription should behave when a trial ends.
|
2148
|
-
attr_accessor :end_behavior
|
2149
|
-
|
2150
|
-
def initialize(end_behavior: nil)
|
2151
|
-
@end_behavior = end_behavior
|
2152
|
-
end
|
2153
|
-
end
|
2154
|
-
# 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.
|
2155
|
-
attr_accessor :amendment_end
|
2156
|
-
# Details to identify the earliest timestamp where the proposed change should take effect.
|
2157
|
-
attr_accessor :amendment_start
|
2158
|
-
# 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.
|
2159
|
-
attr_accessor :billing_cycle_anchor
|
2160
|
-
# Changes to the coupons being redeemed or discounts being applied during the amendment time span.
|
2161
|
-
attr_accessor :discount_actions
|
2162
|
-
# Changes to the subscription items during the amendment time span.
|
2163
|
-
attr_accessor :item_actions
|
2164
|
-
# Instructions for how to modify phase metadata
|
2165
|
-
attr_accessor :metadata_actions
|
2166
|
-
# 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`.
|
2167
|
-
attr_accessor :proration_behavior
|
2168
|
-
# Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
|
2169
|
-
attr_accessor :set_pause_collection
|
2170
|
-
# Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
|
2171
|
-
attr_accessor :set_schedule_end
|
2172
|
-
# Settings related to subscription trials.
|
2173
|
-
attr_accessor :trial_settings
|
2174
|
-
|
2175
|
-
def initialize(
|
2176
|
-
amendment_end: nil,
|
2177
|
-
amendment_start: nil,
|
2178
|
-
billing_cycle_anchor: nil,
|
2179
|
-
discount_actions: nil,
|
2180
|
-
item_actions: nil,
|
2181
|
-
metadata_actions: nil,
|
2182
|
-
proration_behavior: nil,
|
2183
|
-
set_pause_collection: nil,
|
2184
|
-
set_schedule_end: nil,
|
2185
|
-
trial_settings: nil
|
2186
|
-
)
|
2187
|
-
@amendment_end = amendment_end
|
2188
|
-
@amendment_start = amendment_start
|
2189
|
-
@billing_cycle_anchor = billing_cycle_anchor
|
2190
|
-
@discount_actions = discount_actions
|
2191
|
-
@item_actions = item_actions
|
2192
|
-
@metadata_actions = metadata_actions
|
2193
|
-
@proration_behavior = proration_behavior
|
2194
|
-
@set_pause_collection = set_pause_collection
|
2195
|
-
@set_schedule_end = set_schedule_end
|
2196
|
-
@trial_settings = trial_settings
|
2197
|
-
end
|
2198
|
-
end
|
2199
|
-
|
2200
|
-
class Phase < Stripe::RequestParams
|
2201
|
-
class AddInvoiceItem < Stripe::RequestParams
|
2202
|
-
class Discount < Stripe::RequestParams
|
2203
|
-
class DiscountEnd < Stripe::RequestParams
|
2204
|
-
class Duration < Stripe::RequestParams
|
2205
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
2206
|
-
attr_accessor :interval
|
2207
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
2208
|
-
attr_accessor :interval_count
|
2209
|
-
|
2210
|
-
def initialize(interval: nil, interval_count: nil)
|
2211
|
-
@interval = interval
|
2212
|
-
@interval_count = interval_count
|
2213
|
-
end
|
2214
|
-
end
|
2215
|
-
# Time span for the redeemed discount.
|
2216
|
-
attr_accessor :duration
|
2217
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
2218
|
-
attr_accessor :timestamp
|
2219
|
-
# The type of calculation made to determine when the discount ends.
|
2220
|
-
attr_accessor :type
|
2221
|
-
|
2222
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
2223
|
-
@duration = duration
|
2224
|
-
@timestamp = timestamp
|
2225
|
-
@type = type
|
2226
|
-
end
|
2227
|
-
end
|
2228
|
-
# ID of the coupon to create a new discount for.
|
2229
|
-
attr_accessor :coupon
|
2230
|
-
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
2231
|
-
attr_accessor :discount
|
2232
|
-
# Details to determine how long the discount should be applied for.
|
2233
|
-
attr_accessor :discount_end
|
2234
|
-
# ID of the promotion code to create a new discount for.
|
2235
|
-
attr_accessor :promotion_code
|
2236
|
-
|
2237
|
-
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
2238
|
-
@coupon = coupon
|
2239
|
-
@discount = discount
|
2240
|
-
@discount_end = discount_end
|
2241
|
-
@promotion_code = promotion_code
|
2242
|
-
end
|
2243
|
-
end
|
2244
|
-
|
2245
|
-
class PriceData < Stripe::RequestParams
|
2246
|
-
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
2247
|
-
attr_accessor :currency
|
2248
|
-
# The ID of the product that this price will belong to.
|
2249
|
-
attr_accessor :product
|
2250
|
-
# Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
|
2251
|
-
attr_accessor :tax_behavior
|
2252
|
-
# A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer.
|
2253
|
-
attr_accessor :unit_amount
|
2254
|
-
# Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
|
2255
|
-
attr_accessor :unit_amount_decimal
|
2256
|
-
|
2257
|
-
def initialize(
|
2258
|
-
currency: nil,
|
2259
|
-
product: nil,
|
2260
|
-
tax_behavior: nil,
|
2261
|
-
unit_amount: nil,
|
2262
|
-
unit_amount_decimal: nil
|
2263
|
-
)
|
2264
|
-
@currency = currency
|
2265
|
-
@product = product
|
2266
|
-
@tax_behavior = tax_behavior
|
2267
|
-
@unit_amount = unit_amount
|
2268
|
-
@unit_amount_decimal = unit_amount_decimal
|
2269
|
-
end
|
2270
|
-
end
|
2271
|
-
# The coupons to redeem into discounts for the item.
|
2272
|
-
attr_accessor :discounts
|
2273
|
-
# The ID of the price object. One of `price` or `price_data` is required.
|
2274
|
-
attr_accessor :price
|
2275
|
-
# Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
|
2276
|
-
attr_accessor :price_data
|
2277
|
-
# Quantity for this item. Defaults to 1.
|
2278
|
-
attr_accessor :quantity
|
2279
|
-
# The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
|
2280
|
-
attr_accessor :tax_rates
|
2281
|
-
|
2282
|
-
def initialize(
|
2283
|
-
discounts: nil,
|
2284
|
-
price: nil,
|
2285
|
-
price_data: nil,
|
2286
|
-
quantity: nil,
|
2287
|
-
tax_rates: nil
|
2288
|
-
)
|
2289
|
-
@discounts = discounts
|
2290
|
-
@price = price
|
2291
|
-
@price_data = price_data
|
2292
|
-
@quantity = quantity
|
2293
|
-
@tax_rates = tax_rates
|
2294
|
-
end
|
2295
|
-
end
|
2296
|
-
|
2297
|
-
class AutomaticTax < Stripe::RequestParams
|
2298
|
-
class Liability < Stripe::RequestParams
|
2299
|
-
# The connected account being referenced when `type` is `account`.
|
2300
|
-
attr_accessor :account
|
2301
|
-
# Type of the account referenced in the request.
|
2302
|
-
attr_accessor :type
|
2303
|
-
|
2304
|
-
def initialize(account: nil, type: nil)
|
2305
|
-
@account = account
|
2306
|
-
@type = type
|
2307
|
-
end
|
2308
|
-
end
|
2309
|
-
# Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
|
2310
|
-
attr_accessor :enabled
|
2311
|
-
# The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
|
2312
|
-
attr_accessor :liability
|
2313
|
-
|
2314
|
-
def initialize(enabled: nil, liability: nil)
|
2315
|
-
@enabled = enabled
|
2316
|
-
@liability = liability
|
2317
|
-
end
|
2318
|
-
end
|
2319
|
-
|
2320
|
-
class BillingThresholds < Stripe::RequestParams
|
2321
|
-
# Monetary threshold that triggers the subscription to advance to a new billing period
|
2322
|
-
attr_accessor :amount_gte
|
2323
|
-
# Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
|
2324
|
-
attr_accessor :reset_billing_cycle_anchor
|
2325
|
-
|
2326
|
-
def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil)
|
2327
|
-
@amount_gte = amount_gte
|
2328
|
-
@reset_billing_cycle_anchor = reset_billing_cycle_anchor
|
2329
|
-
end
|
2330
|
-
end
|
2331
|
-
|
2332
|
-
class Discount < Stripe::RequestParams
|
2333
|
-
class DiscountEnd < Stripe::RequestParams
|
2334
|
-
class Duration < Stripe::RequestParams
|
2335
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
2336
|
-
attr_accessor :interval
|
2337
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
2338
|
-
attr_accessor :interval_count
|
2339
|
-
|
2340
|
-
def initialize(interval: nil, interval_count: nil)
|
2341
|
-
@interval = interval
|
2342
|
-
@interval_count = interval_count
|
2343
|
-
end
|
2344
|
-
end
|
2345
|
-
# Time span for the redeemed discount.
|
2346
|
-
attr_accessor :duration
|
2347
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
2348
|
-
attr_accessor :timestamp
|
2349
|
-
# The type of calculation made to determine when the discount ends.
|
2350
|
-
attr_accessor :type
|
2351
|
-
|
2352
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
2353
|
-
@duration = duration
|
2354
|
-
@timestamp = timestamp
|
2355
|
-
@type = type
|
2356
|
-
end
|
2357
|
-
end
|
2358
|
-
# ID of the coupon to create a new discount for.
|
2359
|
-
attr_accessor :coupon
|
2360
|
-
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
2361
|
-
attr_accessor :discount
|
2362
|
-
# Details to determine how long the discount should be applied for.
|
2363
|
-
attr_accessor :discount_end
|
2364
|
-
# ID of the promotion code to create a new discount for.
|
2365
|
-
attr_accessor :promotion_code
|
2366
|
-
|
2367
|
-
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
2368
|
-
@coupon = coupon
|
2369
|
-
@discount = discount
|
2370
|
-
@discount_end = discount_end
|
2371
|
-
@promotion_code = promotion_code
|
2372
|
-
end
|
2373
|
-
end
|
2374
|
-
|
2375
|
-
class InvoiceSettings < Stripe::RequestParams
|
2376
|
-
class Issuer < Stripe::RequestParams
|
2377
|
-
# The connected account being referenced when `type` is `account`.
|
2378
|
-
attr_accessor :account
|
2379
|
-
# Type of the account referenced in the request.
|
2380
|
-
attr_accessor :type
|
2381
|
-
|
2382
|
-
def initialize(account: nil, type: nil)
|
2383
|
-
@account = account
|
2384
|
-
@type = type
|
2385
|
-
end
|
2386
|
-
end
|
2387
|
-
# The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule.
|
2388
|
-
attr_accessor :account_tax_ids
|
2389
|
-
# Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`.
|
2390
|
-
attr_accessor :days_until_due
|
2391
|
-
# The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
|
2392
|
-
attr_accessor :issuer
|
2393
|
-
|
2394
|
-
def initialize(account_tax_ids: nil, days_until_due: nil, issuer: nil)
|
2395
|
-
@account_tax_ids = account_tax_ids
|
2396
|
-
@days_until_due = days_until_due
|
2397
|
-
@issuer = issuer
|
2398
|
-
end
|
2399
|
-
end
|
2400
|
-
|
2401
|
-
class Item < Stripe::RequestParams
|
2402
|
-
class BillingThresholds < Stripe::RequestParams
|
2403
|
-
# Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
|
2404
|
-
attr_accessor :usage_gte
|
2405
|
-
|
2406
|
-
def initialize(usage_gte: nil)
|
2407
|
-
@usage_gte = usage_gte
|
2408
|
-
end
|
2409
|
-
end
|
2410
|
-
|
2411
|
-
class Discount < Stripe::RequestParams
|
2412
|
-
class DiscountEnd < Stripe::RequestParams
|
2413
|
-
class Duration < Stripe::RequestParams
|
2414
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
2415
|
-
attr_accessor :interval
|
2416
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
2417
|
-
attr_accessor :interval_count
|
2418
|
-
|
2419
|
-
def initialize(interval: nil, interval_count: nil)
|
2420
|
-
@interval = interval
|
2421
|
-
@interval_count = interval_count
|
2422
|
-
end
|
2423
|
-
end
|
2424
|
-
# Time span for the redeemed discount.
|
2425
|
-
attr_accessor :duration
|
2426
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
2427
|
-
attr_accessor :timestamp
|
2428
|
-
# The type of calculation made to determine when the discount ends.
|
2429
|
-
attr_accessor :type
|
2430
|
-
|
2431
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
2432
|
-
@duration = duration
|
2433
|
-
@timestamp = timestamp
|
2434
|
-
@type = type
|
2435
|
-
end
|
2436
|
-
end
|
2437
|
-
# ID of the coupon to create a new discount for.
|
2438
|
-
attr_accessor :coupon
|
2439
|
-
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
2440
|
-
attr_accessor :discount
|
2441
|
-
# Details to determine how long the discount should be applied for.
|
2442
|
-
attr_accessor :discount_end
|
2443
|
-
# ID of the promotion code to create a new discount for.
|
2444
|
-
attr_accessor :promotion_code
|
2445
|
-
|
2446
|
-
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
2447
|
-
@coupon = coupon
|
2448
|
-
@discount = discount
|
2449
|
-
@discount_end = discount_end
|
2450
|
-
@promotion_code = promotion_code
|
2451
|
-
end
|
2452
|
-
end
|
2453
|
-
|
2454
|
-
class PriceData < Stripe::RequestParams
|
2455
|
-
class Recurring < Stripe::RequestParams
|
2456
|
-
# Specifies billing frequency. Either `day`, `week`, `month` or `year`.
|
2457
|
-
attr_accessor :interval
|
2458
|
-
# The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
|
2459
|
-
attr_accessor :interval_count
|
2460
|
-
|
2461
|
-
def initialize(interval: nil, interval_count: nil)
|
2462
|
-
@interval = interval
|
2463
|
-
@interval_count = interval_count
|
2464
|
-
end
|
2465
|
-
end
|
2466
|
-
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
2467
|
-
attr_accessor :currency
|
2468
|
-
# The ID of the product that this price will belong to.
|
2469
|
-
attr_accessor :product
|
2470
|
-
# The recurring components of a price such as `interval` and `interval_count`.
|
2471
|
-
attr_accessor :recurring
|
2472
|
-
# Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
|
2473
|
-
attr_accessor :tax_behavior
|
2474
|
-
# A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
|
2475
|
-
attr_accessor :unit_amount
|
2476
|
-
# Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
|
2477
|
-
attr_accessor :unit_amount_decimal
|
2478
|
-
|
2479
|
-
def initialize(
|
2480
|
-
currency: nil,
|
2481
|
-
product: nil,
|
2482
|
-
recurring: nil,
|
2483
|
-
tax_behavior: nil,
|
2484
|
-
unit_amount: nil,
|
2485
|
-
unit_amount_decimal: nil
|
2486
|
-
)
|
2487
|
-
@currency = currency
|
2488
|
-
@product = product
|
2489
|
-
@recurring = recurring
|
2490
|
-
@tax_behavior = tax_behavior
|
2491
|
-
@unit_amount = unit_amount
|
2492
|
-
@unit_amount_decimal = unit_amount_decimal
|
2493
|
-
end
|
2494
|
-
end
|
2495
|
-
|
2496
|
-
class Trial < Stripe::RequestParams
|
2497
|
-
# 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.
|
2498
|
-
attr_accessor :converts_to
|
2499
|
-
# Determines the type of trial for this item.
|
2500
|
-
attr_accessor :type
|
2501
|
-
|
2502
|
-
def initialize(converts_to: nil, type: nil)
|
2503
|
-
@converts_to = converts_to
|
2504
|
-
@type = type
|
2505
|
-
end
|
2506
|
-
end
|
2507
|
-
# Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds.
|
2508
|
-
attr_accessor :billing_thresholds
|
2509
|
-
# The coupons to redeem into discounts for the subscription item.
|
2510
|
-
attr_accessor :discounts
|
2511
|
-
# 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`.
|
2512
|
-
attr_accessor :metadata
|
2513
|
-
# The plan ID to subscribe to. You may specify the same ID in `plan` and `price`.
|
2514
|
-
attr_accessor :plan
|
2515
|
-
# The ID of the price object.
|
2516
|
-
attr_accessor :price
|
2517
|
-
# Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
|
2518
|
-
attr_accessor :price_data
|
2519
|
-
# Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`.
|
2520
|
-
attr_accessor :quantity
|
2521
|
-
# 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.
|
2522
|
-
attr_accessor :tax_rates
|
2523
|
-
# Options that configure the trial on the subscription item.
|
2524
|
-
attr_accessor :trial
|
2525
|
-
|
2526
|
-
def initialize(
|
2527
|
-
billing_thresholds: nil,
|
2528
|
-
discounts: nil,
|
2529
|
-
metadata: nil,
|
2530
|
-
plan: nil,
|
2531
|
-
price: nil,
|
2532
|
-
price_data: nil,
|
2533
|
-
quantity: nil,
|
2534
|
-
tax_rates: nil,
|
2535
|
-
trial: nil
|
2536
|
-
)
|
2537
|
-
@billing_thresholds = billing_thresholds
|
2538
|
-
@discounts = discounts
|
2539
|
-
@metadata = metadata
|
2540
|
-
@plan = plan
|
2541
|
-
@price = price
|
2542
|
-
@price_data = price_data
|
2543
|
-
@quantity = quantity
|
2544
|
-
@tax_rates = tax_rates
|
2545
|
-
@trial = trial
|
2546
|
-
end
|
2547
|
-
end
|
2548
|
-
|
2549
|
-
class PauseCollection < Stripe::RequestParams
|
2550
|
-
# The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
2551
|
-
attr_accessor :behavior
|
2552
|
-
|
2553
|
-
def initialize(behavior: nil)
|
2554
|
-
@behavior = behavior
|
2555
|
-
end
|
2556
|
-
end
|
2557
|
-
|
2558
|
-
class TransferData < Stripe::RequestParams
|
2559
|
-
# 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 destination account. By default, the entire amount is transferred to the destination.
|
2560
|
-
attr_accessor :amount_percent
|
2561
|
-
# ID of an existing, connected Stripe account.
|
2562
|
-
attr_accessor :destination
|
2563
|
-
|
2564
|
-
def initialize(amount_percent: nil, destination: nil)
|
2565
|
-
@amount_percent = amount_percent
|
2566
|
-
@destination = destination
|
2567
|
-
end
|
2568
|
-
end
|
2569
|
-
|
2570
|
-
class TrialSettings < Stripe::RequestParams
|
2571
|
-
class EndBehavior < Stripe::RequestParams
|
2572
|
-
# Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
2573
|
-
attr_accessor :prorate_up_front
|
2574
|
-
|
2575
|
-
def initialize(prorate_up_front: nil)
|
2576
|
-
@prorate_up_front = prorate_up_front
|
2577
|
-
end
|
2578
|
-
end
|
2579
|
-
# Defines how the subscription should behave when a trial ends.
|
2580
|
-
attr_accessor :end_behavior
|
2581
|
-
|
2582
|
-
def initialize(end_behavior: nil)
|
2583
|
-
@end_behavior = end_behavior
|
2584
|
-
end
|
2585
|
-
end
|
2586
|
-
# 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.
|
2587
|
-
attr_accessor :add_invoice_items
|
2588
|
-
# 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).
|
2589
|
-
attr_accessor :application_fee_percent
|
2590
|
-
# Automatic tax settings for this phase.
|
2591
|
-
attr_accessor :automatic_tax
|
2592
|
-
# Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
|
2593
|
-
attr_accessor :billing_cycle_anchor
|
2594
|
-
# Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
|
2595
|
-
attr_accessor :billing_thresholds
|
2596
|
-
# Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.
|
2597
|
-
attr_accessor :collection_method
|
2598
|
-
# The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead.
|
2599
|
-
attr_accessor :coupon
|
2600
|
-
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
2601
|
-
attr_accessor :currency
|
2602
|
-
# ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.
|
2603
|
-
attr_accessor :default_payment_method
|
2604
|
-
# A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase.
|
2605
|
-
attr_accessor :default_tax_rates
|
2606
|
-
# Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
|
2607
|
-
attr_accessor :description
|
2608
|
-
# The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts.
|
2609
|
-
attr_accessor :discounts
|
2610
|
-
# The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set.
|
2611
|
-
attr_accessor :end_date
|
2612
|
-
# All invoices will be billed using the specified settings.
|
2613
|
-
attr_accessor :invoice_settings
|
2614
|
-
# List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.
|
2615
|
-
attr_accessor :items
|
2616
|
-
# Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set.
|
2617
|
-
attr_accessor :iterations
|
2618
|
-
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`.
|
2619
|
-
attr_accessor :metadata
|
2620
|
-
# The account on behalf of which to charge, for each of the associated subscription's invoices.
|
2621
|
-
attr_accessor :on_behalf_of
|
2622
|
-
# 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).
|
2623
|
-
attr_accessor :pause_collection
|
2624
|
-
# 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.
|
2625
|
-
attr_accessor :proration_behavior
|
2626
|
-
# The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
|
2627
|
-
attr_accessor :start_date
|
2628
|
-
# The data with which to automatically create a Transfer for each of the associated subscription's invoices.
|
2629
|
-
attr_accessor :transfer_data
|
2630
|
-
# If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
|
2631
|
-
attr_accessor :trial
|
2632
|
-
# Specify trial behavior when crossing phase boundaries
|
2633
|
-
attr_accessor :trial_continuation
|
2634
|
-
# 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`
|
2635
|
-
attr_accessor :trial_end
|
2636
|
-
# Settings related to subscription trials.
|
2637
|
-
attr_accessor :trial_settings
|
2638
|
-
|
2639
|
-
def initialize(
|
2640
|
-
add_invoice_items: nil,
|
2641
|
-
application_fee_percent: nil,
|
2642
|
-
automatic_tax: nil,
|
2643
|
-
billing_cycle_anchor: nil,
|
2644
|
-
billing_thresholds: nil,
|
2645
|
-
collection_method: nil,
|
2646
|
-
coupon: nil,
|
2647
|
-
currency: nil,
|
2648
|
-
default_payment_method: nil,
|
2649
|
-
default_tax_rates: nil,
|
2650
|
-
description: nil,
|
2651
|
-
discounts: nil,
|
2652
|
-
end_date: nil,
|
2653
|
-
invoice_settings: nil,
|
2654
|
-
items: nil,
|
2655
|
-
iterations: nil,
|
2656
|
-
metadata: nil,
|
2657
|
-
on_behalf_of: nil,
|
2658
|
-
pause_collection: nil,
|
2659
|
-
proration_behavior: nil,
|
2660
|
-
start_date: nil,
|
2661
|
-
transfer_data: nil,
|
2662
|
-
trial: nil,
|
2663
|
-
trial_continuation: nil,
|
2664
|
-
trial_end: nil,
|
2665
|
-
trial_settings: nil
|
2666
|
-
)
|
2667
|
-
@add_invoice_items = add_invoice_items
|
2668
|
-
@application_fee_percent = application_fee_percent
|
2669
|
-
@automatic_tax = automatic_tax
|
2670
|
-
@billing_cycle_anchor = billing_cycle_anchor
|
2671
|
-
@billing_thresholds = billing_thresholds
|
2672
|
-
@collection_method = collection_method
|
2673
|
-
@coupon = coupon
|
2674
|
-
@currency = currency
|
2675
|
-
@default_payment_method = default_payment_method
|
2676
|
-
@default_tax_rates = default_tax_rates
|
2677
|
-
@description = description
|
2678
|
-
@discounts = discounts
|
2679
|
-
@end_date = end_date
|
2680
|
-
@invoice_settings = invoice_settings
|
2681
|
-
@items = items
|
2682
|
-
@iterations = iterations
|
2683
|
-
@metadata = metadata
|
2684
|
-
@on_behalf_of = on_behalf_of
|
2685
|
-
@pause_collection = pause_collection
|
2686
|
-
@proration_behavior = proration_behavior
|
2687
|
-
@start_date = start_date
|
2688
|
-
@transfer_data = transfer_data
|
2689
|
-
@trial = trial
|
2690
|
-
@trial_continuation = trial_continuation
|
2691
|
-
@trial_end = trial_end
|
2692
|
-
@trial_settings = trial_settings
|
2693
|
-
end
|
2694
|
-
end
|
2695
|
-
|
2696
|
-
class Prebilling < Stripe::RequestParams
|
2697
|
-
class BillUntil < Stripe::RequestParams
|
2698
|
-
class AmendmentEnd < Stripe::RequestParams
|
2699
|
-
# 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.
|
2700
|
-
attr_accessor :index
|
2701
|
-
|
2702
|
-
def initialize(index: nil)
|
2703
|
-
@index = index
|
2704
|
-
end
|
2705
|
-
end
|
2706
|
-
|
2707
|
-
class Duration < Stripe::RequestParams
|
2708
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
2709
|
-
attr_accessor :interval
|
2710
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
2711
|
-
attr_accessor :interval_count
|
2712
|
-
|
2713
|
-
def initialize(interval: nil, interval_count: nil)
|
2714
|
-
@interval = interval
|
2715
|
-
@interval_count = interval_count
|
2716
|
-
end
|
2717
|
-
end
|
2718
|
-
# End the prebilled period when a specified amendment ends.
|
2719
|
-
attr_accessor :amendment_end
|
2720
|
-
# Time span for prebilling, starting from `bill_from`.
|
2721
|
-
attr_accessor :duration
|
2722
|
-
# End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
|
2723
|
-
attr_accessor :timestamp
|
2724
|
-
# Select one of several ways to pass the `bill_until` value.
|
2725
|
-
attr_accessor :type
|
2726
|
-
|
2727
|
-
def initialize(amendment_end: nil, duration: nil, timestamp: nil, type: nil)
|
2728
|
-
@amendment_end = amendment_end
|
2729
|
-
@duration = duration
|
2730
|
-
@timestamp = timestamp
|
2731
|
-
@type = type
|
2732
|
-
end
|
2733
|
-
end
|
2734
|
-
# The end of the prebilled time period.
|
2735
|
-
attr_accessor :bill_until
|
2736
|
-
# This is used to determine the number of billing cycles to prebill.
|
2737
|
-
attr_accessor :iterations
|
2738
|
-
|
2739
|
-
def initialize(bill_until: nil, iterations: nil)
|
2740
|
-
@bill_until = bill_until
|
2741
|
-
@iterations = iterations
|
2742
|
-
end
|
2743
|
-
end
|
2744
|
-
# Changes to apply to the phases of the subscription schedule, in the order provided.
|
2745
|
-
attr_accessor :amendments
|
2746
|
-
# 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.
|
2747
|
-
attr_accessor :billing_behavior
|
2748
|
-
# 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.
|
2749
|
-
attr_accessor :end_behavior
|
2750
|
-
# 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.
|
2751
|
-
attr_accessor :phases
|
2752
|
-
# Provide any time periods to bill in advance.
|
2753
|
-
attr_accessor :prebilling
|
2754
|
-
# In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.
|
2755
|
-
attr_accessor :proration_behavior
|
2756
|
-
|
2757
|
-
def initialize(
|
2758
|
-
amendments: nil,
|
2759
|
-
billing_behavior: nil,
|
2760
|
-
end_behavior: nil,
|
2761
|
-
phases: nil,
|
2762
|
-
prebilling: nil,
|
2763
|
-
proration_behavior: nil
|
2764
|
-
)
|
2765
|
-
@amendments = amendments
|
2766
|
-
@billing_behavior = billing_behavior
|
2767
|
-
@end_behavior = end_behavior
|
2768
|
-
@phases = phases
|
2769
|
-
@prebilling = prebilling
|
2770
|
-
@proration_behavior = proration_behavior
|
2771
|
-
end
|
2772
|
-
end
|
2773
|
-
|
2774
|
-
class SubscriptionDetails < Stripe::RequestParams
|
2775
|
-
class Item < Stripe::RequestParams
|
2776
|
-
class BillingThresholds < Stripe::RequestParams
|
2777
|
-
# Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
|
2778
|
-
attr_accessor :usage_gte
|
2779
|
-
|
2780
|
-
def initialize(usage_gte: nil)
|
2781
|
-
@usage_gte = usage_gte
|
2782
|
-
end
|
2783
|
-
end
|
2784
|
-
|
2785
|
-
class Discount < Stripe::RequestParams
|
2786
|
-
class DiscountEnd < Stripe::RequestParams
|
2787
|
-
class Duration < Stripe::RequestParams
|
2788
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
2789
|
-
attr_accessor :interval
|
2790
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
2791
|
-
attr_accessor :interval_count
|
2792
|
-
|
2793
|
-
def initialize(interval: nil, interval_count: nil)
|
2794
|
-
@interval = interval
|
2795
|
-
@interval_count = interval_count
|
2796
|
-
end
|
2797
|
-
end
|
2798
|
-
# Time span for the redeemed discount.
|
2799
|
-
attr_accessor :duration
|
2800
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
2801
|
-
attr_accessor :timestamp
|
2802
|
-
# The type of calculation made to determine when the discount ends.
|
2803
|
-
attr_accessor :type
|
2804
|
-
|
2805
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
2806
|
-
@duration = duration
|
2807
|
-
@timestamp = timestamp
|
2808
|
-
@type = type
|
2809
|
-
end
|
2810
|
-
end
|
2811
|
-
# ID of the coupon to create a new discount for.
|
2812
|
-
attr_accessor :coupon
|
2813
|
-
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
2814
|
-
attr_accessor :discount
|
2815
|
-
# Details to determine how long the discount should be applied for.
|
2816
|
-
attr_accessor :discount_end
|
2817
|
-
# ID of the promotion code to create a new discount for.
|
2818
|
-
attr_accessor :promotion_code
|
2819
|
-
|
2820
|
-
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
2821
|
-
@coupon = coupon
|
2822
|
-
@discount = discount
|
2823
|
-
@discount_end = discount_end
|
2824
|
-
@promotion_code = promotion_code
|
2825
|
-
end
|
2826
|
-
end
|
2827
|
-
|
2828
|
-
class PriceData < Stripe::RequestParams
|
2829
|
-
class Recurring < Stripe::RequestParams
|
2830
|
-
# Specifies billing frequency. Either `day`, `week`, `month` or `year`.
|
2831
|
-
attr_accessor :interval
|
2832
|
-
# The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
|
2833
|
-
attr_accessor :interval_count
|
2834
|
-
|
2835
|
-
def initialize(interval: nil, interval_count: nil)
|
2836
|
-
@interval = interval
|
2837
|
-
@interval_count = interval_count
|
2838
|
-
end
|
2839
|
-
end
|
2840
|
-
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
2841
|
-
attr_accessor :currency
|
2842
|
-
# The ID of the product that this price will belong to.
|
2843
|
-
attr_accessor :product
|
2844
|
-
# The recurring components of a price such as `interval` and `interval_count`.
|
2845
|
-
attr_accessor :recurring
|
2846
|
-
# Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
|
2847
|
-
attr_accessor :tax_behavior
|
2848
|
-
# A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
|
2849
|
-
attr_accessor :unit_amount
|
2850
|
-
# Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
|
2851
|
-
attr_accessor :unit_amount_decimal
|
2852
|
-
|
2853
|
-
def initialize(
|
2854
|
-
currency: nil,
|
2855
|
-
product: nil,
|
2856
|
-
recurring: nil,
|
2857
|
-
tax_behavior: nil,
|
2858
|
-
unit_amount: nil,
|
2859
|
-
unit_amount_decimal: nil
|
2860
|
-
)
|
2861
|
-
@currency = currency
|
2862
|
-
@product = product
|
2863
|
-
@recurring = recurring
|
2864
|
-
@tax_behavior = tax_behavior
|
2865
|
-
@unit_amount = unit_amount
|
2866
|
-
@unit_amount_decimal = unit_amount_decimal
|
2867
|
-
end
|
2868
|
-
end
|
2869
|
-
# Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds.
|
2870
|
-
attr_accessor :billing_thresholds
|
2871
|
-
# Delete all usage for a given subscription item. You must pass this when deleting a usage records subscription item. `clear_usage` has no effect if the plan has a billing meter attached.
|
2872
|
-
attr_accessor :clear_usage
|
2873
|
-
# A flag that, if set to `true`, will delete the specified item.
|
2874
|
-
attr_accessor :deleted
|
2875
|
-
# The coupons to redeem into discounts for the subscription item.
|
2876
|
-
attr_accessor :discounts
|
2877
|
-
# Subscription item to update.
|
2878
|
-
attr_accessor :id
|
2879
|
-
# 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`.
|
2880
|
-
attr_accessor :metadata
|
2881
|
-
# Plan ID for this item, as a string.
|
2882
|
-
attr_accessor :plan
|
2883
|
-
# The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided.
|
2884
|
-
attr_accessor :price
|
2885
|
-
# Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
|
2886
|
-
attr_accessor :price_data
|
2887
|
-
# Quantity for this item.
|
2888
|
-
attr_accessor :quantity
|
2889
|
-
# 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.
|
2890
|
-
attr_accessor :tax_rates
|
2891
|
-
|
2892
|
-
def initialize(
|
2893
|
-
billing_thresholds: nil,
|
2894
|
-
clear_usage: nil,
|
2895
|
-
deleted: nil,
|
2896
|
-
discounts: nil,
|
2897
|
-
id: nil,
|
2898
|
-
metadata: nil,
|
2899
|
-
plan: nil,
|
2900
|
-
price: nil,
|
2901
|
-
price_data: nil,
|
2902
|
-
quantity: nil,
|
2903
|
-
tax_rates: nil
|
2904
|
-
)
|
2905
|
-
@billing_thresholds = billing_thresholds
|
2906
|
-
@clear_usage = clear_usage
|
2907
|
-
@deleted = deleted
|
2908
|
-
@discounts = discounts
|
2909
|
-
@id = id
|
2910
|
-
@metadata = metadata
|
2911
|
-
@plan = plan
|
2912
|
-
@price = price
|
2913
|
-
@price_data = price_data
|
2914
|
-
@quantity = quantity
|
2915
|
-
@tax_rates = tax_rates
|
2916
|
-
end
|
2917
|
-
end
|
2918
|
-
|
2919
|
-
class Prebilling < Stripe::RequestParams
|
2920
|
-
# This is used to determine the number of billing cycles to prebill.
|
2921
|
-
attr_accessor :iterations
|
2922
|
-
|
2923
|
-
def initialize(iterations: nil)
|
2924
|
-
@iterations = iterations
|
2925
|
-
end
|
2926
|
-
end
|
2927
|
-
# 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`.
|
2928
|
-
attr_accessor :billing_cycle_anchor
|
2929
|
-
# 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.
|
2930
|
-
attr_accessor :cancel_at
|
2931
|
-
# Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
|
2932
|
-
attr_accessor :cancel_at_period_end
|
2933
|
-
# This simulates the subscription being canceled or expired immediately.
|
2934
|
-
attr_accessor :cancel_now
|
2935
|
-
# If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set.
|
2936
|
-
attr_accessor :default_tax_rates
|
2937
|
-
# A list of up to 20 subscription items, each with an attached price.
|
2938
|
-
attr_accessor :items
|
2939
|
-
# The pre-billing to apply to the subscription as a preview.
|
2940
|
-
attr_accessor :prebilling
|
2941
|
-
# 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`.
|
2942
|
-
attr_accessor :proration_behavior
|
2943
|
-
# 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'.
|
2944
|
-
attr_accessor :proration_date
|
2945
|
-
# For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed.
|
2946
|
-
attr_accessor :resume_at
|
2947
|
-
# Date a subscription is intended to start (can be future or past).
|
2948
|
-
attr_accessor :start_date
|
2949
|
-
# If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required.
|
2950
|
-
attr_accessor :trial_end
|
2951
|
-
|
2952
|
-
def initialize(
|
2953
|
-
billing_cycle_anchor: nil,
|
2954
|
-
cancel_at: nil,
|
2955
|
-
cancel_at_period_end: nil,
|
2956
|
-
cancel_now: nil,
|
2957
|
-
default_tax_rates: nil,
|
2958
|
-
items: nil,
|
2959
|
-
prebilling: nil,
|
2960
|
-
proration_behavior: nil,
|
2961
|
-
proration_date: nil,
|
2962
|
-
resume_at: nil,
|
2963
|
-
start_date: nil,
|
2964
|
-
trial_end: nil
|
2965
|
-
)
|
2966
|
-
@billing_cycle_anchor = billing_cycle_anchor
|
2967
|
-
@cancel_at = cancel_at
|
2968
|
-
@cancel_at_period_end = cancel_at_period_end
|
2969
|
-
@cancel_now = cancel_now
|
2970
|
-
@default_tax_rates = default_tax_rates
|
2971
|
-
@items = items
|
2972
|
-
@prebilling = prebilling
|
2973
|
-
@proration_behavior = proration_behavior
|
2974
|
-
@proration_date = proration_date
|
2975
|
-
@resume_at = resume_at
|
2976
|
-
@start_date = start_date
|
2977
|
-
@trial_end = trial_end
|
2978
|
-
end
|
2979
|
-
end
|
2980
|
-
|
2981
|
-
class SubscriptionItem < Stripe::RequestParams
|
2982
|
-
class BillingThresholds < Stripe::RequestParams
|
2983
|
-
# Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
|
2984
|
-
attr_accessor :usage_gte
|
2985
|
-
|
2986
|
-
def initialize(usage_gte: nil)
|
2987
|
-
@usage_gte = usage_gte
|
2988
|
-
end
|
2989
|
-
end
|
2990
|
-
|
2991
|
-
class Discount < Stripe::RequestParams
|
2992
|
-
class DiscountEnd < Stripe::RequestParams
|
2993
|
-
class Duration < Stripe::RequestParams
|
2994
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
2995
|
-
attr_accessor :interval
|
2996
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
2997
|
-
attr_accessor :interval_count
|
2998
|
-
|
2999
|
-
def initialize(interval: nil, interval_count: nil)
|
3000
|
-
@interval = interval
|
3001
|
-
@interval_count = interval_count
|
3002
|
-
end
|
3003
|
-
end
|
3004
|
-
# Time span for the redeemed discount.
|
3005
|
-
attr_accessor :duration
|
3006
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
3007
|
-
attr_accessor :timestamp
|
3008
|
-
# The type of calculation made to determine when the discount ends.
|
3009
|
-
attr_accessor :type
|
3010
|
-
|
3011
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
3012
|
-
@duration = duration
|
3013
|
-
@timestamp = timestamp
|
3014
|
-
@type = type
|
3015
|
-
end
|
3016
|
-
end
|
3017
|
-
# ID of the coupon to create a new discount for.
|
3018
|
-
attr_accessor :coupon
|
3019
|
-
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
3020
|
-
attr_accessor :discount
|
3021
|
-
# Details to determine how long the discount should be applied for.
|
3022
|
-
attr_accessor :discount_end
|
3023
|
-
# ID of the promotion code to create a new discount for.
|
3024
|
-
attr_accessor :promotion_code
|
3025
|
-
|
3026
|
-
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
3027
|
-
@coupon = coupon
|
3028
|
-
@discount = discount
|
3029
|
-
@discount_end = discount_end
|
3030
|
-
@promotion_code = promotion_code
|
3031
|
-
end
|
3032
|
-
end
|
3033
|
-
|
3034
|
-
class PriceData < Stripe::RequestParams
|
3035
|
-
class Recurring < Stripe::RequestParams
|
3036
|
-
# Specifies billing frequency. Either `day`, `week`, `month` or `year`.
|
3037
|
-
attr_accessor :interval
|
3038
|
-
# The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
|
3039
|
-
attr_accessor :interval_count
|
3040
|
-
|
3041
|
-
def initialize(interval: nil, interval_count: nil)
|
3042
|
-
@interval = interval
|
3043
|
-
@interval_count = interval_count
|
3044
|
-
end
|
3045
|
-
end
|
3046
|
-
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
3047
|
-
attr_accessor :currency
|
3048
|
-
# The ID of the product that this price will belong to.
|
3049
|
-
attr_accessor :product
|
3050
|
-
# The recurring components of a price such as `interval` and `interval_count`.
|
3051
|
-
attr_accessor :recurring
|
3052
|
-
# Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
|
3053
|
-
attr_accessor :tax_behavior
|
3054
|
-
# A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
|
3055
|
-
attr_accessor :unit_amount
|
3056
|
-
# Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
|
3057
|
-
attr_accessor :unit_amount_decimal
|
3058
|
-
|
3059
|
-
def initialize(
|
3060
|
-
currency: nil,
|
3061
|
-
product: nil,
|
3062
|
-
recurring: nil,
|
3063
|
-
tax_behavior: nil,
|
3064
|
-
unit_amount: nil,
|
3065
|
-
unit_amount_decimal: nil
|
3066
|
-
)
|
3067
|
-
@currency = currency
|
3068
|
-
@product = product
|
3069
|
-
@recurring = recurring
|
3070
|
-
@tax_behavior = tax_behavior
|
3071
|
-
@unit_amount = unit_amount
|
3072
|
-
@unit_amount_decimal = unit_amount_decimal
|
3073
|
-
end
|
3074
|
-
end
|
3075
|
-
# Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds.
|
3076
|
-
attr_accessor :billing_thresholds
|
3077
|
-
# Delete all usage for a given subscription item. You must pass this when deleting a usage records subscription item. `clear_usage` has no effect if the plan has a billing meter attached.
|
3078
|
-
attr_accessor :clear_usage
|
3079
|
-
# A flag that, if set to `true`, will delete the specified item.
|
3080
|
-
attr_accessor :deleted
|
3081
|
-
# The coupons to redeem into discounts for the subscription item.
|
3082
|
-
attr_accessor :discounts
|
3083
|
-
# Subscription item to update.
|
3084
|
-
attr_accessor :id
|
3085
|
-
# 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`.
|
3086
|
-
attr_accessor :metadata
|
3087
|
-
# Plan ID for this item, as a string.
|
3088
|
-
attr_accessor :plan
|
3089
|
-
# The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided.
|
3090
|
-
attr_accessor :price
|
3091
|
-
# Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
|
3092
|
-
attr_accessor :price_data
|
3093
|
-
# Quantity for this item.
|
3094
|
-
attr_accessor :quantity
|
3095
|
-
# 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.
|
3096
|
-
attr_accessor :tax_rates
|
3097
|
-
|
3098
|
-
def initialize(
|
3099
|
-
billing_thresholds: nil,
|
3100
|
-
clear_usage: nil,
|
3101
|
-
deleted: nil,
|
3102
|
-
discounts: nil,
|
3103
|
-
id: nil,
|
3104
|
-
metadata: nil,
|
3105
|
-
plan: nil,
|
3106
|
-
price: nil,
|
3107
|
-
price_data: nil,
|
3108
|
-
quantity: nil,
|
3109
|
-
tax_rates: nil
|
3110
|
-
)
|
3111
|
-
@billing_thresholds = billing_thresholds
|
3112
|
-
@clear_usage = clear_usage
|
3113
|
-
@deleted = deleted
|
3114
|
-
@discounts = discounts
|
3115
|
-
@id = id
|
3116
|
-
@metadata = metadata
|
3117
|
-
@plan = plan
|
3118
|
-
@price = price
|
3119
|
-
@price_data = price_data
|
3120
|
-
@quantity = quantity
|
3121
|
-
@tax_rates = tax_rates
|
3122
|
-
end
|
3123
|
-
end
|
3124
|
-
|
3125
|
-
class SubscriptionPrebilling < Stripe::RequestParams
|
3126
|
-
# This is used to determine the number of billing cycles to prebill.
|
3127
|
-
attr_accessor :iterations
|
3128
|
-
|
3129
|
-
def initialize(iterations: nil)
|
3130
|
-
@iterations = iterations
|
3131
|
-
end
|
3132
|
-
end
|
3133
|
-
# Settings for automatic tax lookup for this invoice preview.
|
3134
|
-
attr_accessor :automatic_tax
|
3135
|
-
# The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead.
|
3136
|
-
attr_accessor :coupon
|
3137
|
-
# The currency to preview this invoice in. Defaults to that of `customer` if not specified.
|
3138
|
-
attr_accessor :currency
|
3139
|
-
# 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.
|
3140
|
-
attr_accessor :customer
|
3141
|
-
# 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.
|
3142
|
-
attr_accessor :customer_details
|
3143
|
-
# 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.
|
3144
|
-
attr_accessor :discounts
|
3145
|
-
# Specifies which fields in the response should be expanded.
|
3146
|
-
attr_accessor :expand
|
3147
|
-
# List of invoice items to add or update in the upcoming invoice preview (up to 250).
|
3148
|
-
attr_accessor :invoice_items
|
3149
|
-
# The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
|
3150
|
-
attr_accessor :issuer
|
3151
|
-
# The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details.
|
3152
|
-
attr_accessor :on_behalf_of
|
3153
|
-
# Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified.
|
3154
|
-
attr_accessor :preview_mode
|
3155
|
-
# The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields.
|
3156
|
-
attr_accessor :schedule
|
3157
|
-
# The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields.
|
3158
|
-
attr_accessor :schedule_details
|
3159
|
-
# The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions.
|
3160
|
-
attr_accessor :subscription
|
3161
|
-
# 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`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.billing_cycle_anchor` instead.
|
3162
|
-
attr_accessor :subscription_billing_cycle_anchor
|
3163
|
-
# 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. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at` instead.
|
3164
|
-
attr_accessor :subscription_cancel_at
|
3165
|
-
# Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead.
|
3166
|
-
attr_accessor :subscription_cancel_at_period_end
|
3167
|
-
# This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_now` instead.
|
3168
|
-
attr_accessor :subscription_cancel_now
|
3169
|
-
# If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. This field has been deprecated and will be removed in a future API version. Use `subscription_details.default_tax_rates` instead.
|
3170
|
-
attr_accessor :subscription_default_tax_rates
|
3171
|
-
# The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields.
|
3172
|
-
attr_accessor :subscription_details
|
3173
|
-
# A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use `subscription_details.items` instead.
|
3174
|
-
attr_accessor :subscription_items
|
3175
|
-
# The pre-billing to apply to the subscription as a preview. This field has been deprecated and will be removed in a future API version. Use `subscription_details.prebilling` instead.
|
3176
|
-
attr_accessor :subscription_prebilling
|
3177
|
-
# 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`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_behavior` instead.
|
3178
|
-
attr_accessor :subscription_proration_behavior
|
3179
|
-
# If previewing an update to a subscription, and doing proration, `subscription_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_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_date` instead.
|
3180
|
-
attr_accessor :subscription_proration_date
|
3181
|
-
# For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use `subscription_details.resume_at` instead.
|
3182
|
-
attr_accessor :subscription_resume_at
|
3183
|
-
# Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use `subscription_details.start_date` instead.
|
3184
|
-
attr_accessor :subscription_start_date
|
3185
|
-
# If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. This field has been deprecated and will be removed in a future API version. Use `subscription_details.trial_end` instead.
|
3186
|
-
attr_accessor :subscription_trial_end
|
3187
|
-
# Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.
|
3188
|
-
attr_accessor :subscription_trial_from_plan
|
3189
|
-
|
3190
|
-
def initialize(
|
3191
|
-
automatic_tax: nil,
|
3192
|
-
coupon: nil,
|
3193
|
-
currency: nil,
|
3194
|
-
customer: nil,
|
3195
|
-
customer_details: nil,
|
3196
|
-
discounts: nil,
|
3197
|
-
expand: nil,
|
3198
|
-
invoice_items: nil,
|
3199
|
-
issuer: nil,
|
3200
|
-
on_behalf_of: nil,
|
3201
|
-
preview_mode: nil,
|
3202
|
-
schedule: nil,
|
3203
|
-
schedule_details: nil,
|
3204
|
-
subscription: nil,
|
3205
|
-
subscription_billing_cycle_anchor: nil,
|
3206
|
-
subscription_cancel_at: nil,
|
3207
|
-
subscription_cancel_at_period_end: nil,
|
3208
|
-
subscription_cancel_now: nil,
|
3209
|
-
subscription_default_tax_rates: nil,
|
3210
|
-
subscription_details: nil,
|
3211
|
-
subscription_items: nil,
|
3212
|
-
subscription_prebilling: nil,
|
3213
|
-
subscription_proration_behavior: nil,
|
3214
|
-
subscription_proration_date: nil,
|
3215
|
-
subscription_resume_at: nil,
|
3216
|
-
subscription_start_date: nil,
|
3217
|
-
subscription_trial_end: nil,
|
3218
|
-
subscription_trial_from_plan: nil
|
3219
|
-
)
|
3220
|
-
@automatic_tax = automatic_tax
|
3221
|
-
@coupon = coupon
|
3222
|
-
@currency = currency
|
3223
|
-
@customer = customer
|
3224
|
-
@customer_details = customer_details
|
3225
|
-
@discounts = discounts
|
3226
|
-
@expand = expand
|
3227
|
-
@invoice_items = invoice_items
|
3228
|
-
@issuer = issuer
|
3229
|
-
@on_behalf_of = on_behalf_of
|
3230
|
-
@preview_mode = preview_mode
|
3231
|
-
@schedule = schedule
|
3232
|
-
@schedule_details = schedule_details
|
3233
|
-
@subscription = subscription
|
3234
|
-
@subscription_billing_cycle_anchor = subscription_billing_cycle_anchor
|
3235
|
-
@subscription_cancel_at = subscription_cancel_at
|
3236
|
-
@subscription_cancel_at_period_end = subscription_cancel_at_period_end
|
3237
|
-
@subscription_cancel_now = subscription_cancel_now
|
3238
|
-
@subscription_default_tax_rates = subscription_default_tax_rates
|
3239
|
-
@subscription_details = subscription_details
|
3240
|
-
@subscription_items = subscription_items
|
3241
|
-
@subscription_prebilling = subscription_prebilling
|
3242
|
-
@subscription_proration_behavior = subscription_proration_behavior
|
3243
|
-
@subscription_proration_date = subscription_proration_date
|
3244
|
-
@subscription_resume_at = subscription_resume_at
|
3245
|
-
@subscription_start_date = subscription_start_date
|
3246
|
-
@subscription_trial_end = subscription_trial_end
|
3247
|
-
@subscription_trial_from_plan = subscription_trial_from_plan
|
3248
|
-
end
|
3249
|
-
end
|
3250
|
-
|
3251
|
-
class AddLinesParams < Stripe::RequestParams
|
3252
|
-
class Line < Stripe::RequestParams
|
3253
|
-
class Discount < Stripe::RequestParams
|
3254
|
-
class DiscountEnd < Stripe::RequestParams
|
3255
|
-
class Duration < Stripe::RequestParams
|
3256
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
3257
|
-
attr_accessor :interval
|
3258
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
3259
|
-
attr_accessor :interval_count
|
3260
|
-
|
3261
|
-
def initialize(interval: nil, interval_count: nil)
|
3262
|
-
@interval = interval
|
3263
|
-
@interval_count = interval_count
|
3264
|
-
end
|
3265
|
-
end
|
3266
|
-
# Time span for the redeemed discount.
|
3267
|
-
attr_accessor :duration
|
3268
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
3269
|
-
attr_accessor :timestamp
|
3270
|
-
# The type of calculation made to determine when the discount ends.
|
3271
|
-
attr_accessor :type
|
3272
|
-
|
3273
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
3274
|
-
@duration = duration
|
3275
|
-
@timestamp = timestamp
|
3276
|
-
@type = type
|
3277
|
-
end
|
3278
|
-
end
|
3279
|
-
# ID of the coupon to create a new discount for.
|
3280
|
-
attr_accessor :coupon
|
3281
|
-
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
3282
|
-
attr_accessor :discount
|
3283
|
-
# Details to determine how long the discount should be applied for.
|
3284
|
-
attr_accessor :discount_end
|
3285
|
-
# ID of the promotion code to create a new discount for.
|
3286
|
-
attr_accessor :promotion_code
|
3287
|
-
|
3288
|
-
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
3289
|
-
@coupon = coupon
|
3290
|
-
@discount = discount
|
3291
|
-
@discount_end = discount_end
|
3292
|
-
@promotion_code = promotion_code
|
3293
|
-
end
|
3294
|
-
end
|
3295
|
-
|
3296
|
-
class Period < Stripe::RequestParams
|
3297
|
-
# The end of the period, which must be greater than or equal to the start. This value is inclusive.
|
3298
|
-
attr_accessor :end
|
3299
|
-
# The start of the period. This value is inclusive.
|
3300
|
-
attr_accessor :start
|
3301
|
-
|
3302
|
-
def initialize(end_: nil, start: nil)
|
3303
|
-
@end = end_
|
3304
|
-
@start = start
|
3305
|
-
end
|
3306
|
-
end
|
3307
|
-
|
3308
|
-
class PriceData < Stripe::RequestParams
|
3309
|
-
class ProductData < Stripe::RequestParams
|
3310
|
-
# The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
|
3311
|
-
attr_accessor :description
|
3312
|
-
# A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
|
3313
|
-
attr_accessor :images
|
3314
|
-
# 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`.
|
3315
|
-
attr_accessor :metadata
|
3316
|
-
# The product's name, meant to be displayable to the customer.
|
3317
|
-
attr_accessor :name
|
3318
|
-
# A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
|
3319
|
-
attr_accessor :tax_code
|
3320
1348
|
|
3321
|
-
|
3322
|
-
|
3323
|
-
|
3324
|
-
@metadata = metadata
|
3325
|
-
@name = name
|
3326
|
-
@tax_code = tax_code
|
3327
|
-
end
|
3328
|
-
end
|
3329
|
-
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
3330
|
-
attr_accessor :currency
|
3331
|
-
# The ID of the product that this price will belong to. One of `product` or `product_data` is required.
|
3332
|
-
attr_accessor :product
|
3333
|
-
# Data used to generate a new product object inline. One of `product` or `product_data` is required.
|
3334
|
-
attr_accessor :product_data
|
3335
|
-
# Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
|
3336
|
-
attr_accessor :tax_behavior
|
3337
|
-
# A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
|
3338
|
-
attr_accessor :unit_amount
|
3339
|
-
# Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
|
3340
|
-
attr_accessor :unit_amount_decimal
|
1349
|
+
class Pricing < Stripe::RequestParams
|
1350
|
+
# The ID of the price object.
|
1351
|
+
attr_accessor :price
|
3341
1352
|
|
3342
|
-
def initialize(
|
3343
|
-
|
3344
|
-
product: nil,
|
3345
|
-
product_data: nil,
|
3346
|
-
tax_behavior: nil,
|
3347
|
-
unit_amount: nil,
|
3348
|
-
unit_amount_decimal: nil
|
3349
|
-
)
|
3350
|
-
@currency = currency
|
3351
|
-
@product = product
|
3352
|
-
@product_data = product_data
|
3353
|
-
@tax_behavior = tax_behavior
|
3354
|
-
@unit_amount = unit_amount
|
3355
|
-
@unit_amount_decimal = unit_amount_decimal
|
1353
|
+
def initialize(price: nil)
|
1354
|
+
@price = price
|
3356
1355
|
end
|
3357
1356
|
end
|
3358
1357
|
|
@@ -3368,6 +1367,8 @@ module Stripe
|
|
3368
1367
|
attr_accessor :inclusive
|
3369
1368
|
# The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.
|
3370
1369
|
attr_accessor :jurisdiction
|
1370
|
+
# The level of the jurisdiction that imposes this tax rate.
|
1371
|
+
attr_accessor :jurisdiction_level
|
3371
1372
|
# The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero.
|
3372
1373
|
attr_accessor :percentage
|
3373
1374
|
# [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States.
|
@@ -3381,6 +1382,7 @@ module Stripe
|
|
3381
1382
|
display_name: nil,
|
3382
1383
|
inclusive: nil,
|
3383
1384
|
jurisdiction: nil,
|
1385
|
+
jurisdiction_level: nil,
|
3384
1386
|
percentage: nil,
|
3385
1387
|
state: nil,
|
3386
1388
|
tax_type: nil
|
@@ -3390,6 +1392,7 @@ module Stripe
|
|
3390
1392
|
@display_name = display_name
|
3391
1393
|
@inclusive = inclusive
|
3392
1394
|
@jurisdiction = jurisdiction
|
1395
|
+
@jurisdiction_level = jurisdiction_level
|
3393
1396
|
@percentage = percentage
|
3394
1397
|
@state = state
|
3395
1398
|
@tax_type = tax_type
|
@@ -3401,12 +1404,20 @@ module Stripe
|
|
3401
1404
|
#
|
3402
1405
|
# Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item’s `tax_rates`, and cannot be directly added to invoices, payments, or line items.
|
3403
1406
|
attr_accessor :tax_rate_data
|
1407
|
+
# The reasoning behind this tax, for example, if the product is tax exempt.
|
1408
|
+
attr_accessor :taxability_reason
|
3404
1409
|
# The amount on which tax is calculated, in cents (or local equivalent).
|
3405
1410
|
attr_accessor :taxable_amount
|
3406
1411
|
|
3407
|
-
def initialize(
|
1412
|
+
def initialize(
|
1413
|
+
amount: nil,
|
1414
|
+
tax_rate_data: nil,
|
1415
|
+
taxability_reason: nil,
|
1416
|
+
taxable_amount: nil
|
1417
|
+
)
|
3408
1418
|
@amount = amount
|
3409
1419
|
@tax_rate_data = tax_rate_data
|
1420
|
+
@taxability_reason = taxability_reason
|
3410
1421
|
@taxable_amount = taxable_amount
|
3411
1422
|
end
|
3412
1423
|
end
|
@@ -3420,16 +1431,14 @@ module Stripe
|
|
3420
1431
|
attr_accessor :discounts
|
3421
1432
|
# ID of an unassigned invoice item to assign to this invoice. If not provided, a new item will be created.
|
3422
1433
|
attr_accessor :invoice_item
|
3423
|
-
# 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.
|
3424
|
-
attr_accessor :margins
|
3425
1434
|
# 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`.
|
3426
1435
|
attr_accessor :metadata
|
3427
1436
|
# 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.
|
3428
1437
|
attr_accessor :period
|
3429
|
-
#
|
3430
|
-
attr_accessor :price
|
3431
|
-
# Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
|
1438
|
+
# Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
|
3432
1439
|
attr_accessor :price_data
|
1440
|
+
# The pricing information for the invoice item.
|
1441
|
+
attr_accessor :pricing
|
3433
1442
|
# Non-negative integer. The quantity of units for the line item.
|
3434
1443
|
attr_accessor :quantity
|
3435
1444
|
# A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts.
|
@@ -3443,11 +1452,10 @@ module Stripe
|
|
3443
1452
|
discountable: nil,
|
3444
1453
|
discounts: nil,
|
3445
1454
|
invoice_item: nil,
|
3446
|
-
margins: nil,
|
3447
1455
|
metadata: nil,
|
3448
1456
|
period: nil,
|
3449
|
-
price: nil,
|
3450
1457
|
price_data: nil,
|
1458
|
+
pricing: nil,
|
3451
1459
|
quantity: nil,
|
3452
1460
|
tax_amounts: nil,
|
3453
1461
|
tax_rates: nil
|
@@ -3457,11 +1465,10 @@ module Stripe
|
|
3457
1465
|
@discountable = discountable
|
3458
1466
|
@discounts = discounts
|
3459
1467
|
@invoice_item = invoice_item
|
3460
|
-
@margins = margins
|
3461
1468
|
@metadata = metadata
|
3462
1469
|
@period = period
|
3463
|
-
@price = price
|
3464
1470
|
@price_data = price_data
|
1471
|
+
@pricing = pricing
|
3465
1472
|
@quantity = quantity
|
3466
1473
|
@tax_amounts = tax_amounts
|
3467
1474
|
@tax_rates = tax_rates
|
@@ -3481,78 +1488,6 @@ module Stripe
|
|
3481
1488
|
end
|
3482
1489
|
end
|
3483
1490
|
|
3484
|
-
class AttachPaymentParams < Stripe::RequestParams
|
3485
|
-
class PaymentRecordData < Stripe::RequestParams
|
3486
|
-
# The amount that was paid out of band.
|
3487
|
-
attr_accessor :amount
|
3488
|
-
# The currency that was paid out of band.
|
3489
|
-
attr_accessor :currency
|
3490
|
-
# 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`.
|
3491
|
-
attr_accessor :metadata
|
3492
|
-
# The type of money movement for this out of band payment record.
|
3493
|
-
attr_accessor :money_movement_type
|
3494
|
-
# The timestamp when this out of band payment was paid.
|
3495
|
-
attr_accessor :paid_at
|
3496
|
-
# The reference for this out of band payment record.
|
3497
|
-
attr_accessor :payment_reference
|
3498
|
-
|
3499
|
-
def initialize(
|
3500
|
-
amount: nil,
|
3501
|
-
currency: nil,
|
3502
|
-
metadata: nil,
|
3503
|
-
money_movement_type: nil,
|
3504
|
-
paid_at: nil,
|
3505
|
-
payment_reference: nil
|
3506
|
-
)
|
3507
|
-
@amount = amount
|
3508
|
-
@currency = currency
|
3509
|
-
@metadata = metadata
|
3510
|
-
@money_movement_type = money_movement_type
|
3511
|
-
@paid_at = paid_at
|
3512
|
-
@payment_reference = payment_reference
|
3513
|
-
end
|
3514
|
-
end
|
3515
|
-
# The portion of the `amount` on the PaymentIntent or out of band payment to apply to this invoice. It defaults to the entire amount.
|
3516
|
-
attr_accessor :amount_requested
|
3517
|
-
# Specifies which fields in the response should be expanded.
|
3518
|
-
attr_accessor :expand
|
3519
|
-
# The ID of the PaymentIntent to attach to the invoice.
|
3520
|
-
attr_accessor :payment_intent
|
3521
|
-
# The ID of the PaymentRecord to attach to the invoice.
|
3522
|
-
attr_accessor :payment_record
|
3523
|
-
# The PaymentRecord data for attaching an out of band payment to the invoice.
|
3524
|
-
attr_accessor :payment_record_data
|
3525
|
-
|
3526
|
-
def initialize(
|
3527
|
-
amount_requested: nil,
|
3528
|
-
expand: nil,
|
3529
|
-
payment_intent: nil,
|
3530
|
-
payment_record: nil,
|
3531
|
-
payment_record_data: nil
|
3532
|
-
)
|
3533
|
-
@amount_requested = amount_requested
|
3534
|
-
@expand = expand
|
3535
|
-
@payment_intent = payment_intent
|
3536
|
-
@payment_record = payment_record
|
3537
|
-
@payment_record_data = payment_record_data
|
3538
|
-
end
|
3539
|
-
end
|
3540
|
-
|
3541
|
-
class AttachPaymentIntentParams < Stripe::RequestParams
|
3542
|
-
# The portion of the PaymentIntent’s `amount` that should be applied to thisinvoice. Defaults to the entire amount.
|
3543
|
-
attr_accessor :amount_requested
|
3544
|
-
# Specifies which fields in the response should be expanded.
|
3545
|
-
attr_accessor :expand
|
3546
|
-
# The ID of the PaymentIntent to attach to the invoice.
|
3547
|
-
attr_accessor :payment_intent
|
3548
|
-
|
3549
|
-
def initialize(amount_requested: nil, expand: nil, payment_intent: nil)
|
3550
|
-
@amount_requested = amount_requested
|
3551
|
-
@expand = expand
|
3552
|
-
@payment_intent = payment_intent
|
3553
|
-
end
|
3554
|
-
end
|
3555
|
-
|
3556
1491
|
class FinalizeInvoiceParams < Stripe::RequestParams
|
3557
1492
|
# 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.
|
3558
1493
|
attr_accessor :auto_advance
|
@@ -3641,52 +1576,24 @@ module Stripe
|
|
3641
1576
|
# Specifies which fields in the response should be expanded.
|
3642
1577
|
attr_accessor :expand
|
3643
1578
|
|
3644
|
-
def initialize(expand: nil)
|
3645
|
-
@expand = expand
|
3646
|
-
end
|
3647
|
-
end
|
3648
|
-
|
3649
|
-
class UpdateLinesParams < Stripe::RequestParams
|
3650
|
-
class Line < Stripe::RequestParams
|
3651
|
-
class Discount < Stripe::RequestParams
|
3652
|
-
class DiscountEnd < Stripe::RequestParams
|
3653
|
-
class Duration < Stripe::RequestParams
|
3654
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
3655
|
-
attr_accessor :interval
|
3656
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
3657
|
-
attr_accessor :interval_count
|
3658
|
-
|
3659
|
-
def initialize(interval: nil, interval_count: nil)
|
3660
|
-
@interval = interval
|
3661
|
-
@interval_count = interval_count
|
3662
|
-
end
|
3663
|
-
end
|
3664
|
-
# Time span for the redeemed discount.
|
3665
|
-
attr_accessor :duration
|
3666
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
3667
|
-
attr_accessor :timestamp
|
3668
|
-
# The type of calculation made to determine when the discount ends.
|
3669
|
-
attr_accessor :type
|
3670
|
-
|
3671
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
3672
|
-
@duration = duration
|
3673
|
-
@timestamp = timestamp
|
3674
|
-
@type = type
|
3675
|
-
end
|
3676
|
-
end
|
1579
|
+
def initialize(expand: nil)
|
1580
|
+
@expand = expand
|
1581
|
+
end
|
1582
|
+
end
|
1583
|
+
|
1584
|
+
class UpdateLinesParams < Stripe::RequestParams
|
1585
|
+
class Line < Stripe::RequestParams
|
1586
|
+
class Discount < Stripe::RequestParams
|
3677
1587
|
# ID of the coupon to create a new discount for.
|
3678
1588
|
attr_accessor :coupon
|
3679
1589
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
3680
1590
|
attr_accessor :discount
|
3681
|
-
# Details to determine how long the discount should be applied for.
|
3682
|
-
attr_accessor :discount_end
|
3683
1591
|
# ID of the promotion code to create a new discount for.
|
3684
1592
|
attr_accessor :promotion_code
|
3685
1593
|
|
3686
|
-
def initialize(coupon: nil, discount: nil,
|
1594
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
3687
1595
|
@coupon = coupon
|
3688
1596
|
@discount = discount
|
3689
|
-
@discount_end = discount_end
|
3690
1597
|
@promotion_code = promotion_code
|
3691
1598
|
end
|
3692
1599
|
end
|
@@ -3726,9 +1633,9 @@ module Stripe
|
|
3726
1633
|
end
|
3727
1634
|
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
3728
1635
|
attr_accessor :currency
|
3729
|
-
# The ID of the
|
1636
|
+
# The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required.
|
3730
1637
|
attr_accessor :product
|
3731
|
-
# Data used to generate a new
|
1638
|
+
# Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required.
|
3732
1639
|
attr_accessor :product_data
|
3733
1640
|
# Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
|
3734
1641
|
attr_accessor :tax_behavior
|
@@ -3754,6 +1661,15 @@ module Stripe
|
|
3754
1661
|
end
|
3755
1662
|
end
|
3756
1663
|
|
1664
|
+
class Pricing < Stripe::RequestParams
|
1665
|
+
# The ID of the price object.
|
1666
|
+
attr_accessor :price
|
1667
|
+
|
1668
|
+
def initialize(price: nil)
|
1669
|
+
@price = price
|
1670
|
+
end
|
1671
|
+
end
|
1672
|
+
|
3757
1673
|
class TaxAmount < Stripe::RequestParams
|
3758
1674
|
class TaxRateData < Stripe::RequestParams
|
3759
1675
|
# Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
|
@@ -3766,6 +1682,8 @@ module Stripe
|
|
3766
1682
|
attr_accessor :inclusive
|
3767
1683
|
# The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.
|
3768
1684
|
attr_accessor :jurisdiction
|
1685
|
+
# The level of the jurisdiction that imposes this tax rate.
|
1686
|
+
attr_accessor :jurisdiction_level
|
3769
1687
|
# The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero.
|
3770
1688
|
attr_accessor :percentage
|
3771
1689
|
# [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States.
|
@@ -3779,6 +1697,7 @@ module Stripe
|
|
3779
1697
|
display_name: nil,
|
3780
1698
|
inclusive: nil,
|
3781
1699
|
jurisdiction: nil,
|
1700
|
+
jurisdiction_level: nil,
|
3782
1701
|
percentage: nil,
|
3783
1702
|
state: nil,
|
3784
1703
|
tax_type: nil
|
@@ -3788,6 +1707,7 @@ module Stripe
|
|
3788
1707
|
@display_name = display_name
|
3789
1708
|
@inclusive = inclusive
|
3790
1709
|
@jurisdiction = jurisdiction
|
1710
|
+
@jurisdiction_level = jurisdiction_level
|
3791
1711
|
@percentage = percentage
|
3792
1712
|
@state = state
|
3793
1713
|
@tax_type = tax_type
|
@@ -3799,12 +1719,20 @@ module Stripe
|
|
3799
1719
|
#
|
3800
1720
|
# Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item’s `tax_rates`, and cannot be directly added to invoices, payments, or line items.
|
3801
1721
|
attr_accessor :tax_rate_data
|
1722
|
+
# The reasoning behind this tax, for example, if the product is tax exempt.
|
1723
|
+
attr_accessor :taxability_reason
|
3802
1724
|
# The amount on which tax is calculated, in cents (or local equivalent).
|
3803
1725
|
attr_accessor :taxable_amount
|
3804
1726
|
|
3805
|
-
def initialize(
|
1727
|
+
def initialize(
|
1728
|
+
amount: nil,
|
1729
|
+
tax_rate_data: nil,
|
1730
|
+
taxability_reason: nil,
|
1731
|
+
taxable_amount: nil
|
1732
|
+
)
|
3806
1733
|
@amount = amount
|
3807
1734
|
@tax_rate_data = tax_rate_data
|
1735
|
+
@taxability_reason = taxability_reason
|
3808
1736
|
@taxable_amount = taxable_amount
|
3809
1737
|
end
|
3810
1738
|
end
|
@@ -3818,16 +1746,14 @@ module Stripe
|
|
3818
1746
|
attr_accessor :discounts
|
3819
1747
|
# ID of an existing line item on the invoice.
|
3820
1748
|
attr_accessor :id
|
3821
|
-
# 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.
|
3822
|
-
attr_accessor :margins
|
3823
1749
|
# 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.
|
3824
1750
|
attr_accessor :metadata
|
3825
1751
|
# 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.
|
3826
1752
|
attr_accessor :period
|
3827
|
-
#
|
3828
|
-
attr_accessor :price
|
3829
|
-
# Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
|
1753
|
+
# Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
|
3830
1754
|
attr_accessor :price_data
|
1755
|
+
# The pricing information for the invoice item.
|
1756
|
+
attr_accessor :pricing
|
3831
1757
|
# Non-negative integer. The quantity of units for the line item.
|
3832
1758
|
attr_accessor :quantity
|
3833
1759
|
# A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts.
|
@@ -3841,11 +1767,10 @@ module Stripe
|
|
3841
1767
|
discountable: nil,
|
3842
1768
|
discounts: nil,
|
3843
1769
|
id: nil,
|
3844
|
-
margins: nil,
|
3845
1770
|
metadata: nil,
|
3846
1771
|
period: nil,
|
3847
|
-
price: nil,
|
3848
1772
|
price_data: nil,
|
1773
|
+
pricing: nil,
|
3849
1774
|
quantity: nil,
|
3850
1775
|
tax_amounts: nil,
|
3851
1776
|
tax_rates: nil
|
@@ -3855,11 +1780,10 @@ module Stripe
|
|
3855
1780
|
@discountable = discountable
|
3856
1781
|
@discounts = discounts
|
3857
1782
|
@id = id
|
3858
|
-
@margins = margins
|
3859
1783
|
@metadata = metadata
|
3860
1784
|
@period = period
|
3861
|
-
@price = price
|
3862
1785
|
@price_data = price_data
|
1786
|
+
@pricing = pricing
|
3863
1787
|
@quantity = quantity
|
3864
1788
|
@tax_amounts = tax_amounts
|
3865
1789
|
@tax_rates = tax_rates
|
@@ -4030,88 +1954,32 @@ module Stripe
|
|
4030
1954
|
end
|
4031
1955
|
|
4032
1956
|
class Discount < Stripe::RequestParams
|
4033
|
-
class DiscountEnd < Stripe::RequestParams
|
4034
|
-
class Duration < Stripe::RequestParams
|
4035
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
4036
|
-
attr_accessor :interval
|
4037
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
4038
|
-
attr_accessor :interval_count
|
4039
|
-
|
4040
|
-
def initialize(interval: nil, interval_count: nil)
|
4041
|
-
@interval = interval
|
4042
|
-
@interval_count = interval_count
|
4043
|
-
end
|
4044
|
-
end
|
4045
|
-
# Time span for the redeemed discount.
|
4046
|
-
attr_accessor :duration
|
4047
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
4048
|
-
attr_accessor :timestamp
|
4049
|
-
# The type of calculation made to determine when the discount ends.
|
4050
|
-
attr_accessor :type
|
4051
|
-
|
4052
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
4053
|
-
@duration = duration
|
4054
|
-
@timestamp = timestamp
|
4055
|
-
@type = type
|
4056
|
-
end
|
4057
|
-
end
|
4058
1957
|
# ID of the coupon to create a new discount for.
|
4059
1958
|
attr_accessor :coupon
|
4060
1959
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
4061
1960
|
attr_accessor :discount
|
4062
|
-
# Details to determine how long the discount should be applied for.
|
4063
|
-
attr_accessor :discount_end
|
4064
1961
|
# ID of the promotion code to create a new discount for.
|
4065
1962
|
attr_accessor :promotion_code
|
4066
1963
|
|
4067
|
-
def initialize(coupon: nil, discount: nil,
|
1964
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
4068
1965
|
@coupon = coupon
|
4069
1966
|
@discount = discount
|
4070
|
-
@discount_end = discount_end
|
4071
1967
|
@promotion_code = promotion_code
|
4072
1968
|
end
|
4073
1969
|
end
|
4074
1970
|
|
4075
1971
|
class InvoiceItem < Stripe::RequestParams
|
4076
1972
|
class Discount < Stripe::RequestParams
|
4077
|
-
class DiscountEnd < Stripe::RequestParams
|
4078
|
-
class Duration < Stripe::RequestParams
|
4079
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
4080
|
-
attr_accessor :interval
|
4081
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
4082
|
-
attr_accessor :interval_count
|
4083
|
-
|
4084
|
-
def initialize(interval: nil, interval_count: nil)
|
4085
|
-
@interval = interval
|
4086
|
-
@interval_count = interval_count
|
4087
|
-
end
|
4088
|
-
end
|
4089
|
-
# Time span for the redeemed discount.
|
4090
|
-
attr_accessor :duration
|
4091
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
4092
|
-
attr_accessor :timestamp
|
4093
|
-
# The type of calculation made to determine when the discount ends.
|
4094
|
-
attr_accessor :type
|
4095
|
-
|
4096
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
4097
|
-
@duration = duration
|
4098
|
-
@timestamp = timestamp
|
4099
|
-
@type = type
|
4100
|
-
end
|
4101
|
-
end
|
4102
1973
|
# ID of the coupon to create a new discount for.
|
4103
1974
|
attr_accessor :coupon
|
4104
1975
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
4105
1976
|
attr_accessor :discount
|
4106
|
-
# Details to determine how long the discount should be applied for.
|
4107
|
-
attr_accessor :discount_end
|
4108
1977
|
# ID of the promotion code to create a new discount for.
|
4109
1978
|
attr_accessor :promotion_code
|
4110
1979
|
|
4111
|
-
def initialize(coupon: nil, discount: nil,
|
1980
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
4112
1981
|
@coupon = coupon
|
4113
1982
|
@discount = discount
|
4114
|
-
@discount_end = discount_end
|
4115
1983
|
@promotion_code = promotion_code
|
4116
1984
|
end
|
4117
1985
|
end
|
@@ -4126,610 +1994,130 @@ module Stripe
|
|
4126
1994
|
@end = end_
|
4127
1995
|
@start = start
|
4128
1996
|
end
|
4129
|
-
end
|
4130
|
-
|
4131
|
-
class PriceData < Stripe::RequestParams
|
4132
|
-
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
4133
|
-
attr_accessor :currency
|
4134
|
-
# The ID of the product that this price will belong to.
|
4135
|
-
attr_accessor :product
|
4136
|
-
# Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
|
4137
|
-
attr_accessor :tax_behavior
|
4138
|
-
# A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
|
4139
|
-
attr_accessor :unit_amount
|
4140
|
-
# Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
|
4141
|
-
attr_accessor :unit_amount_decimal
|
4142
|
-
|
4143
|
-
def initialize(
|
4144
|
-
currency: nil,
|
4145
|
-
product: nil,
|
4146
|
-
tax_behavior: nil,
|
4147
|
-
unit_amount: nil,
|
4148
|
-
unit_amount_decimal: nil
|
4149
|
-
)
|
4150
|
-
@currency = currency
|
4151
|
-
@product = product
|
4152
|
-
@tax_behavior = tax_behavior
|
4153
|
-
@unit_amount = unit_amount
|
4154
|
-
@unit_amount_decimal = unit_amount_decimal
|
4155
|
-
end
|
4156
|
-
end
|
4157
|
-
# The integer amount in cents (or local equivalent) of previewed invoice item.
|
4158
|
-
attr_accessor :amount
|
4159
|
-
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Only applicable to new invoice items.
|
4160
|
-
attr_accessor :currency
|
4161
|
-
# An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
|
4162
|
-
attr_accessor :description
|
4163
|
-
# Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items.
|
4164
|
-
attr_accessor :discountable
|
4165
|
-
# The coupons to redeem into discounts for the invoice item in the preview.
|
4166
|
-
attr_accessor :discounts
|
4167
|
-
# The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice.
|
4168
|
-
attr_accessor :invoiceitem
|
4169
|
-
# 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`.
|
4170
|
-
attr_accessor :metadata
|
4171
|
-
# 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.
|
4172
|
-
attr_accessor :period
|
4173
|
-
# The ID of the price object. One of `price` or `price_data` is required.
|
4174
|
-
attr_accessor :price
|
4175
|
-
# Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
|
4176
|
-
attr_accessor :price_data
|
4177
|
-
# Non-negative integer. The quantity of units for the invoice item.
|
4178
|
-
attr_accessor :quantity
|
4179
|
-
# Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
|
4180
|
-
attr_accessor :tax_behavior
|
4181
|
-
# A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
|
4182
|
-
attr_accessor :tax_code
|
4183
|
-
# The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item.
|
4184
|
-
attr_accessor :tax_rates
|
4185
|
-
# The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount.
|
4186
|
-
attr_accessor :unit_amount
|
4187
|
-
# Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
|
4188
|
-
attr_accessor :unit_amount_decimal
|
4189
|
-
|
4190
|
-
def initialize(
|
4191
|
-
amount: nil,
|
4192
|
-
currency: nil,
|
4193
|
-
description: nil,
|
4194
|
-
discountable: nil,
|
4195
|
-
discounts: nil,
|
4196
|
-
invoiceitem: nil,
|
4197
|
-
metadata: nil,
|
4198
|
-
period: nil,
|
4199
|
-
price: nil,
|
4200
|
-
price_data: nil,
|
4201
|
-
quantity: nil,
|
4202
|
-
tax_behavior: nil,
|
4203
|
-
tax_code: nil,
|
4204
|
-
tax_rates: nil,
|
4205
|
-
unit_amount: nil,
|
4206
|
-
unit_amount_decimal: nil
|
4207
|
-
)
|
4208
|
-
@amount = amount
|
4209
|
-
@currency = currency
|
4210
|
-
@description = description
|
4211
|
-
@discountable = discountable
|
4212
|
-
@discounts = discounts
|
4213
|
-
@invoiceitem = invoiceitem
|
4214
|
-
@metadata = metadata
|
4215
|
-
@period = period
|
4216
|
-
@price = price
|
4217
|
-
@price_data = price_data
|
4218
|
-
@quantity = quantity
|
4219
|
-
@tax_behavior = tax_behavior
|
4220
|
-
@tax_code = tax_code
|
4221
|
-
@tax_rates = tax_rates
|
4222
|
-
@unit_amount = unit_amount
|
4223
|
-
@unit_amount_decimal = unit_amount_decimal
|
4224
|
-
end
|
4225
|
-
end
|
4226
|
-
|
4227
|
-
class Issuer < Stripe::RequestParams
|
4228
|
-
# The connected account being referenced when `type` is `account`.
|
4229
|
-
attr_accessor :account
|
4230
|
-
# Type of the account referenced in the request.
|
4231
|
-
attr_accessor :type
|
4232
|
-
|
4233
|
-
def initialize(account: nil, type: nil)
|
4234
|
-
@account = account
|
4235
|
-
@type = type
|
4236
|
-
end
|
4237
|
-
end
|
4238
|
-
|
4239
|
-
class ScheduleDetails < Stripe::RequestParams
|
4240
|
-
class Amendment < Stripe::RequestParams
|
4241
|
-
class AmendmentEnd < Stripe::RequestParams
|
4242
|
-
class DiscountEnd < Stripe::RequestParams
|
4243
|
-
# The ID of a specific discount.
|
4244
|
-
attr_accessor :discount
|
4245
|
-
|
4246
|
-
def initialize(discount: nil)
|
4247
|
-
@discount = discount
|
4248
|
-
end
|
4249
|
-
end
|
4250
|
-
|
4251
|
-
class Duration < Stripe::RequestParams
|
4252
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
4253
|
-
attr_accessor :interval
|
4254
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
4255
|
-
attr_accessor :interval_count
|
4256
|
-
|
4257
|
-
def initialize(interval: nil, interval_count: nil)
|
4258
|
-
@interval = interval
|
4259
|
-
@interval_count = interval_count
|
4260
|
-
end
|
4261
|
-
end
|
4262
|
-
# Use the `end` time of a given discount.
|
4263
|
-
attr_accessor :discount_end
|
4264
|
-
# Time span for the amendment starting from the `amendment_start`.
|
4265
|
-
attr_accessor :duration
|
4266
|
-
# A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
|
4267
|
-
attr_accessor :timestamp
|
4268
|
-
# Select one of three ways to pass the `amendment_end`.
|
4269
|
-
attr_accessor :type
|
4270
|
-
|
4271
|
-
def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
|
4272
|
-
@discount_end = discount_end
|
4273
|
-
@duration = duration
|
4274
|
-
@timestamp = timestamp
|
4275
|
-
@type = type
|
4276
|
-
end
|
4277
|
-
end
|
4278
|
-
|
4279
|
-
class AmendmentStart < Stripe::RequestParams
|
4280
|
-
class AmendmentEnd < Stripe::RequestParams
|
4281
|
-
# 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.
|
4282
|
-
attr_accessor :index
|
4283
|
-
|
4284
|
-
def initialize(index: nil)
|
4285
|
-
@index = index
|
4286
|
-
end
|
4287
|
-
end
|
4288
|
-
|
4289
|
-
class DiscountEnd < Stripe::RequestParams
|
4290
|
-
# The ID of a specific discount.
|
4291
|
-
attr_accessor :discount
|
4292
|
-
|
4293
|
-
def initialize(discount: nil)
|
4294
|
-
@discount = discount
|
4295
|
-
end
|
4296
|
-
end
|
4297
|
-
# Details of another amendment in the same array, immediately after which this amendment should begin.
|
4298
|
-
attr_accessor :amendment_end
|
4299
|
-
# Use the `end` time of a given discount.
|
4300
|
-
attr_accessor :discount_end
|
4301
|
-
# A precise Unix timestamp for the amendment to start.
|
4302
|
-
attr_accessor :timestamp
|
4303
|
-
# Select one of three ways to pass the `amendment_start`.
|
4304
|
-
attr_accessor :type
|
4305
|
-
|
4306
|
-
def initialize(amendment_end: nil, discount_end: nil, timestamp: nil, type: nil)
|
4307
|
-
@amendment_end = amendment_end
|
4308
|
-
@discount_end = discount_end
|
4309
|
-
@timestamp = timestamp
|
4310
|
-
@type = type
|
4311
|
-
end
|
4312
|
-
end
|
4313
|
-
|
4314
|
-
class DiscountAction < Stripe::RequestParams
|
4315
|
-
class Add < Stripe::RequestParams
|
4316
|
-
class DiscountEnd < Stripe::RequestParams
|
4317
|
-
# The type of calculation made to determine when the discount ends.
|
4318
|
-
attr_accessor :type
|
4319
|
-
|
4320
|
-
def initialize(type: nil)
|
4321
|
-
@type = type
|
4322
|
-
end
|
4323
|
-
end
|
4324
|
-
# The coupon code to redeem.
|
4325
|
-
attr_accessor :coupon
|
4326
|
-
# An ID of an existing discount for a coupon that was already redeemed.
|
4327
|
-
attr_accessor :discount
|
4328
|
-
# Details to determine how long the discount should be applied for.
|
4329
|
-
attr_accessor :discount_end
|
4330
|
-
# 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.
|
4331
|
-
attr_accessor :index
|
4332
|
-
# The promotion code to redeem.
|
4333
|
-
attr_accessor :promotion_code
|
4334
|
-
|
4335
|
-
def initialize(
|
4336
|
-
coupon: nil,
|
4337
|
-
discount: nil,
|
4338
|
-
discount_end: nil,
|
4339
|
-
index: nil,
|
4340
|
-
promotion_code: nil
|
4341
|
-
)
|
4342
|
-
@coupon = coupon
|
4343
|
-
@discount = discount
|
4344
|
-
@discount_end = discount_end
|
4345
|
-
@index = index
|
4346
|
-
@promotion_code = promotion_code
|
4347
|
-
end
|
4348
|
-
end
|
4349
|
-
|
4350
|
-
class Remove < Stripe::RequestParams
|
4351
|
-
# The coupon code to remove from the `discounts` array.
|
4352
|
-
attr_accessor :coupon
|
4353
|
-
# The ID of a discount to remove from the `discounts` array.
|
4354
|
-
attr_accessor :discount
|
4355
|
-
# The ID of a promotion code to remove from the `discounts` array.
|
4356
|
-
attr_accessor :promotion_code
|
4357
|
-
|
4358
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
4359
|
-
@coupon = coupon
|
4360
|
-
@discount = discount
|
4361
|
-
@promotion_code = promotion_code
|
4362
|
-
end
|
4363
|
-
end
|
4364
|
-
|
4365
|
-
class Set < Stripe::RequestParams
|
4366
|
-
# The coupon code to replace the `discounts` array with.
|
4367
|
-
attr_accessor :coupon
|
4368
|
-
# An ID of an existing discount to replace the `discounts` array with.
|
4369
|
-
attr_accessor :discount
|
4370
|
-
# An ID of an existing promotion code to replace the `discounts` array with.
|
4371
|
-
attr_accessor :promotion_code
|
4372
|
-
|
4373
|
-
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
4374
|
-
@coupon = coupon
|
4375
|
-
@discount = discount
|
4376
|
-
@promotion_code = promotion_code
|
4377
|
-
end
|
4378
|
-
end
|
4379
|
-
# Details of the discount to add.
|
4380
|
-
attr_accessor :add
|
4381
|
-
# Details of the discount to remove.
|
4382
|
-
attr_accessor :remove
|
4383
|
-
# Details of the discount to replace the existing discounts with.
|
4384
|
-
attr_accessor :set
|
4385
|
-
# Determines the type of discount action.
|
4386
|
-
attr_accessor :type
|
4387
|
-
|
4388
|
-
def initialize(add: nil, remove: nil, set: nil, type: nil)
|
4389
|
-
@add = add
|
4390
|
-
@remove = remove
|
4391
|
-
@set = set
|
4392
|
-
@type = type
|
4393
|
-
end
|
4394
|
-
end
|
4395
|
-
|
4396
|
-
class ItemAction < Stripe::RequestParams
|
4397
|
-
class Add < Stripe::RequestParams
|
4398
|
-
class Discount < Stripe::RequestParams
|
4399
|
-
class DiscountEnd < Stripe::RequestParams
|
4400
|
-
class Duration < Stripe::RequestParams
|
4401
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
4402
|
-
attr_accessor :interval
|
4403
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
4404
|
-
attr_accessor :interval_count
|
4405
|
-
|
4406
|
-
def initialize(interval: nil, interval_count: nil)
|
4407
|
-
@interval = interval
|
4408
|
-
@interval_count = interval_count
|
4409
|
-
end
|
4410
|
-
end
|
4411
|
-
# Time span for the redeemed discount.
|
4412
|
-
attr_accessor :duration
|
4413
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
4414
|
-
attr_accessor :timestamp
|
4415
|
-
# The type of calculation made to determine when the discount ends.
|
4416
|
-
attr_accessor :type
|
4417
|
-
|
4418
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
4419
|
-
@duration = duration
|
4420
|
-
@timestamp = timestamp
|
4421
|
-
@type = type
|
4422
|
-
end
|
4423
|
-
end
|
4424
|
-
# ID of the coupon to create a new discount for.
|
4425
|
-
attr_accessor :coupon
|
4426
|
-
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
4427
|
-
attr_accessor :discount
|
4428
|
-
# Details to determine how long the discount should be applied for.
|
4429
|
-
attr_accessor :discount_end
|
4430
|
-
# ID of the promotion code to create a new discount for.
|
4431
|
-
attr_accessor :promotion_code
|
4432
|
-
|
4433
|
-
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
4434
|
-
@coupon = coupon
|
4435
|
-
@discount = discount
|
4436
|
-
@discount_end = discount_end
|
4437
|
-
@promotion_code = promotion_code
|
4438
|
-
end
|
4439
|
-
end
|
4440
|
-
|
4441
|
-
class Trial < Stripe::RequestParams
|
4442
|
-
# 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.
|
4443
|
-
attr_accessor :converts_to
|
4444
|
-
# Determines the type of trial for this item.
|
4445
|
-
attr_accessor :type
|
4446
|
-
|
4447
|
-
def initialize(converts_to: nil, type: nil)
|
4448
|
-
@converts_to = converts_to
|
4449
|
-
@type = type
|
4450
|
-
end
|
4451
|
-
end
|
4452
|
-
# The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
|
4453
|
-
attr_accessor :discounts
|
4454
|
-
# 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`.
|
4455
|
-
attr_accessor :metadata
|
4456
|
-
# The ID of the price object.
|
4457
|
-
attr_accessor :price
|
4458
|
-
# Quantity for this item.
|
4459
|
-
attr_accessor :quantity
|
4460
|
-
# 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`.
|
4461
|
-
attr_accessor :tax_rates
|
4462
|
-
# Options that configure the trial on the subscription item.
|
4463
|
-
attr_accessor :trial
|
4464
|
-
|
4465
|
-
def initialize(
|
4466
|
-
discounts: nil,
|
4467
|
-
metadata: nil,
|
4468
|
-
price: nil,
|
4469
|
-
quantity: nil,
|
4470
|
-
tax_rates: nil,
|
4471
|
-
trial: nil
|
4472
|
-
)
|
4473
|
-
@discounts = discounts
|
4474
|
-
@metadata = metadata
|
4475
|
-
@price = price
|
4476
|
-
@quantity = quantity
|
4477
|
-
@tax_rates = tax_rates
|
4478
|
-
@trial = trial
|
4479
|
-
end
|
4480
|
-
end
|
4481
|
-
|
4482
|
-
class Remove < Stripe::RequestParams
|
4483
|
-
# ID of a price to remove.
|
4484
|
-
attr_accessor :price
|
4485
|
-
|
4486
|
-
def initialize(price: nil)
|
4487
|
-
@price = price
|
4488
|
-
end
|
4489
|
-
end
|
4490
|
-
|
4491
|
-
class Set < Stripe::RequestParams
|
4492
|
-
class Discount < Stripe::RequestParams
|
4493
|
-
class DiscountEnd < Stripe::RequestParams
|
4494
|
-
class Duration < Stripe::RequestParams
|
4495
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
4496
|
-
attr_accessor :interval
|
4497
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
4498
|
-
attr_accessor :interval_count
|
4499
|
-
|
4500
|
-
def initialize(interval: nil, interval_count: nil)
|
4501
|
-
@interval = interval
|
4502
|
-
@interval_count = interval_count
|
4503
|
-
end
|
4504
|
-
end
|
4505
|
-
# Time span for the redeemed discount.
|
4506
|
-
attr_accessor :duration
|
4507
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
4508
|
-
attr_accessor :timestamp
|
4509
|
-
# The type of calculation made to determine when the discount ends.
|
4510
|
-
attr_accessor :type
|
4511
|
-
|
4512
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
4513
|
-
@duration = duration
|
4514
|
-
@timestamp = timestamp
|
4515
|
-
@type = type
|
4516
|
-
end
|
4517
|
-
end
|
4518
|
-
# ID of the coupon to create a new discount for.
|
4519
|
-
attr_accessor :coupon
|
4520
|
-
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
4521
|
-
attr_accessor :discount
|
4522
|
-
# Details to determine how long the discount should be applied for.
|
4523
|
-
attr_accessor :discount_end
|
4524
|
-
# ID of the promotion code to create a new discount for.
|
4525
|
-
attr_accessor :promotion_code
|
4526
|
-
|
4527
|
-
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
4528
|
-
@coupon = coupon
|
4529
|
-
@discount = discount
|
4530
|
-
@discount_end = discount_end
|
4531
|
-
@promotion_code = promotion_code
|
4532
|
-
end
|
4533
|
-
end
|
4534
|
-
|
4535
|
-
class Trial < Stripe::RequestParams
|
4536
|
-
# 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.
|
4537
|
-
attr_accessor :converts_to
|
4538
|
-
# Determines the type of trial for this item.
|
4539
|
-
attr_accessor :type
|
4540
|
-
|
4541
|
-
def initialize(converts_to: nil, type: nil)
|
4542
|
-
@converts_to = converts_to
|
4543
|
-
@type = type
|
4544
|
-
end
|
4545
|
-
end
|
4546
|
-
# 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`.
|
4547
|
-
attr_accessor :discounts
|
4548
|
-
# 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`.
|
4549
|
-
attr_accessor :metadata
|
4550
|
-
# The ID of the price object.
|
4551
|
-
attr_accessor :price
|
4552
|
-
# 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`.
|
4553
|
-
attr_accessor :quantity
|
4554
|
-
# 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`.
|
4555
|
-
attr_accessor :tax_rates
|
4556
|
-
# 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`.
|
4557
|
-
attr_accessor :trial
|
4558
|
-
|
4559
|
-
def initialize(
|
4560
|
-
discounts: nil,
|
4561
|
-
metadata: nil,
|
4562
|
-
price: nil,
|
4563
|
-
quantity: nil,
|
4564
|
-
tax_rates: nil,
|
4565
|
-
trial: nil
|
4566
|
-
)
|
4567
|
-
@discounts = discounts
|
4568
|
-
@metadata = metadata
|
4569
|
-
@price = price
|
4570
|
-
@quantity = quantity
|
4571
|
-
@tax_rates = tax_rates
|
4572
|
-
@trial = trial
|
4573
|
-
end
|
4574
|
-
end
|
4575
|
-
# 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.
|
4576
|
-
attr_accessor :add
|
4577
|
-
# Details of the subscription item to remove.
|
4578
|
-
attr_accessor :remove
|
4579
|
-
# 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.
|
4580
|
-
attr_accessor :set
|
4581
|
-
# Determines the type of item action.
|
4582
|
-
attr_accessor :type
|
4583
|
-
|
4584
|
-
def initialize(add: nil, remove: nil, set: nil, type: nil)
|
4585
|
-
@add = add
|
4586
|
-
@remove = remove
|
4587
|
-
@set = set
|
4588
|
-
@type = type
|
4589
|
-
end
|
4590
|
-
end
|
4591
|
-
|
4592
|
-
class MetadataAction < Stripe::RequestParams
|
4593
|
-
# Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
|
4594
|
-
attr_accessor :add
|
4595
|
-
# Keys to remove from schedule phase metadata.
|
4596
|
-
attr_accessor :remove
|
4597
|
-
# Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
|
4598
|
-
attr_accessor :set
|
4599
|
-
# Select one of three ways to update phase-level `metadata` on subscription schedules.
|
4600
|
-
attr_accessor :type
|
4601
|
-
|
4602
|
-
def initialize(add: nil, remove: nil, set: nil, type: nil)
|
4603
|
-
@add = add
|
4604
|
-
@remove = remove
|
4605
|
-
@set = set
|
4606
|
-
@type = type
|
4607
|
-
end
|
4608
|
-
end
|
1997
|
+
end
|
4609
1998
|
|
4610
|
-
|
4611
|
-
|
4612
|
-
|
4613
|
-
|
1999
|
+
class PriceData < Stripe::RequestParams
|
2000
|
+
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
2001
|
+
attr_accessor :currency
|
2002
|
+
# The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
|
2003
|
+
attr_accessor :product
|
2004
|
+
# Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
|
2005
|
+
attr_accessor :tax_behavior
|
2006
|
+
# A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
|
2007
|
+
attr_accessor :unit_amount
|
2008
|
+
# Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
|
2009
|
+
attr_accessor :unit_amount_decimal
|
4614
2010
|
|
4615
|
-
|
4616
|
-
|
4617
|
-
|
4618
|
-
|
4619
|
-
|
4620
|
-
|
4621
|
-
|
4622
|
-
|
4623
|
-
|
4624
|
-
|
4625
|
-
|
4626
|
-
|
4627
|
-
end
|
2011
|
+
def initialize(
|
2012
|
+
currency: nil,
|
2013
|
+
product: nil,
|
2014
|
+
tax_behavior: nil,
|
2015
|
+
unit_amount: nil,
|
2016
|
+
unit_amount_decimal: nil
|
2017
|
+
)
|
2018
|
+
@currency = currency
|
2019
|
+
@product = product
|
2020
|
+
@tax_behavior = tax_behavior
|
2021
|
+
@unit_amount = unit_amount
|
2022
|
+
@unit_amount_decimal = unit_amount_decimal
|
4628
2023
|
end
|
2024
|
+
end
|
2025
|
+
# The integer amount in cents (or local equivalent) of previewed invoice item.
|
2026
|
+
attr_accessor :amount
|
2027
|
+
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Only applicable to new invoice items.
|
2028
|
+
attr_accessor :currency
|
2029
|
+
# An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
|
2030
|
+
attr_accessor :description
|
2031
|
+
# Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items.
|
2032
|
+
attr_accessor :discountable
|
2033
|
+
# The coupons to redeem into discounts for the invoice item in the preview.
|
2034
|
+
attr_accessor :discounts
|
2035
|
+
# The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice.
|
2036
|
+
attr_accessor :invoiceitem
|
2037
|
+
# 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`.
|
2038
|
+
attr_accessor :metadata
|
2039
|
+
# 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.
|
2040
|
+
attr_accessor :period
|
2041
|
+
# The ID of the price object. One of `price` or `price_data` is required.
|
2042
|
+
attr_accessor :price
|
2043
|
+
# Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
|
2044
|
+
attr_accessor :price_data
|
2045
|
+
# Non-negative integer. The quantity of units for the invoice item.
|
2046
|
+
attr_accessor :quantity
|
2047
|
+
# Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
|
2048
|
+
attr_accessor :tax_behavior
|
2049
|
+
# A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
|
2050
|
+
attr_accessor :tax_code
|
2051
|
+
# The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item.
|
2052
|
+
attr_accessor :tax_rates
|
2053
|
+
# The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount.
|
2054
|
+
attr_accessor :unit_amount
|
2055
|
+
# Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
|
2056
|
+
attr_accessor :unit_amount_decimal
|
4629
2057
|
|
4630
|
-
|
4631
|
-
|
4632
|
-
|
4633
|
-
|
4634
|
-
|
4635
|
-
|
4636
|
-
|
4637
|
-
|
4638
|
-
|
4639
|
-
|
4640
|
-
|
2058
|
+
def initialize(
|
2059
|
+
amount: nil,
|
2060
|
+
currency: nil,
|
2061
|
+
description: nil,
|
2062
|
+
discountable: nil,
|
2063
|
+
discounts: nil,
|
2064
|
+
invoiceitem: nil,
|
2065
|
+
metadata: nil,
|
2066
|
+
period: nil,
|
2067
|
+
price: nil,
|
2068
|
+
price_data: nil,
|
2069
|
+
quantity: nil,
|
2070
|
+
tax_behavior: nil,
|
2071
|
+
tax_code: nil,
|
2072
|
+
tax_rates: nil,
|
2073
|
+
unit_amount: nil,
|
2074
|
+
unit_amount_decimal: nil
|
2075
|
+
)
|
2076
|
+
@amount = amount
|
2077
|
+
@currency = currency
|
2078
|
+
@description = description
|
2079
|
+
@discountable = discountable
|
2080
|
+
@discounts = discounts
|
2081
|
+
@invoiceitem = invoiceitem
|
2082
|
+
@metadata = metadata
|
2083
|
+
@period = period
|
2084
|
+
@price = price
|
2085
|
+
@price_data = price_data
|
2086
|
+
@quantity = quantity
|
2087
|
+
@tax_behavior = tax_behavior
|
2088
|
+
@tax_code = tax_code
|
2089
|
+
@tax_rates = tax_rates
|
2090
|
+
@unit_amount = unit_amount
|
2091
|
+
@unit_amount_decimal = unit_amount_decimal
|
2092
|
+
end
|
2093
|
+
end
|
4641
2094
|
|
4642
|
-
|
4643
|
-
|
4644
|
-
|
4645
|
-
|
4646
|
-
|
4647
|
-
attr_accessor :amendment_end
|
4648
|
-
# Details to identify the earliest timestamp where the proposed change should take effect.
|
4649
|
-
attr_accessor :amendment_start
|
4650
|
-
# 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.
|
4651
|
-
attr_accessor :billing_cycle_anchor
|
4652
|
-
# Changes to the coupons being redeemed or discounts being applied during the amendment time span.
|
4653
|
-
attr_accessor :discount_actions
|
4654
|
-
# Changes to the subscription items during the amendment time span.
|
4655
|
-
attr_accessor :item_actions
|
4656
|
-
# Instructions for how to modify phase metadata
|
4657
|
-
attr_accessor :metadata_actions
|
4658
|
-
# 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`.
|
4659
|
-
attr_accessor :proration_behavior
|
4660
|
-
# Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
|
4661
|
-
attr_accessor :set_pause_collection
|
4662
|
-
# Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
|
4663
|
-
attr_accessor :set_schedule_end
|
4664
|
-
# Settings related to subscription trials.
|
4665
|
-
attr_accessor :trial_settings
|
2095
|
+
class Issuer < Stripe::RequestParams
|
2096
|
+
# The connected account being referenced when `type` is `account`.
|
2097
|
+
attr_accessor :account
|
2098
|
+
# Type of the account referenced in the request.
|
2099
|
+
attr_accessor :type
|
4666
2100
|
|
4667
|
-
|
4668
|
-
|
4669
|
-
|
4670
|
-
billing_cycle_anchor: nil,
|
4671
|
-
discount_actions: nil,
|
4672
|
-
item_actions: nil,
|
4673
|
-
metadata_actions: nil,
|
4674
|
-
proration_behavior: nil,
|
4675
|
-
set_pause_collection: nil,
|
4676
|
-
set_schedule_end: nil,
|
4677
|
-
trial_settings: nil
|
4678
|
-
)
|
4679
|
-
@amendment_end = amendment_end
|
4680
|
-
@amendment_start = amendment_start
|
4681
|
-
@billing_cycle_anchor = billing_cycle_anchor
|
4682
|
-
@discount_actions = discount_actions
|
4683
|
-
@item_actions = item_actions
|
4684
|
-
@metadata_actions = metadata_actions
|
4685
|
-
@proration_behavior = proration_behavior
|
4686
|
-
@set_pause_collection = set_pause_collection
|
4687
|
-
@set_schedule_end = set_schedule_end
|
4688
|
-
@trial_settings = trial_settings
|
4689
|
-
end
|
2101
|
+
def initialize(account: nil, type: nil)
|
2102
|
+
@account = account
|
2103
|
+
@type = type
|
4690
2104
|
end
|
2105
|
+
end
|
4691
2106
|
|
2107
|
+
class ScheduleDetails < Stripe::RequestParams
|
4692
2108
|
class Phase < Stripe::RequestParams
|
4693
2109
|
class AddInvoiceItem < Stripe::RequestParams
|
4694
2110
|
class Discount < Stripe::RequestParams
|
4695
|
-
class DiscountEnd < Stripe::RequestParams
|
4696
|
-
class Duration < Stripe::RequestParams
|
4697
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
4698
|
-
attr_accessor :interval
|
4699
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
4700
|
-
attr_accessor :interval_count
|
4701
|
-
|
4702
|
-
def initialize(interval: nil, interval_count: nil)
|
4703
|
-
@interval = interval
|
4704
|
-
@interval_count = interval_count
|
4705
|
-
end
|
4706
|
-
end
|
4707
|
-
# Time span for the redeemed discount.
|
4708
|
-
attr_accessor :duration
|
4709
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
4710
|
-
attr_accessor :timestamp
|
4711
|
-
# The type of calculation made to determine when the discount ends.
|
4712
|
-
attr_accessor :type
|
4713
|
-
|
4714
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
4715
|
-
@duration = duration
|
4716
|
-
@timestamp = timestamp
|
4717
|
-
@type = type
|
4718
|
-
end
|
4719
|
-
end
|
4720
2111
|
# ID of the coupon to create a new discount for.
|
4721
2112
|
attr_accessor :coupon
|
4722
2113
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
4723
2114
|
attr_accessor :discount
|
4724
|
-
# Details to determine how long the discount should be applied for.
|
4725
|
-
attr_accessor :discount_end
|
4726
2115
|
# ID of the promotion code to create a new discount for.
|
4727
2116
|
attr_accessor :promotion_code
|
4728
2117
|
|
4729
|
-
def initialize(coupon: nil, discount: nil,
|
2118
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
4730
2119
|
@coupon = coupon
|
4731
2120
|
@discount = discount
|
4732
|
-
@discount_end = discount_end
|
4733
2121
|
@promotion_code = promotion_code
|
4734
2122
|
end
|
4735
2123
|
end
|
@@ -4737,7 +2125,7 @@ module Stripe
|
|
4737
2125
|
class PriceData < Stripe::RequestParams
|
4738
2126
|
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
4739
2127
|
attr_accessor :currency
|
4740
|
-
# The ID of the
|
2128
|
+
# The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
|
4741
2129
|
attr_accessor :product
|
4742
2130
|
# Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
|
4743
2131
|
attr_accessor :tax_behavior
|
@@ -4809,57 +2197,17 @@ module Stripe
|
|
4809
2197
|
end
|
4810
2198
|
end
|
4811
2199
|
|
4812
|
-
class BillingThresholds < Stripe::RequestParams
|
4813
|
-
# Monetary threshold that triggers the subscription to advance to a new billing period
|
4814
|
-
attr_accessor :amount_gte
|
4815
|
-
# Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
|
4816
|
-
attr_accessor :reset_billing_cycle_anchor
|
4817
|
-
|
4818
|
-
def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil)
|
4819
|
-
@amount_gte = amount_gte
|
4820
|
-
@reset_billing_cycle_anchor = reset_billing_cycle_anchor
|
4821
|
-
end
|
4822
|
-
end
|
4823
|
-
|
4824
2200
|
class Discount < Stripe::RequestParams
|
4825
|
-
class DiscountEnd < Stripe::RequestParams
|
4826
|
-
class Duration < Stripe::RequestParams
|
4827
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
4828
|
-
attr_accessor :interval
|
4829
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
4830
|
-
attr_accessor :interval_count
|
4831
|
-
|
4832
|
-
def initialize(interval: nil, interval_count: nil)
|
4833
|
-
@interval = interval
|
4834
|
-
@interval_count = interval_count
|
4835
|
-
end
|
4836
|
-
end
|
4837
|
-
# Time span for the redeemed discount.
|
4838
|
-
attr_accessor :duration
|
4839
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
4840
|
-
attr_accessor :timestamp
|
4841
|
-
# The type of calculation made to determine when the discount ends.
|
4842
|
-
attr_accessor :type
|
4843
|
-
|
4844
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
4845
|
-
@duration = duration
|
4846
|
-
@timestamp = timestamp
|
4847
|
-
@type = type
|
4848
|
-
end
|
4849
|
-
end
|
4850
2201
|
# ID of the coupon to create a new discount for.
|
4851
2202
|
attr_accessor :coupon
|
4852
2203
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
4853
2204
|
attr_accessor :discount
|
4854
|
-
# Details to determine how long the discount should be applied for.
|
4855
|
-
attr_accessor :discount_end
|
4856
2205
|
# ID of the promotion code to create a new discount for.
|
4857
2206
|
attr_accessor :promotion_code
|
4858
2207
|
|
4859
|
-
def initialize(coupon: nil, discount: nil,
|
2208
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
4860
2209
|
@coupon = coupon
|
4861
2210
|
@discount = discount
|
4862
|
-
@discount_end = discount_end
|
4863
2211
|
@promotion_code = promotion_code
|
4864
2212
|
end
|
4865
2213
|
end
|
@@ -4891,54 +2239,17 @@ module Stripe
|
|
4891
2239
|
end
|
4892
2240
|
|
4893
2241
|
class Item < Stripe::RequestParams
|
4894
|
-
class BillingThresholds < Stripe::RequestParams
|
4895
|
-
# Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
|
4896
|
-
attr_accessor :usage_gte
|
4897
|
-
|
4898
|
-
def initialize(usage_gte: nil)
|
4899
|
-
@usage_gte = usage_gte
|
4900
|
-
end
|
4901
|
-
end
|
4902
|
-
|
4903
2242
|
class Discount < Stripe::RequestParams
|
4904
|
-
class DiscountEnd < Stripe::RequestParams
|
4905
|
-
class Duration < Stripe::RequestParams
|
4906
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
4907
|
-
attr_accessor :interval
|
4908
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
4909
|
-
attr_accessor :interval_count
|
4910
|
-
|
4911
|
-
def initialize(interval: nil, interval_count: nil)
|
4912
|
-
@interval = interval
|
4913
|
-
@interval_count = interval_count
|
4914
|
-
end
|
4915
|
-
end
|
4916
|
-
# Time span for the redeemed discount.
|
4917
|
-
attr_accessor :duration
|
4918
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
4919
|
-
attr_accessor :timestamp
|
4920
|
-
# The type of calculation made to determine when the discount ends.
|
4921
|
-
attr_accessor :type
|
4922
|
-
|
4923
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
4924
|
-
@duration = duration
|
4925
|
-
@timestamp = timestamp
|
4926
|
-
@type = type
|
4927
|
-
end
|
4928
|
-
end
|
4929
2243
|
# ID of the coupon to create a new discount for.
|
4930
2244
|
attr_accessor :coupon
|
4931
2245
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
4932
2246
|
attr_accessor :discount
|
4933
|
-
# Details to determine how long the discount should be applied for.
|
4934
|
-
attr_accessor :discount_end
|
4935
2247
|
# ID of the promotion code to create a new discount for.
|
4936
2248
|
attr_accessor :promotion_code
|
4937
2249
|
|
4938
|
-
def initialize(coupon: nil, discount: nil,
|
2250
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
4939
2251
|
@coupon = coupon
|
4940
2252
|
@discount = discount
|
4941
|
-
@discount_end = discount_end
|
4942
2253
|
@promotion_code = promotion_code
|
4943
2254
|
end
|
4944
2255
|
end
|
@@ -4957,7 +2268,7 @@ module Stripe
|
|
4957
2268
|
end
|
4958
2269
|
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
4959
2270
|
attr_accessor :currency
|
4960
|
-
# The ID of the
|
2271
|
+
# The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
|
4961
2272
|
attr_accessor :product
|
4962
2273
|
# The recurring components of a price such as `interval` and `interval_count`.
|
4963
2274
|
attr_accessor :recurring
|
@@ -4984,20 +2295,6 @@ module Stripe
|
|
4984
2295
|
@unit_amount_decimal = unit_amount_decimal
|
4985
2296
|
end
|
4986
2297
|
end
|
4987
|
-
|
4988
|
-
class Trial < Stripe::RequestParams
|
4989
|
-
# 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.
|
4990
|
-
attr_accessor :converts_to
|
4991
|
-
# Determines the type of trial for this item.
|
4992
|
-
attr_accessor :type
|
4993
|
-
|
4994
|
-
def initialize(converts_to: nil, type: nil)
|
4995
|
-
@converts_to = converts_to
|
4996
|
-
@type = type
|
4997
|
-
end
|
4998
|
-
end
|
4999
|
-
# Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds.
|
5000
|
-
attr_accessor :billing_thresholds
|
5001
2298
|
# The coupons to redeem into discounts for the subscription item.
|
5002
2299
|
attr_accessor :discounts
|
5003
2300
|
# 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`.
|
@@ -5012,21 +2309,16 @@ module Stripe
|
|
5012
2309
|
attr_accessor :quantity
|
5013
2310
|
# 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.
|
5014
2311
|
attr_accessor :tax_rates
|
5015
|
-
# Options that configure the trial on the subscription item.
|
5016
|
-
attr_accessor :trial
|
5017
2312
|
|
5018
2313
|
def initialize(
|
5019
|
-
billing_thresholds: nil,
|
5020
2314
|
discounts: nil,
|
5021
2315
|
metadata: nil,
|
5022
2316
|
plan: nil,
|
5023
2317
|
price: nil,
|
5024
2318
|
price_data: nil,
|
5025
2319
|
quantity: nil,
|
5026
|
-
tax_rates: nil
|
5027
|
-
trial: nil
|
2320
|
+
tax_rates: nil
|
5028
2321
|
)
|
5029
|
-
@billing_thresholds = billing_thresholds
|
5030
2322
|
@discounts = discounts
|
5031
2323
|
@metadata = metadata
|
5032
2324
|
@plan = plan
|
@@ -5034,16 +2326,6 @@ module Stripe
|
|
5034
2326
|
@price_data = price_data
|
5035
2327
|
@quantity = quantity
|
5036
2328
|
@tax_rates = tax_rates
|
5037
|
-
@trial = trial
|
5038
|
-
end
|
5039
|
-
end
|
5040
|
-
|
5041
|
-
class PauseCollection < Stripe::RequestParams
|
5042
|
-
# The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
|
5043
|
-
attr_accessor :behavior
|
5044
|
-
|
5045
|
-
def initialize(behavior: nil)
|
5046
|
-
@behavior = behavior
|
5047
2329
|
end
|
5048
2330
|
end
|
5049
2331
|
|
@@ -5058,23 +2340,6 @@ module Stripe
|
|
5058
2340
|
@destination = destination
|
5059
2341
|
end
|
5060
2342
|
end
|
5061
|
-
|
5062
|
-
class TrialSettings < Stripe::RequestParams
|
5063
|
-
class EndBehavior < Stripe::RequestParams
|
5064
|
-
# Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
|
5065
|
-
attr_accessor :prorate_up_front
|
5066
|
-
|
5067
|
-
def initialize(prorate_up_front: nil)
|
5068
|
-
@prorate_up_front = prorate_up_front
|
5069
|
-
end
|
5070
|
-
end
|
5071
|
-
# Defines how the subscription should behave when a trial ends.
|
5072
|
-
attr_accessor :end_behavior
|
5073
|
-
|
5074
|
-
def initialize(end_behavior: nil)
|
5075
|
-
@end_behavior = end_behavior
|
5076
|
-
end
|
5077
|
-
end
|
5078
2343
|
# 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.
|
5079
2344
|
attr_accessor :add_invoice_items
|
5080
2345
|
# 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).
|
@@ -5083,12 +2348,8 @@ module Stripe
|
|
5083
2348
|
attr_accessor :automatic_tax
|
5084
2349
|
# Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
|
5085
2350
|
attr_accessor :billing_cycle_anchor
|
5086
|
-
# Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
|
5087
|
-
attr_accessor :billing_thresholds
|
5088
2351
|
# Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.
|
5089
2352
|
attr_accessor :collection_method
|
5090
|
-
# The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead.
|
5091
|
-
attr_accessor :coupon
|
5092
2353
|
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
5093
2354
|
attr_accessor :currency
|
5094
2355
|
# ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.
|
@@ -5111,8 +2372,6 @@ module Stripe
|
|
5111
2372
|
attr_accessor :metadata
|
5112
2373
|
# The account on behalf of which to charge, for each of the associated subscription's invoices.
|
5113
2374
|
attr_accessor :on_behalf_of
|
5114
|
-
# 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).
|
5115
|
-
attr_accessor :pause_collection
|
5116
2375
|
# 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.
|
5117
2376
|
attr_accessor :proration_behavior
|
5118
2377
|
# The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
|
@@ -5121,21 +2380,15 @@ module Stripe
|
|
5121
2380
|
attr_accessor :transfer_data
|
5122
2381
|
# If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
|
5123
2382
|
attr_accessor :trial
|
5124
|
-
# Specify trial behavior when crossing phase boundaries
|
5125
|
-
attr_accessor :trial_continuation
|
5126
2383
|
# 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`
|
5127
2384
|
attr_accessor :trial_end
|
5128
|
-
# Settings related to subscription trials.
|
5129
|
-
attr_accessor :trial_settings
|
5130
2385
|
|
5131
2386
|
def initialize(
|
5132
2387
|
add_invoice_items: nil,
|
5133
2388
|
application_fee_percent: nil,
|
5134
2389
|
automatic_tax: nil,
|
5135
2390
|
billing_cycle_anchor: nil,
|
5136
|
-
billing_thresholds: nil,
|
5137
2391
|
collection_method: nil,
|
5138
|
-
coupon: nil,
|
5139
2392
|
currency: nil,
|
5140
2393
|
default_payment_method: nil,
|
5141
2394
|
default_tax_rates: nil,
|
@@ -5147,22 +2400,17 @@ module Stripe
|
|
5147
2400
|
iterations: nil,
|
5148
2401
|
metadata: nil,
|
5149
2402
|
on_behalf_of: nil,
|
5150
|
-
pause_collection: nil,
|
5151
2403
|
proration_behavior: nil,
|
5152
2404
|
start_date: nil,
|
5153
2405
|
transfer_data: nil,
|
5154
2406
|
trial: nil,
|
5155
|
-
|
5156
|
-
trial_end: nil,
|
5157
|
-
trial_settings: nil
|
2407
|
+
trial_end: nil
|
5158
2408
|
)
|
5159
2409
|
@add_invoice_items = add_invoice_items
|
5160
2410
|
@application_fee_percent = application_fee_percent
|
5161
2411
|
@automatic_tax = automatic_tax
|
5162
2412
|
@billing_cycle_anchor = billing_cycle_anchor
|
5163
|
-
@billing_thresholds = billing_thresholds
|
5164
2413
|
@collection_method = collection_method
|
5165
|
-
@coupon = coupon
|
5166
2414
|
@currency = currency
|
5167
2415
|
@default_payment_method = default_payment_method
|
5168
2416
|
@default_tax_rates = default_tax_rates
|
@@ -5174,145 +2422,40 @@ module Stripe
|
|
5174
2422
|
@iterations = iterations
|
5175
2423
|
@metadata = metadata
|
5176
2424
|
@on_behalf_of = on_behalf_of
|
5177
|
-
@pause_collection = pause_collection
|
5178
2425
|
@proration_behavior = proration_behavior
|
5179
2426
|
@start_date = start_date
|
5180
2427
|
@transfer_data = transfer_data
|
5181
2428
|
@trial = trial
|
5182
|
-
@trial_continuation = trial_continuation
|
5183
2429
|
@trial_end = trial_end
|
5184
|
-
@trial_settings = trial_settings
|
5185
|
-
end
|
5186
|
-
end
|
5187
|
-
|
5188
|
-
class Prebilling < Stripe::RequestParams
|
5189
|
-
class BillUntil < Stripe::RequestParams
|
5190
|
-
class AmendmentEnd < Stripe::RequestParams
|
5191
|
-
# 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.
|
5192
|
-
attr_accessor :index
|
5193
|
-
|
5194
|
-
def initialize(index: nil)
|
5195
|
-
@index = index
|
5196
|
-
end
|
5197
|
-
end
|
5198
|
-
|
5199
|
-
class Duration < Stripe::RequestParams
|
5200
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
5201
|
-
attr_accessor :interval
|
5202
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
5203
|
-
attr_accessor :interval_count
|
5204
|
-
|
5205
|
-
def initialize(interval: nil, interval_count: nil)
|
5206
|
-
@interval = interval
|
5207
|
-
@interval_count = interval_count
|
5208
|
-
end
|
5209
|
-
end
|
5210
|
-
# End the prebilled period when a specified amendment ends.
|
5211
|
-
attr_accessor :amendment_end
|
5212
|
-
# Time span for prebilling, starting from `bill_from`.
|
5213
|
-
attr_accessor :duration
|
5214
|
-
# End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
|
5215
|
-
attr_accessor :timestamp
|
5216
|
-
# Select one of several ways to pass the `bill_until` value.
|
5217
|
-
attr_accessor :type
|
5218
|
-
|
5219
|
-
def initialize(amendment_end: nil, duration: nil, timestamp: nil, type: nil)
|
5220
|
-
@amendment_end = amendment_end
|
5221
|
-
@duration = duration
|
5222
|
-
@timestamp = timestamp
|
5223
|
-
@type = type
|
5224
|
-
end
|
5225
|
-
end
|
5226
|
-
# The end of the prebilled time period.
|
5227
|
-
attr_accessor :bill_until
|
5228
|
-
# This is used to determine the number of billing cycles to prebill.
|
5229
|
-
attr_accessor :iterations
|
5230
|
-
|
5231
|
-
def initialize(bill_until: nil, iterations: nil)
|
5232
|
-
@bill_until = bill_until
|
5233
|
-
@iterations = iterations
|
5234
2430
|
end
|
5235
2431
|
end
|
5236
|
-
# Changes to apply to the phases of the subscription schedule, in the order provided.
|
5237
|
-
attr_accessor :amendments
|
5238
|
-
# 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.
|
5239
|
-
attr_accessor :billing_behavior
|
5240
2432
|
# 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.
|
5241
2433
|
attr_accessor :end_behavior
|
5242
2434
|
# 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.
|
5243
2435
|
attr_accessor :phases
|
5244
|
-
# Provide any time periods to bill in advance.
|
5245
|
-
attr_accessor :prebilling
|
5246
2436
|
# In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.
|
5247
2437
|
attr_accessor :proration_behavior
|
5248
2438
|
|
5249
|
-
def initialize(
|
5250
|
-
amendments: nil,
|
5251
|
-
billing_behavior: nil,
|
5252
|
-
end_behavior: nil,
|
5253
|
-
phases: nil,
|
5254
|
-
prebilling: nil,
|
5255
|
-
proration_behavior: nil
|
5256
|
-
)
|
5257
|
-
@amendments = amendments
|
5258
|
-
@billing_behavior = billing_behavior
|
2439
|
+
def initialize(end_behavior: nil, phases: nil, proration_behavior: nil)
|
5259
2440
|
@end_behavior = end_behavior
|
5260
2441
|
@phases = phases
|
5261
|
-
@prebilling = prebilling
|
5262
2442
|
@proration_behavior = proration_behavior
|
5263
2443
|
end
|
5264
2444
|
end
|
5265
2445
|
|
5266
2446
|
class SubscriptionDetails < Stripe::RequestParams
|
5267
2447
|
class Item < Stripe::RequestParams
|
5268
|
-
class BillingThresholds < Stripe::RequestParams
|
5269
|
-
# Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
|
5270
|
-
attr_accessor :usage_gte
|
5271
|
-
|
5272
|
-
def initialize(usage_gte: nil)
|
5273
|
-
@usage_gte = usage_gte
|
5274
|
-
end
|
5275
|
-
end
|
5276
|
-
|
5277
2448
|
class Discount < Stripe::RequestParams
|
5278
|
-
class DiscountEnd < Stripe::RequestParams
|
5279
|
-
class Duration < Stripe::RequestParams
|
5280
|
-
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
5281
|
-
attr_accessor :interval
|
5282
|
-
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
5283
|
-
attr_accessor :interval_count
|
5284
|
-
|
5285
|
-
def initialize(interval: nil, interval_count: nil)
|
5286
|
-
@interval = interval
|
5287
|
-
@interval_count = interval_count
|
5288
|
-
end
|
5289
|
-
end
|
5290
|
-
# Time span for the redeemed discount.
|
5291
|
-
attr_accessor :duration
|
5292
|
-
# A precise Unix timestamp for the discount to end. Must be in the future.
|
5293
|
-
attr_accessor :timestamp
|
5294
|
-
# The type of calculation made to determine when the discount ends.
|
5295
|
-
attr_accessor :type
|
5296
|
-
|
5297
|
-
def initialize(duration: nil, timestamp: nil, type: nil)
|
5298
|
-
@duration = duration
|
5299
|
-
@timestamp = timestamp
|
5300
|
-
@type = type
|
5301
|
-
end
|
5302
|
-
end
|
5303
2449
|
# ID of the coupon to create a new discount for.
|
5304
2450
|
attr_accessor :coupon
|
5305
2451
|
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
5306
2452
|
attr_accessor :discount
|
5307
|
-
# Details to determine how long the discount should be applied for.
|
5308
|
-
attr_accessor :discount_end
|
5309
2453
|
# ID of the promotion code to create a new discount for.
|
5310
2454
|
attr_accessor :promotion_code
|
5311
2455
|
|
5312
|
-
def initialize(coupon: nil, discount: nil,
|
2456
|
+
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
5313
2457
|
@coupon = coupon
|
5314
2458
|
@discount = discount
|
5315
|
-
@discount_end = discount_end
|
5316
2459
|
@promotion_code = promotion_code
|
5317
2460
|
end
|
5318
2461
|
end
|
@@ -5331,7 +2474,7 @@ module Stripe
|
|
5331
2474
|
end
|
5332
2475
|
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
5333
2476
|
attr_accessor :currency
|
5334
|
-
# The ID of the
|
2477
|
+
# The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
|
5335
2478
|
attr_accessor :product
|
5336
2479
|
# The recurring components of a price such as `interval` and `interval_count`.
|
5337
2480
|
attr_accessor :recurring
|
@@ -5358,8 +2501,6 @@ module Stripe
|
|
5358
2501
|
@unit_amount_decimal = unit_amount_decimal
|
5359
2502
|
end
|
5360
2503
|
end
|
5361
|
-
# Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds.
|
5362
|
-
attr_accessor :billing_thresholds
|
5363
2504
|
# Delete all usage for a given subscription item. You must pass this when deleting a usage records subscription item. `clear_usage` has no effect if the plan has a billing meter attached.
|
5364
2505
|
attr_accessor :clear_usage
|
5365
2506
|
# A flag that, if set to `true`, will delete the specified item.
|
@@ -5382,7 +2523,6 @@ module Stripe
|
|
5382
2523
|
attr_accessor :tax_rates
|
5383
2524
|
|
5384
2525
|
def initialize(
|
5385
|
-
billing_thresholds: nil,
|
5386
2526
|
clear_usage: nil,
|
5387
2527
|
deleted: nil,
|
5388
2528
|
discounts: nil,
|
@@ -5394,7 +2534,6 @@ module Stripe
|
|
5394
2534
|
quantity: nil,
|
5395
2535
|
tax_rates: nil
|
5396
2536
|
)
|
5397
|
-
@billing_thresholds = billing_thresholds
|
5398
2537
|
@clear_usage = clear_usage
|
5399
2538
|
@deleted = deleted
|
5400
2539
|
@discounts = discounts
|
@@ -5407,15 +2546,6 @@ module Stripe
|
|
5407
2546
|
@tax_rates = tax_rates
|
5408
2547
|
end
|
5409
2548
|
end
|
5410
|
-
|
5411
|
-
class Prebilling < Stripe::RequestParams
|
5412
|
-
# This is used to determine the number of billing cycles to prebill.
|
5413
|
-
attr_accessor :iterations
|
5414
|
-
|
5415
|
-
def initialize(iterations: nil)
|
5416
|
-
@iterations = iterations
|
5417
|
-
end
|
5418
|
-
end
|
5419
2549
|
# 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`.
|
5420
2550
|
attr_accessor :billing_cycle_anchor
|
5421
2551
|
# 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.
|
@@ -5428,8 +2558,6 @@ module Stripe
|
|
5428
2558
|
attr_accessor :default_tax_rates
|
5429
2559
|
# A list of up to 20 subscription items, each with an attached price.
|
5430
2560
|
attr_accessor :items
|
5431
|
-
# The pre-billing to apply to the subscription as a preview.
|
5432
|
-
attr_accessor :prebilling
|
5433
2561
|
# 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`.
|
5434
2562
|
attr_accessor :proration_behavior
|
5435
2563
|
# 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'.
|
@@ -5448,7 +2576,6 @@ module Stripe
|
|
5448
2576
|
cancel_now: nil,
|
5449
2577
|
default_tax_rates: nil,
|
5450
2578
|
items: nil,
|
5451
|
-
prebilling: nil,
|
5452
2579
|
proration_behavior: nil,
|
5453
2580
|
proration_date: nil,
|
5454
2581
|
resume_at: nil,
|
@@ -5461,7 +2588,6 @@ module Stripe
|
|
5461
2588
|
@cancel_now = cancel_now
|
5462
2589
|
@default_tax_rates = default_tax_rates
|
5463
2590
|
@items = items
|
5464
|
-
@prebilling = prebilling
|
5465
2591
|
@proration_behavior = proration_behavior
|
5466
2592
|
@proration_date = proration_date
|
5467
2593
|
@resume_at = resume_at
|
@@ -5471,8 +2597,6 @@ module Stripe
|
|
5471
2597
|
end
|
5472
2598
|
# Settings for automatic tax lookup for this invoice preview.
|
5473
2599
|
attr_accessor :automatic_tax
|
5474
|
-
# The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead.
|
5475
|
-
attr_accessor :coupon
|
5476
2600
|
# The currency to preview this invoice in. Defaults to that of `customer` if not specified.
|
5477
2601
|
attr_accessor :currency
|
5478
2602
|
# 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.
|
@@ -5502,7 +2626,6 @@ module Stripe
|
|
5502
2626
|
|
5503
2627
|
def initialize(
|
5504
2628
|
automatic_tax: nil,
|
5505
|
-
coupon: nil,
|
5506
2629
|
currency: nil,
|
5507
2630
|
customer: nil,
|
5508
2631
|
customer_details: nil,
|
@@ -5518,7 +2641,6 @@ module Stripe
|
|
5518
2641
|
subscription_details: nil
|
5519
2642
|
)
|
5520
2643
|
@automatic_tax = automatic_tax
|
5521
|
-
@coupon = coupon
|
5522
2644
|
@currency = currency
|
5523
2645
|
@customer = customer
|
5524
2646
|
@customer_details = customer_details
|
@@ -5546,48 +2668,6 @@ module Stripe
|
|
5546
2668
|
)
|
5547
2669
|
end
|
5548
2670
|
|
5549
|
-
# Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of payments.
|
5550
|
-
#
|
5551
|
-
# For Out of Band Payment, the payment is credited to the invoice immediately, increasing the amount_paid
|
5552
|
-
# of the invoice and subsequently transitioning the status of the invoice to paid if necessary.
|
5553
|
-
#
|
5554
|
-
# For the PaymentIntent, when the PaymentIntent's status changes to succeeded, the payment is credited
|
5555
|
-
# to the invoice, increasing its amount_paid. When the invoice is fully paid, the
|
5556
|
-
# invoice's status becomes paid.
|
5557
|
-
#
|
5558
|
-
# If the PaymentIntent's status is already succeeded when it's attached, it's
|
5559
|
-
# credited to the invoice immediately.
|
5560
|
-
#
|
5561
|
-
# See: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create) to learn more.
|
5562
|
-
def attach_payment(invoice, params = {}, opts = {})
|
5563
|
-
request(
|
5564
|
-
method: :post,
|
5565
|
-
path: format("/v1/invoices/%<invoice>s/attach_payment", { invoice: CGI.escape(invoice) }),
|
5566
|
-
params: params,
|
5567
|
-
opts: opts,
|
5568
|
-
base_address: :api
|
5569
|
-
)
|
5570
|
-
end
|
5571
|
-
|
5572
|
-
# Attaches a PaymentIntent to the invoice, adding it to the list of payments.
|
5573
|
-
# When the PaymentIntent's status changes to succeeded, the payment is credited
|
5574
|
-
# to the invoice, increasing its amount_paid. When the invoice is fully paid, the
|
5575
|
-
# invoice's status becomes paid.
|
5576
|
-
#
|
5577
|
-
# If the PaymentIntent's status is already succeeded when it is attached, it is
|
5578
|
-
# credited to the invoice immediately.
|
5579
|
-
#
|
5580
|
-
# Related guide: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create)
|
5581
|
-
def attach_payment_intent(invoice, params = {}, opts = {})
|
5582
|
-
request(
|
5583
|
-
method: :post,
|
5584
|
-
path: format("/v1/invoices/%<invoice>s/attach_payment_intent", { invoice: CGI.escape(invoice) }),
|
5585
|
-
params: params,
|
5586
|
-
opts: opts,
|
5587
|
-
base_address: :api
|
5588
|
-
)
|
5589
|
-
end
|
5590
|
-
|
5591
2671
|
# 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.
|
5592
2672
|
def create(params = {}, opts = {})
|
5593
2673
|
request(method: :post, path: "/v1/invoices", params: params, opts: opts, base_address: :api)
|
@@ -5708,23 +2788,6 @@ module Stripe
|
|
5708
2788
|
)
|
5709
2789
|
end
|
5710
2790
|
|
5711
|
-
# At any time, you can preview the upcoming invoice for a customer. 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.
|
5712
|
-
#
|
5713
|
-
# 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.
|
5714
|
-
#
|
5715
|
-
# You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.
|
5716
|
-
#
|
5717
|
-
# Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions)
|
5718
|
-
def upcoming(params = {}, opts = {})
|
5719
|
-
request(
|
5720
|
-
method: :get,
|
5721
|
-
path: "/v1/invoices/upcoming",
|
5722
|
-
params: params,
|
5723
|
-
opts: opts,
|
5724
|
-
base_address: :api
|
5725
|
-
)
|
5726
|
-
end
|
5727
|
-
|
5728
2791
|
# Draft invoices are fully editable. Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized),
|
5729
2792
|
# monetary values, as well as collection_method, become uneditable.
|
5730
2793
|
#
|