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.



2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
# File 'lib/stripe/services/checkout/session_service.rb', line 2503

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.



2489
2490
2491
# File 'lib/stripe/services/checkout/session_service.rb', line 2489

def adjustable_quantity
  @adjustable_quantity
end

#idObject

ID of an existing line item.



2491
2492
2493
# File 'lib/stripe/services/checkout/session_service.rb', line 2491

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



2493
2494
2495
# File 'lib/stripe/services/checkout/session_service.rb', line 2493

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.



2495
2496
2497
# File 'lib/stripe/services/checkout/session_service.rb', line 2495

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.



2497
2498
2499
# File 'lib/stripe/services/checkout/session_service.rb', line 2497

def price_data
  @price_data
end

#quantityObject

The quantity of the line item being purchased.



2499
2500
2501
# File 'lib/stripe/services/checkout/session_service.rb', line 2499

def quantity
  @quantity
end

#tax_ratesObject

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



2501
2502
2503
# File 'lib/stripe/services/checkout/session_service.rb', line 2501

def tax_rates
  @tax_rates
end