Class: Stripe::QuoteCreateParams::SubscriptionData

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/params/quote_create_params.rb

Defined Under Namespace

Classes: BillOnAcceptance, BillingMode, BillingSchedule, Prebilling

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(bill_on_acceptance: nil, billing_behavior: nil, billing_cycle_anchor: nil, billing_mode: nil, billing_schedules: nil, description: nil, effective_date: nil, end_behavior: nil, from_subscription: nil, metadata: nil, phase_effective_at: nil, prebilling: nil, proration_behavior: nil, trial_period_days: nil) ⇒ SubscriptionData

Returns a new instance of SubscriptionData.



926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
# File 'lib/stripe/params/quote_create_params.rb', line 926

def initialize(
  bill_on_acceptance: nil,
  billing_behavior: nil,
  billing_cycle_anchor: nil,
  billing_mode: nil,
  billing_schedules: nil,
  description: nil,
  effective_date: nil,
  end_behavior: nil,
  from_subscription: nil,
  metadata: nil,
  phase_effective_at: nil,
  prebilling: nil,
  proration_behavior: nil,
  trial_period_days: nil
)
  @bill_on_acceptance = bill_on_acceptance
  @billing_behavior = billing_behavior
  @billing_cycle_anchor = billing_cycle_anchor
  @billing_mode = billing_mode
  @billing_schedules = billing_schedules
  @description = description
  @effective_date = effective_date
  @end_behavior = end_behavior
  @from_subscription = from_subscription
  @metadata = 
  @phase_effective_at = phase_effective_at
  @prebilling = prebilling
  @proration_behavior = proration_behavior
  @trial_period_days = trial_period_days
end

Instance Attribute Details

#bill_on_acceptanceObject

Describes the period to bill for upon accepting the quote.



892
893
894
# File 'lib/stripe/params/quote_create_params.rb', line 892

def bill_on_acceptance
  @bill_on_acceptance
end

#billing_behaviorObject

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.



894
895
896
# File 'lib/stripe/params/quote_create_params.rb', line 894

def billing_behavior
  @billing_behavior
end

#billing_cycle_anchorObject

When specified as ‘reset`, the subscription will always start a new billing period when the quote is accepted.



896
897
898
# File 'lib/stripe/params/quote_create_params.rb', line 896

def billing_cycle_anchor
  @billing_cycle_anchor
end

#billing_modeObject

Controls how prorations and invoices for subscriptions are calculated and orchestrated.



898
899
900
# File 'lib/stripe/params/quote_create_params.rb', line 898

def billing_mode
  @billing_mode
end

#billing_schedulesObject

Billing schedules that will be applied to the subscription or subscription schedule created when the quote is accepted.



900
901
902
# File 'lib/stripe/params/quote_create_params.rb', line 900

def billing_schedules
  @billing_schedules
end

#descriptionObject

The subscription’s description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.



902
903
904
# File 'lib/stripe/params/quote_create_params.rb', line 902

def description
  @description
end

#effective_dateObject

When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value ‘current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted.



904
905
906
# File 'lib/stripe/params/quote_create_params.rb', line 904

def effective_date
  @effective_date
end

#end_behaviorObject

Behavior of the subscription schedule and underlying subscription when it ends.



906
907
908
# File 'lib/stripe/params/quote_create_params.rb', line 906

def end_behavior
  @end_behavior
end

#from_subscriptionObject

The id of a subscription that the quote will update. By default, the quote will contain the state of the subscription (such as line items, collection method and billing thresholds) unless overridden.



908
909
910
# File 'lib/stripe/params/quote_create_params.rb', line 908

def from_subscription
  @from_subscription
end

#metadataObject

Set of [key-value pairs](stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in ‘line_items`, this field will be passed to the resulting subscription’s ‘metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule’s ‘phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.



910
911
912
# File 'lib/stripe/params/quote_create_params.rb', line 910

def 
  @metadata
end

#phase_effective_atObject

Configures how the subscription schedule handles billing for phase transitions when the quote is accepted. Possible values are ‘phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice.



912
913
914
# File 'lib/stripe/params/quote_create_params.rb', line 912

def phase_effective_at
  @phase_effective_at
end

#prebillingObject

If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with ‘effective_date`.



914
915
916
# File 'lib/stripe/params/quote_create_params.rb', line 914

def prebilling
  @prebilling
end

#proration_behaviorObject

Determines how to handle [prorations](stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are ‘create_prorations` or `none`.

When updating a subscription, valid values are ‘create_prorations`, `none`, or `always_invoice`.

Passing ‘create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.

Prorations can be disabled by passing ‘none`.



922
923
924
# File 'lib/stripe/params/quote_create_params.rb', line 922

def proration_behavior
  @proration_behavior
end

#trial_period_daysObject

Integer representing the number of trial period days before the customer is charged for the first time.



924
925
926
# File 'lib/stripe/params/quote_create_params.rb', line 924

def trial_period_days
  @trial_period_days
end