Class: Stripe::Price::CreateParams

Inherits:
RequestParams show all
Defined in:
lib/stripe/resources/price.rb

Defined Under Namespace

Classes: CurrencyOptions, CustomUnitAmount, ProductData, Recurring, Tier, TransformQuantity

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(active: nil, billing_scheme: nil, currency: nil, currency_options: nil, custom_unit_amount: nil, expand: nil, lookup_key: nil, metadata: nil, nickname: nil, product: nil, product_data: nil, recurring: nil, tax_behavior: nil, tiers: nil, tiers_mode: nil, transfer_lookup_key: nil, transform_quantity: nil, unit_amount: nil, unit_amount_decimal: nil) ⇒ CreateParams

Returns a new instance of CreateParams.



427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
# File 'lib/stripe/resources/price.rb', line 427

def initialize(
  active: nil,
  billing_scheme: nil,
  currency: nil,
  currency_options: nil,
  custom_unit_amount: nil,
  expand: nil,
  lookup_key: nil,
  metadata: nil,
  nickname: nil,
  product: nil,
  product_data: nil,
  recurring: nil,
  tax_behavior: nil,
  tiers: nil,
  tiers_mode: nil,
  transfer_lookup_key: nil,
  transform_quantity: nil,
  unit_amount: nil,
  unit_amount_decimal: nil
)
  @active = active
  @billing_scheme = billing_scheme
  @currency = currency
  @currency_options = currency_options
  @custom_unit_amount = custom_unit_amount
  @expand = expand
  @lookup_key = lookup_key
  @metadata = 
  @nickname = nickname
  @product = product
  @product_data = product_data
  @recurring = recurring
  @tax_behavior = tax_behavior
  @tiers = tiers
  @tiers_mode = tiers_mode
  @transfer_lookup_key = transfer_lookup_key
  @transform_quantity = transform_quantity
  @unit_amount = unit_amount
  @unit_amount_decimal = unit_amount_decimal
end

Instance Attribute Details

#activeObject

Whether the price can be used for new purchases. Defaults to ‘true`.



389
390
391
# File 'lib/stripe/resources/price.rb', line 389

def active
  @active
end

#billing_schemeObject

Describes how to compute the price per period. Either ‘per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes.



391
392
393
# File 'lib/stripe/resources/price.rb', line 391

def billing_scheme
  @billing_scheme
end

#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).



393
394
395
# File 'lib/stripe/resources/price.rb', line 393

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).



395
396
397
# File 'lib/stripe/resources/price.rb', line 395

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.



397
398
399
# File 'lib/stripe/resources/price.rb', line 397

def custom_unit_amount
  @custom_unit_amount
end

#expandObject

Specifies which fields in the response should be expanded.



399
400
401
# File 'lib/stripe/resources/price.rb', line 399

def expand
  @expand
end

#lookup_keyObject

A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters.



401
402
403
# File 'lib/stripe/resources/price.rb', line 401

def lookup_key
  @lookup_key
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`.



403
404
405
# File 'lib/stripe/resources/price.rb', line 403

def 
  @metadata
end

#nicknameObject

A brief description of the price, hidden from customers.



405
406
407
# File 'lib/stripe/resources/price.rb', line 405

def nickname
  @nickname
end

#productObject

The ID of the product that this price will belong to.



407
408
409
# File 'lib/stripe/resources/price.rb', line 407

def product
  @product
end

#product_dataObject

These fields can be used to create a new product that this price will belong to.



409
410
411
# File 'lib/stripe/resources/price.rb', line 409

def product_data
  @product_data
end

#recurringObject

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



411
412
413
# File 'lib/stripe/resources/price.rb', line 411

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.



413
414
415
# File 'lib/stripe/resources/price.rb', line 413

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`.



415
416
417
# File 'lib/stripe/resources/price.rb', line 415

def tiers
  @tiers
end

#tiers_modeObject

Defines if the tiering price should be ‘graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows.



417
418
419
# File 'lib/stripe/resources/price.rb', line 417

def tiers_mode
  @tiers_mode
end

#transfer_lookup_keyObject

If set to true, will atomically remove the lookup key from the existing price, and assign it to this price.



419
420
421
# File 'lib/stripe/resources/price.rb', line 419

def transfer_lookup_key
  @transfer_lookup_key
end

#transform_quantityObject

Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with ‘tiers`.



421
422
423
# File 'lib/stripe/resources/price.rb', line 421

def transform_quantity
  @transform_quantity
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, unless `billing_scheme=tiered`.



423
424
425
# File 'lib/stripe/resources/price.rb', line 423

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.



425
426
427
# File 'lib/stripe/resources/price.rb', line 425

def unit_amount_decimal
  @unit_amount_decimal
end