class Stripe::Subscription
- Stripe::Subscription
- Reference
- Object
Overview
Subscriptions allow you to charge a customer on a recurring basis. Related guide: Creating subscriptions
Included Modules
- JSON::Serializable
- JSON::Serializable::Unmapped
- OpenApi::Json
- OpenApi::Validatable
Defined in:
stripe/models/subscription.crConstant Summary
-
ERROR_MESSAGE_FOR_COLLECTION_METHOD =
"invalid value for \"collection_method\", must be one of [charge_automatically, send_invoice]."
-
ERROR_MESSAGE_FOR_OBJECT =
"invalid value for \"object\", must be one of [subscription]."
-
ERROR_MESSAGE_FOR_STATUS =
"invalid value for \"status\", must be one of [active, canceled, incomplete, incomplete_expired, past_due, paused, trialing, unpaid]."
-
MAX_LENGTH_FOR_DESCRIPTION =
500
-
MAX_LENGTH_FOR_ID =
5000
-
VALID_VALUES_FOR_COLLECTION_METHOD =
String.static_array("charge_automatically", "send_invoice")
-
VALID_VALUES_FOR_OBJECT =
String.static_array("subscription")
-
VALID_VALUES_FOR_STATUS =
String.static_array("active", "canceled", "incomplete", "incomplete_expired", "past_due", "paused", "trialing", "unpaid")
Constructors
- .new(pull : JSON::PullParser)
-
.new(*, application : Stripe::SubscriptionApplication | Nil = nil, application_fee_percent : Float64 | Nil = nil, automatic_tax : Stripe::SubscriptionAutomaticTax | Nil = nil, billing_cycle_anchor : Int64 | Nil = nil, billing_cycle_anchor_config : Stripe::SubscriptionBillingCycleAnchorConfig | Nil = nil, billing_thresholds : Stripe::SubscriptionBillingThresholds1 | Nil = nil, cancel_at : Int64 | Nil = nil, cancel_at_period_end : Bool | Nil = nil, canceled_at : Int64 | Nil = nil, cancellation_details : Stripe::SubscriptionCancellationDetails | Nil = nil, collection_method : String | Nil = nil, created : Int64 | Nil = nil, currency : String | Nil = nil, current_period_end : Int64 | Nil = nil, current_period_start : Int64 | Nil = nil, customer : Stripe::SubscriptionCustomer | Nil = nil, days_until_due : Int64 | Nil = nil, default_payment_method : Stripe::SubscriptionDefaultPaymentMethod | Nil = nil, default_source : Stripe::SubscriptionDefaultSource | Nil = nil, description : String | Nil = nil, discount : Stripe::SubscriptionDiscount | Nil = nil, discounts : Array(Stripe::InvoiceitemDiscountsInner) | Nil = nil, ended_at : Int64 | Nil = nil, id : String | Nil = nil, invoice_settings : Stripe::SubscriptionsResourceSubscriptionInvoiceSettings | Nil = nil, items : Stripe::SubscriptionItemList | Nil = nil, latest_invoice : Stripe::SubscriptionLatestInvoice | Nil = nil, livemode : Bool | Nil = nil, metadata : Hash(String, String) | Nil = nil, next_pending_invoice_item_invoice : Int64 | Nil = nil, object : String | Nil = nil, on_behalf_of : Stripe::SubscriptionOnBehalfOf | Nil = nil, pause_collection : Stripe::SubscriptionPauseCollection | Nil = nil, payment_settings : Stripe::SubscriptionPaymentSettings | Nil = nil, pending_invoice_item_interval : Stripe::SubscriptionPendingInvoiceItemInterval1 | Nil = nil, pending_setup_intent : Stripe::SubscriptionPendingSetupIntent | Nil = nil, pending_update : Stripe::SubscriptionPendingUpdate | Nil = nil, schedule : Stripe::SubscriptionSchedule1 | Nil = nil, start_date : Int64 | Nil = nil, status : String | Nil = nil, test_clock : Stripe::SubscriptionTestClock | Nil = nil, transfer_data : Stripe::SubscriptionTransferData1 | Nil = nil, trial_end : Int64 | Nil = nil, trial_settings : Stripe::PaymentLinksResourceSubscriptionDataTrialSettings | Nil = nil, trial_start : Int64 | Nil = nil, default_tax_rates : Array(Stripe::TaxRate) | Nil = nil)
Initializes the object @param [Hash] attributes Model attributes in the form of hash
Instance Method Summary
-
#==(other : self)
Generates #hash and #== methods from all fields #== @return [Bool] #hash calculates hash code according to all attributes.
- #application : Stripe::SubscriptionApplication | Nil
-
#application=(new_value : Stripe::SubscriptionApplication | Nil)
Custom attribute writer method checking allowed values (enum).
- #application_fee_percent : Float64 | Nil
-
#application_fee_percent=(new_value : Float64 | Nil)
Custom attribute writer method checking allowed values (enum).
- #automatic_tax : Stripe::SubscriptionAutomaticTax | Nil
-
#automatic_tax=(new_value : Stripe::SubscriptionAutomaticTax | Nil)
Custom attribute writer method checking allowed values (enum).
- #billing_cycle_anchor : Int64 | Nil
-
#billing_cycle_anchor=(new_value : Int64 | Nil)
Custom attribute writer method checking allowed values (enum).
- #billing_cycle_anchor_config : Stripe::SubscriptionBillingCycleAnchorConfig | Nil
-
#billing_cycle_anchor_config=(new_value : Stripe::SubscriptionBillingCycleAnchorConfig | Nil)
Custom attribute writer method checking allowed values (enum).
- #billing_thresholds : Stripe::SubscriptionBillingThresholds1 | Nil
-
#billing_thresholds=(new_value : Stripe::SubscriptionBillingThresholds1 | Nil)
Custom attribute writer method checking allowed values (enum).
- #cancel_at : Int64 | Nil
-
#cancel_at=(new_value : Int64 | Nil)
Custom attribute writer method checking allowed values (enum).
- #cancel_at_period_end : Bool | Nil
-
#cancel_at_period_end=(new_value : Bool | Nil)
Custom attribute writer method checking allowed values (enum).
- #canceled_at : Int64 | Nil
-
#canceled_at=(new_value : Int64 | Nil)
Custom attribute writer method checking allowed values (enum).
- #cancellation_details : Stripe::SubscriptionCancellationDetails | Nil
-
#cancellation_details=(new_value : Stripe::SubscriptionCancellationDetails | Nil)
Custom attribute writer method checking allowed values (enum).
- #collection_method : String | Nil
-
#collection_method=(new_value : String | Nil)
Custom attribute writer method checking allowed values (enum).
- #created : Int64 | Nil
-
#created=(new_value : Int64 | Nil)
Custom attribute writer method checking allowed values (enum).
- #currency : String | Nil
-
#currency=(new_value : String | Nil)
Custom attribute writer method checking allowed values (enum).
- #current_period_end : Int64 | Nil
-
#current_period_end=(new_value : Int64 | Nil)
Custom attribute writer method checking allowed values (enum).
- #current_period_start : Int64 | Nil
-
#current_period_start=(new_value : Int64 | Nil)
Custom attribute writer method checking allowed values (enum).
- #customer : Stripe::SubscriptionCustomer | Nil
-
#customer=(new_value : Stripe::SubscriptionCustomer | Nil)
Custom attribute writer method checking allowed values (enum).
- #days_until_due : Int64 | Nil
-
#days_until_due=(new_value : Int64 | Nil)
Custom attribute writer method checking allowed values (enum).
- #default_payment_method : Stripe::SubscriptionDefaultPaymentMethod | Nil
-
#default_payment_method=(new_value : Stripe::SubscriptionDefaultPaymentMethod | Nil)
Custom attribute writer method checking allowed values (enum).
- #default_source : Stripe::SubscriptionDefaultSource | Nil
-
#default_source=(new_value : Stripe::SubscriptionDefaultSource | Nil)
Custom attribute writer method checking allowed values (enum).
- #default_tax_rates : Array(Stripe::TaxRate) | Nil
-
#default_tax_rates=(new_value : Array(Stripe::TaxRate) | Nil)
Custom attribute writer method checking allowed values (enum).
- #default_tax_rates_present=(default_tax_rates_present : Bool)
- #default_tax_rates_present? : Bool
- #description : String | Nil
-
#description=(new_value : String | Nil)
Custom attribute writer method checking allowed values (enum).
- #discount : Stripe::SubscriptionDiscount | Nil
-
#discount=(new_value : Stripe::SubscriptionDiscount | Nil)
Custom attribute writer method checking allowed values (enum).
- #discounts : Array(Stripe::InvoiceitemDiscountsInner) | Nil
-
#discounts=(new_value : Array(Stripe::InvoiceitemDiscountsInner) | Nil)
Custom attribute writer method checking allowed values (enum).
- #ended_at : Int64 | Nil
-
#ended_at=(new_value : Int64 | Nil)
Custom attribute writer method checking allowed values (enum).
-
#hash(hasher)
Generates #hash and #== methods from all fields #== @return [Bool] #hash calculates hash code according to all attributes.
- #id : String | Nil
-
#id=(new_value : String | Nil)
Custom attribute writer method checking allowed values (enum).
- #invoice_settings : Stripe::SubscriptionsResourceSubscriptionInvoiceSettings | Nil
-
#invoice_settings=(new_value : Stripe::SubscriptionsResourceSubscriptionInvoiceSettings | Nil)
Custom attribute writer method checking allowed values (enum).
- #items : Stripe::SubscriptionItemList | Nil
-
#items=(new_value : Stripe::SubscriptionItemList | Nil)
Custom attribute writer method checking allowed values (enum).
- #latest_invoice : Stripe::SubscriptionLatestInvoice | Nil
-
#latest_invoice=(new_value : Stripe::SubscriptionLatestInvoice | Nil)
Custom attribute writer method checking allowed values (enum).
-
#list_invalid_properties : Array(String)
Show invalid properties with the reasons.
- #livemode : Bool | Nil
-
#livemode=(new_value : Bool | Nil)
Custom attribute writer method checking allowed values (enum).
- #metadata : Hash(String, String) | Nil
-
#metadata=(new_value : Hash(String, String) | Nil)
Custom attribute writer method checking allowed values (enum).
- #next_pending_invoice_item_invoice : Int64 | Nil
-
#next_pending_invoice_item_invoice=(new_value : Int64 | Nil)
Custom attribute writer method checking allowed values (enum).
- #object : String | Nil
-
#object=(new_value : String | Nil)
Custom attribute writer method checking allowed values (enum).
- #on_behalf_of : Stripe::SubscriptionOnBehalfOf | Nil
-
#on_behalf_of=(new_value : Stripe::SubscriptionOnBehalfOf | Nil)
Custom attribute writer method checking allowed values (enum).
- #pause_collection : Stripe::SubscriptionPauseCollection | Nil
-
#pause_collection=(new_value : Stripe::SubscriptionPauseCollection | Nil)
Custom attribute writer method checking allowed values (enum).
- #payment_settings : Stripe::SubscriptionPaymentSettings | Nil
-
#payment_settings=(new_value : Stripe::SubscriptionPaymentSettings | Nil)
Custom attribute writer method checking allowed values (enum).
- #pending_invoice_item_interval : Stripe::SubscriptionPendingInvoiceItemInterval1 | Nil
-
#pending_invoice_item_interval=(new_value : Stripe::SubscriptionPendingInvoiceItemInterval1 | Nil)
Custom attribute writer method checking allowed values (enum).
- #pending_setup_intent : Stripe::SubscriptionPendingSetupIntent | Nil
-
#pending_setup_intent=(new_value : Stripe::SubscriptionPendingSetupIntent | Nil)
Custom attribute writer method checking allowed values (enum).
- #pending_update : Stripe::SubscriptionPendingUpdate | Nil
-
#pending_update=(new_value : Stripe::SubscriptionPendingUpdate | Nil)
Custom attribute writer method checking allowed values (enum).
- #schedule : Stripe::SubscriptionSchedule1 | Nil
-
#schedule=(new_value : Stripe::SubscriptionSchedule1 | Nil)
Custom attribute writer method checking allowed values (enum).
- #start_date : Int64 | Nil
-
#start_date=(new_value : Int64 | Nil)
Custom attribute writer method checking allowed values (enum).
- #status : String | Nil
-
#status=(new_value : String | Nil)
Custom attribute writer method checking allowed values (enum).
- #test_clock : Stripe::SubscriptionTestClock | Nil
-
#test_clock=(new_value : Stripe::SubscriptionTestClock | Nil)
Custom attribute writer method checking allowed values (enum).
- #transfer_data : Stripe::SubscriptionTransferData1 | Nil
-
#transfer_data=(new_value : Stripe::SubscriptionTransferData1 | Nil)
Custom attribute writer method checking allowed values (enum).
- #trial_end : Int64 | Nil
-
#trial_end=(new_value : Int64 | Nil)
Custom attribute writer method checking allowed values (enum).
- #trial_settings : Stripe::PaymentLinksResourceSubscriptionDataTrialSettings | Nil
-
#trial_settings=(new_value : Stripe::PaymentLinksResourceSubscriptionDataTrialSettings | Nil)
Custom attribute writer method checking allowed values (enum).
- #trial_start : Int64 | Nil
-
#trial_start=(new_value : Int64 | Nil)
Custom attribute writer method checking allowed values (enum).
-
#valid? : Bool
Check to see if the all the properties in the model are valid @return true if the model is valid
Instance methods inherited from module OpenApi::Json
after_initialize
after_initialize,
clone
clone,
eql?(o : self)
eql?,
to_hash : Hash(String, JSON::Any)
to_hash,
to_json_any : JSON::Any
to_json_any
Class methods inherited from module OpenApi::Json
build_from_hash(hash : Hash)
build_from_hash,
build_from_json_any(json_any : JSON::Any)
build_from_json_any
Instance methods inherited from module OpenApi::Validatable
list_invalid_properties : Array(String)
list_invalid_properties,
list_invalid_properties_for(key : String) : Array(String)
list_invalid_properties_for,
valid? : Bool
valid?,
validate : Nil
validate
Constructor Detail
Initializes the object @param [Hash] attributes Model attributes in the form of hash
Instance Method Detail
Generates #hash and #== methods from all fields #== @return [Bool] #hash calculates hash code according to all attributes. #hash @return [UInt64] Hash code
Custom attribute writer method checking allowed values (enum). @param [Object] application Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] application_fee_percent Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] automatic_tax Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] billing_cycle_anchor Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] billing_cycle_anchor_config Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] billing_thresholds Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] cancel_at Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] cancel_at_period_end Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] canceled_at Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] cancellation_details Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] collection_method Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] created Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] currency Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] current_period_end Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] current_period_start Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] customer Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] days_until_due Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] default_payment_method Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] default_source Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] default_tax_rates Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] description Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] discount Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] discounts Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] ended_at Object to be assigned
Generates #hash and #== methods from all fields #== @return [Bool] #hash calculates hash code according to all attributes. #hash @return [UInt64] Hash code
Custom attribute writer method checking allowed values (enum). @param [Object] id Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] invoice_settings Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] items Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] latest_invoice Object to be assigned
Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons
Custom attribute writer method checking allowed values (enum). @param [Object] livemode Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] metadata Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] next_pending_invoice_item_invoice Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] object Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] on_behalf_of Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] pause_collection Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] payment_settings Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] pending_invoice_item_interval Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] pending_setup_intent Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] pending_update Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] schedule Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] start_date Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] status Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] test_clock Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] transfer_data Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] trial_end Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] trial_settings Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] trial_start Object to be assigned
Check to see if the all the properties in the model are valid @return true if the model is valid