Class: Stripe::Checkout::SessionService::UpdateParams::LineItem

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/services/checkout/session_service.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.



2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
# File 'lib/stripe/services/checkout/session_service.rb', line 2784

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.



2770
2771
2772
# File 'lib/stripe/services/checkout/session_service.rb', line 2770

def adjustable_quantity
  @adjustable_quantity
end

#idObject

ID of an existing line item.



2772
2773
2774
# File 'lib/stripe/services/checkout/session_service.rb', line 2772

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



2774
2775
2776
# File 'lib/stripe/services/checkout/session_service.rb', line 2774

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.



2776
2777
2778
# File 'lib/stripe/services/checkout/session_service.rb', line 2776

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.



2778
2779
2780
# File 'lib/stripe/services/checkout/session_service.rb', line 2778

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



2780
2781
2782
# File 'lib/stripe/services/checkout/session_service.rb', line 2780

def quantity
  @quantity
end

#tax_ratesObject

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



2782
2783
2784
# File 'lib/stripe/services/checkout/session_service.rb', line 2782

def tax_rates
  @tax_rates
end