Class: Stripe::Checkout::Session::UpdateParams::LineItem

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

Defined Under Namespace

Classes: AdjustableQuantity, PriceData

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(adjustable_quantity: nil, id: nil, metadata: nil, price: nil, price_data: nil, quantity: nil, tax_rates: nil) ⇒ LineItem

Returns a new instance of LineItem.



3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
# File 'lib/stripe/resources/checkout/session.rb', line 3723

def initialize(
  adjustable_quantity: nil,
  id: nil,
  metadata: nil,
  price: nil,
  price_data: nil,
  quantity: nil,
  tax_rates: nil
)
  @adjustable_quantity = adjustable_quantity
  @id = id
  @metadata = 
  @price = price
  @price_data = price_data
  @quantity = quantity
  @tax_rates = tax_rates
end

Instance Attribute Details

#adjustable_quantityObject

When set, provides configuration for this item’s quantity to be adjusted by the customer during Checkout.



3709
3710
3711
# File 'lib/stripe/resources/checkout/session.rb', line 3709

def adjustable_quantity
  @adjustable_quantity
end

#idObject

ID of an existing line item.



3711
3712
3713
# File 'lib/stripe/resources/checkout/session.rb', line 3711

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



3713
3714
3715
# File 'lib/stripe/resources/checkout/session.rb', line 3713

def 
  @metadata
end

#priceObject

The ID of the [Price](stripe.com/docs/api/prices). One of ‘price` or `price_data` is required when creating a new line item.



3715
3716
3717
# File 'lib/stripe/resources/checkout/session.rb', line 3715

def price
  @price
end

#price_dataObject

Data used to generate a new [Price](stripe.com/docs/api/prices) object inline. One of ‘price` or `price_data` is required when creating a new line item.



3717
3718
3719
# File 'lib/stripe/resources/checkout/session.rb', line 3717

def price_data
  @price_data
end

#quantityObject

The quantity of the line item being purchased. Quantity should not be defined when ‘recurring.usage_type=metered`.



3719
3720
3721
# File 'lib/stripe/resources/checkout/session.rb', line 3719

def quantity
  @quantity
end

#tax_ratesObject

The [tax rates](stripe.com/docs/api/tax_rates) which apply to this line item.



3721
3722
3723
# File 'lib/stripe/resources/checkout/session.rb', line 3721

def tax_rates
  @tax_rates
end