Class: Stripe::QuoteService::CreateParams::Line::Action::AddDiscount

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/services/quote_service.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, index: nil, promotion_code: nil) ⇒ AddDiscount

Returns a new instance of AddDiscount.



185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/stripe/services/quote_service.rb', line 185

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

Instance Attribute Details

#couponObject

The coupon code to redeem.



175
176
177
# File 'lib/stripe/services/quote_service.rb', line 175

def coupon
  @coupon
end

#discountObject

An ID of an existing discount for a coupon that was already redeemed.



177
178
179
# File 'lib/stripe/services/quote_service.rb', line 177

def discount
  @discount
end

#discount_endObject

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



179
180
181
# File 'lib/stripe/services/quote_service.rb', line 179

def discount_end
  @discount_end
end

#indexObject

The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the ‘discounts` array.



181
182
183
# File 'lib/stripe/services/quote_service.rb', line 181

def index
  @index
end

#promotion_codeObject

The promotion code to redeem.



183
184
185
# File 'lib/stripe/services/quote_service.rb', line 183

def promotion_code
  @promotion_code
end