Class: Stripe::QuoteService::CreateParams::Line::Action::SetItem

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/services/quote_service.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.



438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
# File 'lib/stripe/services/quote_service.rb', line 438

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



421
422
423
# File 'lib/stripe/services/quote_service.rb', line 421

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



424
425
426
# File 'lib/stripe/services/quote_service.rb', line 424

def 
  @metadata
end

#priceObject

The ID of the price object.



427
428
429
# File 'lib/stripe/services/quote_service.rb', line 427

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



430
431
432
# File 'lib/stripe/services/quote_service.rb', line 430

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



433
434
435
# File 'lib/stripe/services/quote_service.rb', line 433

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



436
437
438
# File 'lib/stripe/services/quote_service.rb', line 436

def trial
  @trial
end