Class: Stripe::InvoiceCreatePreviewParams::ScheduleDetails

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

Defined Under Namespace

Classes: Amendment, BillingMode, BillingSchedule, DefaultSettings, Phase, Prebilling

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

attr_accessor, coerce_params, coerce_value, new, #to_h

Constructor Details

#initialize(amendments: nil, billing_behavior: nil, billing_mode: nil, billing_schedules: nil, default_settings: nil, end_behavior: nil, phases: nil, prebilling: nil, proration_behavior: nil) ⇒ ScheduleDetails

Returns a new instance of ScheduleDetails.



1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1975

def initialize(
  amendments: nil,
  billing_behavior: nil,
  billing_mode: nil,
  billing_schedules: nil,
  default_settings: nil,
  end_behavior: nil,
  phases: nil,
  prebilling: nil,
  proration_behavior: nil
)
  @amendments = amendments
  @billing_behavior = billing_behavior
  @billing_mode = billing_mode
  @billing_schedules = billing_schedules
  @default_settings = default_settings
  @end_behavior = end_behavior
  @phases = phases
  @prebilling = prebilling
  @proration_behavior = proration_behavior
end

Instance Attribute Details

#amendmentsObject

Changes to apply to the phases of the subscription schedule, in the order provided.



1957
1958
1959
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1957

def amendments
  @amendments
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.



1959
1960
1961
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1959

def billing_behavior
  @billing_behavior
end

#billing_modeObject

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



1961
1962
1963
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1961

def billing_mode
  @billing_mode
end

#billing_schedulesObject

Sets the billing schedules for the subscription schedule.



1963
1964
1965
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1963

def billing_schedules
  @billing_schedules
end

#default_settingsObject

Object representing the subscription schedule’s default settings.



1965
1966
1967
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1965

def default_settings
  @default_settings
end

#end_behaviorObject

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.



1967
1968
1969
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1967

def end_behavior
  @end_behavior
end

#phasesObject

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.



1969
1970
1971
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1969

def phases
  @phases
end

#prebillingObject

Provide any time periods to bill in advance.



1971
1972
1973
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1971

def prebilling
  @prebilling
end

#proration_behaviorObject

In cases where the ‘schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.



1973
1974
1975
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1973

def proration_behavior
  @proration_behavior
end

Class Method Details

.field_encodingsObject



1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1997

def self.field_encodings
  @field_encodings = {
    phases: {
      kind: :array,
      element: {
        kind: :object,
        fields: {
          add_invoice_items: {
            kind: :array,
            element: {
              kind: :object,
              fields: {
                price_data: { kind: :object, fields: { unit_amount_decimal: :decimal_string } },
              },
            },
          },
          items: {
            kind: :array,
            element: {
              kind: :object,
              fields: {
                price_data: { kind: :object, fields: { unit_amount_decimal: :decimal_string } },
              },
            },
          },
        },
      },
    },
  }
end