Class: Stripe::Checkout::SessionCreateParams::LineItem

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/params/checkout/session_create_params.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, dynamic_tax_rates: nil, metadata: nil, price: nil, price_data: nil, quantity: nil, tax_rates: nil) ⇒ LineItem

Returns a new instance of LineItem.



636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
# File 'lib/stripe/params/checkout/session_create_params.rb', line 636

def initialize(
  adjustable_quantity: nil,
  dynamic_tax_rates: nil,
  metadata: nil,
  price: nil,
  price_data: nil,
  quantity: nil,
  tax_rates: nil
)
  @adjustable_quantity = adjustable_quantity
  @dynamic_tax_rates = dynamic_tax_rates
  @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.



622
623
624
# File 'lib/stripe/params/checkout/session_create_params.rb', line 622

def adjustable_quantity
  @adjustable_quantity
end

#dynamic_tax_ratesObject

The [tax rates](stripe.com/docs/api/tax_rates) that will be applied to this line item depending on the customer’s billing/shipping address. We currently support the following countries: US, GB, AU, and all countries in the EU.



624
625
626
# File 'lib/stripe/params/checkout/session_create_params.rb', line 624

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



626
627
628
# File 'lib/stripe/params/checkout/session_create_params.rb', line 626

def 
  @metadata
end

#priceObject

The ID of the [Price](stripe.com/docs/api/prices) or [Plan](stripe.com/docs/api/plans) object. One of ‘price` or `price_data` is required.



628
629
630
# File 'lib/stripe/params/checkout/session_create_params.rb', line 628

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.



630
631
632
# File 'lib/stripe/params/checkout/session_create_params.rb', line 630

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



632
633
634
# File 'lib/stripe/params/checkout/session_create_params.rb', line 632

def quantity
  @quantity
end

#tax_ratesObject

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



634
635
636
# File 'lib/stripe/params/checkout/session_create_params.rb', line 634

def tax_rates
  @tax_rates
end