Class: Stripe::Checkout::SessionCreateParams::Item::Subscription

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

Defined Under Namespace

Classes: BillingCycleAnchorConfig, BillingMode, Item, PendingInvoiceItemInterval, TrialSettings

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(billing_cycle_anchor_config: nil, billing_mode: nil, description: nil, items: nil, metadata: nil, pending_invoice_item_interval: nil, proration_behavior: nil, trial_end: nil, trial_period_days: nil, trial_settings: nil) ⇒ Subscription

Returns a new instance of Subscription.



759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
# File 'lib/stripe/params/checkout/session_create_params.rb', line 759

def initialize(
  billing_cycle_anchor_config: nil,
  billing_mode: nil,
  description: nil,
  items: nil,
  metadata: nil,
  pending_invoice_item_interval: nil,
  proration_behavior: nil,
  trial_end: nil,
  trial_period_days: nil,
  trial_settings: nil
)
  @billing_cycle_anchor_config = billing_cycle_anchor_config
  @billing_mode = billing_mode
  @description = description
  @items = items
  @metadata = 
  @pending_invoice_item_interval = pending_invoice_item_interval
  @proration_behavior = proration_behavior
  @trial_end = trial_end
  @trial_period_days = trial_period_days
  @trial_settings = trial_settings
end

Instance Attribute Details

#billing_cycle_anchor_configObject

Configures when the subscription schedule's billing cycle anchors to a specific day of the week or month.



739
740
741
# File 'lib/stripe/params/checkout/session_create_params.rb', line 739

def billing_cycle_anchor_config
  @billing_cycle_anchor_config
end

#billing_modeObject

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



741
742
743
# File 'lib/stripe/params/checkout/session_create_params.rb', line 741

def billing_mode
  @billing_mode
end

#descriptionObject

The subscription's description, meant to be displayable to the customer.



743
744
745
# File 'lib/stripe/params/checkout/session_create_params.rb', line 743

def description
  @description
end

#itemsObject

The list of items for the subscription.



745
746
747
# File 'lib/stripe/params/checkout/session_create_params.rb', line 745

def items
  @items
end

#metadataObject

Set of key-value pairs 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.



747
748
749
# File 'lib/stripe/params/checkout/session_create_params.rb', line 747

def 
  @metadata
end

#pending_invoice_item_intervalObject

Specifies an interval for how often to bill for any pending invoice items.



749
750
751
# File 'lib/stripe/params/checkout/session_create_params.rb', line 749

def pending_invoice_item_interval
  @pending_invoice_item_interval
end

#proration_behaviorObject

Determines how to handle prorations resulting from the billing_cycle_anchor. If no value is passed, the default is create_prorations.



751
752
753
# File 'lib/stripe/params/checkout/session_create_params.rb', line 751

def proration_behavior
  @proration_behavior
end

#trial_endObject

Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. Has to be at least 48 hours in the future.



753
754
755
# File 'lib/stripe/params/checkout/session_create_params.rb', line 753

def trial_end
  @trial_end
end

#trial_period_daysObject

Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1.



755
756
757
# File 'lib/stripe/params/checkout/session_create_params.rb', line 755

def trial_period_days
  @trial_period_days
end

#trial_settingsObject

Settings related to subscription trials.



757
758
759
# File 'lib/stripe/params/checkout/session_create_params.rb', line 757

def trial_settings
  @trial_settings
end

Class Method Details

.field_encodingsObject



783
784
785
786
787
788
789
790
791
792
793
794
795
# File 'lib/stripe/params/checkout/session_create_params.rb', line 783

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