Class: Stripe::Quote::UpdateParams::Line::Action::SetItem

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/resources/quote.rb

Defined Under Namespace

Classes: Discount, Trial

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(discounts: nil, metadata: nil, price: nil, quantity: nil, tax_rates: nil, trial: nil) ⇒ SetItem

Returns a new instance of SetItem.



1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
# File 'lib/stripe/resources/quote.rb', line 1898

def initialize(
  discounts: nil,
  metadata: nil,
  price: nil,
  quantity: nil,
  tax_rates: nil,
  trial: nil
)
  @discounts = discounts
  @metadata = 
  @price = price
  @quantity = quantity
  @tax_rates = tax_rates
  @trial = trial
end

Instance Attribute Details

#discountsObject

If an item with the ‘price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`.



1886
1887
1888
# File 'lib/stripe/resources/quote.rb', line 1886

def discounts
  @discounts
end

#metadataObject

If an item with the ‘price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`.



1888
1889
1890
# File 'lib/stripe/resources/quote.rb', line 1888

def 
  @metadata
end

#priceObject

The ID of the price object.



1890
1891
1892
# File 'lib/stripe/resources/quote.rb', line 1890

def price
  @price
end

#quantityObject

If an item with the ‘price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`.



1892
1893
1894
# File 'lib/stripe/resources/quote.rb', line 1892

def quantity
  @quantity
end

#tax_ratesObject

If an item with the ‘price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`.



1894
1895
1896
# File 'lib/stripe/resources/quote.rb', line 1894

def tax_rates
  @tax_rates
end

#trialObject

If an item with the ‘price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`.



1896
1897
1898
# File 'lib/stripe/resources/quote.rb', line 1896

def trial
  @trial
end