Class: Stripe::SubscriptionItemUpdateParams::Discount

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/params/subscription_item_update_params.rb

Defined Under Namespace

Classes: DiscountEnd, Settings

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, settings: nil) ⇒ Discount

Returns a new instance of Discount.



107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/stripe/params/subscription_item_update_params.rb', line 107

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

Instance Attribute Details

#couponObject

ID of the coupon to create a new discount for.



97
98
99
# File 'lib/stripe/params/subscription_item_update_params.rb', line 97

def coupon
  @coupon
end

#discountObject

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



99
100
101
# File 'lib/stripe/params/subscription_item_update_params.rb', line 99

def discount
  @discount
end

#discount_endObject

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



101
102
103
# File 'lib/stripe/params/subscription_item_update_params.rb', line 101

def discount_end
  @discount_end
end

#promotion_codeObject

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



103
104
105
# File 'lib/stripe/params/subscription_item_update_params.rb', line 103

def promotion_code
  @promotion_code
end

#settingsObject

Settings for discount application including service period anchoring.



105
106
107
# File 'lib/stripe/params/subscription_item_update_params.rb', line 105

def settings
  @settings
end