Class: Stripe::PaymentLinkCreateParams::LineItem

Inherits:
RequestParams show all
Defined in:
lib/stripe/params/payment_link_create_params.rb

Defined Under Namespace

Classes: AdjustableQuantity, PriceData

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

attr_accessor, coerce_params, coerce_value, new, #to_h

Constructor Details

#initialize(adjustable_quantity: nil, price: nil, price_data: nil, quantity: nil) ⇒ LineItem

Returns a new instance of LineItem.



448
449
450
451
452
453
# File 'lib/stripe/params/payment_link_create_params.rb', line 448

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

Instance Attribute Details

#adjustable_quantityObject

When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout.



440
441
442
# File 'lib/stripe/params/payment_link_create_params.rb', line 440

def adjustable_quantity
  @adjustable_quantity
end

#priceObject

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



442
443
444
# File 'lib/stripe/params/payment_link_create_params.rb', line 442

def price
  @price
end

#price_dataObject

Data used to generate a new [Price](docs.stripe.com/api/prices) object inline. One of ‘price` or `price_data` is required.



444
445
446
# File 'lib/stripe/params/payment_link_create_params.rb', line 444

def price_data
  @price_data
end

#quantityObject

The quantity of the line item being purchased.



446
447
448
# File 'lib/stripe/params/payment_link_create_params.rb', line 446

def quantity
  @quantity
end

Class Method Details

.field_encodingsObject



455
456
457
458
459
# File 'lib/stripe/params/payment_link_create_params.rb', line 455

def self.field_encodings
  @field_encodings = {
    price_data: { kind: :object, fields: { unit_amount_decimal: :decimal_string } },
  }
end