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

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, metadata: nil, price: nil, price_data: nil, quantity: nil, tax_rates: nil) ⇒ LineItem

Returns a new instance of LineItem.



951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
# File 'lib/stripe/params/checkout/session_create_params.rb', line 951

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



939
940
941
# File 'lib/stripe/params/checkout/session_create_params.rb', line 939

def adjustable_quantity
  @adjustable_quantity
end

#metadataObject

Set of key-value pairs 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.



941
942
943
# File 'lib/stripe/params/checkout/session_create_params.rb', line 941

def 
  @metadata
end

#priceObject

The ID of the Price or Plan object. One of price or price_data is required.



943
944
945
# File 'lib/stripe/params/checkout/session_create_params.rb', line 943

def price
  @price
end

#price_dataObject

Data used to generate a new Price object inline. One of price or price_data is required.



945
946
947
# File 'lib/stripe/params/checkout/session_create_params.rb', line 945

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.



947
948
949
# File 'lib/stripe/params/checkout/session_create_params.rb', line 947

def quantity
  @quantity
end

#tax_ratesObject

The tax rates which apply to this line item.



949
950
951
# File 'lib/stripe/params/checkout/session_create_params.rb', line 949

def tax_rates
  @tax_rates
end

Class Method Details

.field_encodingsObject



967
968
969
970
971
# File 'lib/stripe/params/checkout/session_create_params.rb', line 967

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