Class: Stripe::Checkout::SessionCreateParams::LineItem
- Inherits:
-
RequestParams
- Object
- RequestParams
- Stripe::Checkout::SessionCreateParams::LineItem
- Defined in:
- lib/stripe/params/checkout/session_create_params.rb
Defined Under Namespace
Classes: AdjustableQuantity, PriceData
Instance Attribute Summary collapse
-
#adjustable_quantity ⇒ Object
When set, provides configuration for this item’s quantity to be adjusted by the customer during Checkout.
-
#metadata ⇒ Object
Set of key-value pairs that you can attach to an object.
- #price ⇒ Object
-
#price_data ⇒ Object
Data used to generate a new Price object inline.
-
#quantity ⇒ Object
The quantity of the line item being purchased.
-
#tax_rates ⇒ Object
The tax rates which apply to this line item.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(adjustable_quantity: nil, metadata: nil, price: nil, price_data: nil, quantity: nil, tax_rates: nil) ⇒ LineItem
constructor
A new instance of LineItem.
Methods inherited from RequestParams
attr_accessor, coerce_params, coerce_value, discriminator, discriminator_fields, new, #to_h
Constructor Details
#initialize(adjustable_quantity: nil, metadata: nil, price: nil, price_data: nil, quantity: nil, tax_rates: nil) ⇒ LineItem
Returns a new instance of LineItem.
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 |
# File 'lib/stripe/params/checkout/session_create_params.rb', line 545 def initialize( adjustable_quantity: nil, metadata: nil, price: nil, price_data: nil, quantity: nil, tax_rates: nil ) @adjustable_quantity = adjustable_quantity @metadata = @price = price @price_data = price_data @quantity = quantity @tax_rates = tax_rates end |
Instance Attribute Details
#adjustable_quantity ⇒ Object
When set, provides configuration for this item’s quantity to be adjusted by the customer during Checkout.
533 534 535 |
# File 'lib/stripe/params/checkout/session_create_params.rb', line 533 def adjustable_quantity @adjustable_quantity end |
#metadata ⇒ Object
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.
535 536 537 |
# File 'lib/stripe/params/checkout/session_create_params.rb', line 535 def @metadata end |
#price ⇒ Object
537 538 539 |
# File 'lib/stripe/params/checkout/session_create_params.rb', line 537 def price @price end |
#price_data ⇒ Object
Data used to generate a new Price object inline. One of price or price_data is required.
539 540 541 |
# File 'lib/stripe/params/checkout/session_create_params.rb', line 539 def price_data @price_data end |
#quantity ⇒ Object
The quantity of the line item being purchased. Quantity should not be defined when recurring.usage_type=metered.
541 542 543 |
# File 'lib/stripe/params/checkout/session_create_params.rb', line 541 def quantity @quantity end |
#tax_rates ⇒ Object
The tax rates which apply to this line item.
543 544 545 |
# File 'lib/stripe/params/checkout/session_create_params.rb', line 543 def tax_rates @tax_rates end |
Class Method Details
.field_encodings ⇒ Object
561 562 563 564 565 |
# File 'lib/stripe/params/checkout/session_create_params.rb', line 561 def self.field_encodings @field_encodings = { price_data: { kind: :object, fields: { unit_amount_decimal: :decimal_string } }, } end |