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.



3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
# File 'lib/stripe/resources/checkout/session.rb', line 3952

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.



3938
3939
3940
# File 'lib/stripe/resources/checkout/session.rb', line 3938

def adjustable_quantity
  @adjustable_quantity
end

#idObject

ID of an existing line item.



3940
3941
3942
# File 'lib/stripe/resources/checkout/session.rb', line 3940

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



3942
3943
3944
# File 'lib/stripe/resources/checkout/session.rb', line 3942

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.



3944
3945
3946
# File 'lib/stripe/resources/checkout/session.rb', line 3944

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.



3946
3947
3948
# File 'lib/stripe/resources/checkout/session.rb', line 3946

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



3948
3949
3950
# File 'lib/stripe/resources/checkout/session.rb', line 3948

def quantity
  @quantity
end

#tax_ratesObject

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



3950
3951
3952
# File 'lib/stripe/resources/checkout/session.rb', line 3950

def tax_rates
  @tax_rates
end