Class: Stripe::Product::CreateParams::DefaultPriceData

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

Defined Under Namespace

Classes: CurrencyOptions, CustomUnitAmount, Recurring

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(currency: nil, currency_options: nil, custom_unit_amount: nil, recurring: nil, tax_behavior: nil, unit_amount: nil, unit_amount_decimal: nil) ⇒ DefaultPriceData

Returns a new instance of DefaultPriceData.



348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
# File 'lib/stripe/resources/product.rb', line 348

def initialize(
  currency: nil,
  currency_options: nil,
  custom_unit_amount: nil,
  recurring: nil,
  tax_behavior: nil,
  unit_amount: nil,
  unit_amount_decimal: nil
)
  @currency = currency
  @currency_options = currency_options
  @custom_unit_amount = custom_unit_amount
  @recurring = recurring
  @tax_behavior = tax_behavior
  @unit_amount = unit_amount
  @unit_amount_decimal = unit_amount_decimal
end

Instance Attribute Details

#currencyObject

Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](stripe.com/docs/currencies).



334
335
336
# File 'lib/stripe/resources/product.rb', line 334

def currency
  @currency
end

#currency_optionsObject

Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html) and a [supported currency](stripe.com/docs/currencies).



336
337
338
# File 'lib/stripe/resources/product.rb', line 336

def currency_options
  @currency_options
end

#custom_unit_amountObject

When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links.



338
339
340
# File 'lib/stripe/resources/product.rb', line 338

def custom_unit_amount
  @custom_unit_amount
end

#recurringObject

The recurring components of a price such as ‘interval` and `interval_count`.



340
341
342
# File 'lib/stripe/resources/product.rb', line 340

def recurring
  @recurring
end

#tax_behaviorObject

Only required if a [default tax behavior](stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of ‘inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.



342
343
344
# File 'lib/stripe/resources/product.rb', line 342

def tax_behavior
  @tax_behavior
end

#unit_amountObject

A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of ‘unit_amount`, `unit_amount_decimal`, or `custom_unit_amount` is required.



344
345
346
# File 'lib/stripe/resources/product.rb', line 344

def unit_amount
  @unit_amount
end

#unit_amount_decimalObject

Same as ‘unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.



346
347
348
# File 'lib/stripe/resources/product.rb', line 346

def unit_amount_decimal
  @unit_amount_decimal
end