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.



4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
# File 'lib/stripe/resources/checkout/session.rb', line 4867

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.



4853
4854
4855
# File 'lib/stripe/resources/checkout/session.rb', line 4853

def adjustable_quantity
  @adjustable_quantity
end

#idObject

ID of an existing line item.



4855
4856
4857
# File 'lib/stripe/resources/checkout/session.rb', line 4855

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



4857
4858
4859
# File 'lib/stripe/resources/checkout/session.rb', line 4857

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.



4859
4860
4861
# File 'lib/stripe/resources/checkout/session.rb', line 4859

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.



4861
4862
4863
# File 'lib/stripe/resources/checkout/session.rb', line 4861

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



4863
4864
4865
# File 'lib/stripe/resources/checkout/session.rb', line 4863

def quantity
  @quantity
end

#tax_ratesObject

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



4865
4866
4867
# File 'lib/stripe/resources/checkout/session.rb', line 4865

def tax_rates
  @tax_rates
end