Class: Stripe::Checkout::SessionService::CreateParams::OptionalItem

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/services/checkout/session_service.rb

Defined Under Namespace

Classes: AdjustableQuantity

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(adjustable_quantity: nil, price: nil, quantity: nil) ⇒ OptionalItem

Returns a new instance of OptionalItem.



588
589
590
591
592
# File 'lib/stripe/services/checkout/session_service.rb', line 588

def initialize(adjustable_quantity: nil, price: nil, quantity: nil)
  @adjustable_quantity = adjustable_quantity
  @price = price
  @quantity = quantity
end

Instance Attribute Details

#adjustable_quantityObject

When set, provides configuration for the customer to adjust the quantity of the line item created when a customer chooses to add this optional item to their order.



582
583
584
# File 'lib/stripe/services/checkout/session_service.rb', line 582

def adjustable_quantity
  @adjustable_quantity
end

#priceObject

The ID of the [Price](stripe.com/docs/api/prices) or [Plan](stripe.com/docs/api/plans) object.



584
585
586
# File 'lib/stripe/services/checkout/session_service.rb', line 584

def price
  @price
end

#quantityObject

The initial quantity of the line item created when a customer chooses to add this optional item to their order.



586
587
588
# File 'lib/stripe/services/checkout/session_service.rb', line 586

def quantity
  @quantity
end