Class: Stripe::Checkout::Session::CreateParams::SubscriptionData

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/resources/checkout/session.rb

Defined Under Namespace

Classes: BillingMode, InvoiceSettings, TransferData, TrialSettings

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(application_fee_percent: nil, billing_cycle_anchor: nil, billing_mode: nil, default_tax_rates: nil, description: nil, invoice_settings: nil, metadata: nil, on_behalf_of: nil, proration_behavior: nil, transfer_data: nil, trial_end: nil, trial_period_days: nil, trial_settings: nil) ⇒ SubscriptionData

Returns a new instance of SubscriptionData.



3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
# File 'lib/stripe/resources/checkout/session.rb', line 3034

def initialize(
  application_fee_percent: nil,
  billing_cycle_anchor: nil,
  billing_mode: nil,
  default_tax_rates: nil,
  description: nil,
  invoice_settings: nil,
  metadata: nil,
  on_behalf_of: nil,
  proration_behavior: nil,
  transfer_data: nil,
  trial_end: nil,
  trial_period_days: nil,
  trial_settings: nil
)
  @application_fee_percent = application_fee_percent
  @billing_cycle_anchor = billing_cycle_anchor
  @billing_mode = billing_mode
  @default_tax_rates = default_tax_rates
  @description = description
  @invoice_settings = invoice_settings
  @metadata = 
  @on_behalf_of = on_behalf_of
  @proration_behavior = proration_behavior
  @transfer_data = transfer_data
  @trial_end = trial_end
  @trial_period_days = trial_period_days
  @trial_settings = trial_settings
end

Instance Attribute Details

#application_fee_percentObject

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. To use an application fee percent, the request must be made on behalf of another account, using the ‘Stripe-Account` header or an OAuth key. For more information, see the application fees [documentation](stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).



3004
3005
3006
# File 'lib/stripe/resources/checkout/session.rb', line 3004

def application_fee_percent
  @application_fee_percent
end

#billing_cycle_anchorObject

A future timestamp to anchor the subscription’s billing cycle for new subscriptions.



3006
3007
3008
# File 'lib/stripe/resources/checkout/session.rb', line 3006

def billing_cycle_anchor
  @billing_cycle_anchor
end

#billing_modeObject

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



3008
3009
3010
# File 'lib/stripe/resources/checkout/session.rb', line 3008

def billing_mode
  @billing_mode
end

#default_tax_ratesObject

The tax rates that will apply to any subscription item that does not have ‘tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription.



3012
3013
3014
# File 'lib/stripe/resources/checkout/session.rb', line 3012

def default_tax_rates
  @default_tax_rates
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 the [customer portal](stripe.com/docs/customer-management).



3016
3017
3018
# File 'lib/stripe/resources/checkout/session.rb', line 3016

def description
  @description
end

#invoice_settingsObject

All invoices will be billed using the specified settings.



3018
3019
3020
# File 'lib/stripe/resources/checkout/session.rb', line 3018

def invoice_settings
  @invoice_settings
end

#metadataObject

Set of [key-value pairs](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`.



3020
3021
3022
# File 'lib/stripe/resources/checkout/session.rb', line 3020

def 
  @metadata
end

#on_behalf_ofObject

The account on behalf of which to charge, for each of the subscription’s invoices.



3022
3023
3024
# File 'lib/stripe/resources/checkout/session.rb', line 3022

def on_behalf_of
  @on_behalf_of
end

#proration_behaviorObject

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



3024
3025
3026
# File 'lib/stripe/resources/checkout/session.rb', line 3024

def proration_behavior
  @proration_behavior
end

#transfer_dataObject

If specified, the funds from the subscription’s invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges.



3026
3027
3028
# File 'lib/stripe/resources/checkout/session.rb', line 3026

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



3028
3029
3030
# File 'lib/stripe/resources/checkout/session.rb', line 3028

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.



3030
3031
3032
# File 'lib/stripe/resources/checkout/session.rb', line 3030

def trial_period_days
  @trial_period_days
end

#trial_settingsObject

Settings related to subscription trials.



3032
3033
3034
# File 'lib/stripe/resources/checkout/session.rb', line 3032

def trial_settings
  @trial_settings
end