Class: Stripe::SubscriptionItem::CreateParams::Discount

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

Defined Under Namespace

Classes: DiscountEnd

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil) ⇒ Discount

Returns a new instance of Discount.



248
249
250
251
252
253
# File 'lib/stripe/resources/subscription_item.rb', line 248

def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
  @coupon = coupon
  @discount = discount
  @discount_end = discount_end
  @promotion_code = promotion_code
end

Instance Attribute Details

#couponObject

ID of the coupon to create a new discount for.



240
241
242
# File 'lib/stripe/resources/subscription_item.rb', line 240

def coupon
  @coupon
end

#discountObject

ID of an existing discount on the object (or one of its ancestors) to reuse.



242
243
244
# File 'lib/stripe/resources/subscription_item.rb', line 242

def discount
  @discount
end

#discount_endObject

Details to determine how long the discount should be applied for.



244
245
246
# File 'lib/stripe/resources/subscription_item.rb', line 244

def discount_end
  @discount_end
end

#promotion_codeObject

ID of the promotion code to create a new discount for.



246
247
248
# File 'lib/stripe/resources/subscription_item.rb', line 246

def promotion_code
  @promotion_code
end