Class: Stripe::ProductService::CreateParams::DefaultPriceData::CurrencyOptions

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/services/product_service.rb

Defined Under Namespace

Classes: CustomUnitAmount, Tier

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(custom_unit_amount: nil, tax_behavior: nil, tiers: nil, unit_amount: nil, unit_amount_decimal: nil) ⇒ CurrencyOptions

Returns a new instance of CurrencyOptions.



239
240
241
242
243
244
245
246
247
248
249
250
251
# File 'lib/stripe/services/product_service.rb', line 239

def initialize(
  custom_unit_amount: nil,
  tax_behavior: nil,
  tiers: nil,
  unit_amount: nil,
  unit_amount_decimal: nil
)
  @custom_unit_amount = custom_unit_amount
  @tax_behavior = tax_behavior
  @tiers = tiers
  @unit_amount = unit_amount
  @unit_amount_decimal = unit_amount_decimal
end

Instance Attribute Details

#custom_unit_amountObject

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



229
230
231
# File 'lib/stripe/services/product_service.rb', line 229

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



231
232
233
# File 'lib/stripe/services/product_service.rb', line 231

def tax_behavior
  @tax_behavior
end

#tiersObject

Each element represents a pricing tier. This parameter requires ‘billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`.



233
234
235
# File 'lib/stripe/services/product_service.rb', line 233

def tiers
  @tiers
end

#unit_amountObject

A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.



235
236
237
# File 'lib/stripe/services/product_service.rb', line 235

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.



237
238
239
# File 'lib/stripe/services/product_service.rb', line 237

def unit_amount_decimal
  @unit_amount_decimal
end