Class: Stripe::Checkout::SessionCreateParams::Discount
- Inherits:
-
RequestParams
- Object
- RequestParams
- Stripe::Checkout::SessionCreateParams::Discount
- Defined in:
- lib/stripe/params/checkout/session_create_params.rb
Defined Under Namespace
Classes: CouponData
Instance Attribute Summary collapse
-
#coupon ⇒ Object
The ID of the coupon to apply to this Session.
-
#coupon_data ⇒ Object
Data used to generate a new [Coupon](docs.stripe.com/api/coupon) object inline.
-
#promotion_code ⇒ Object
The ID of a promotion code to apply to this Session.
Instance Method Summary collapse
-
#initialize(coupon: nil, coupon_data: nil, promotion_code: nil) ⇒ Discount
constructor
A new instance of Discount.
Methods inherited from RequestParams
attr_accessor, coerce_params, coerce_value, field_encodings, new, #to_h
Constructor Details
#initialize(coupon: nil, coupon_data: nil, promotion_code: nil) ⇒ Discount
Returns a new instance of Discount.
366 367 368 369 370 |
# File 'lib/stripe/params/checkout/session_create_params.rb', line 366 def initialize(coupon: nil, coupon_data: nil, promotion_code: nil) @coupon = coupon @coupon_data = coupon_data @promotion_code = promotion_code end |
Instance Attribute Details
#coupon ⇒ Object
The ID of the coupon to apply to this Session.
360 361 362 |
# File 'lib/stripe/params/checkout/session_create_params.rb', line 360 def coupon @coupon end |
#coupon_data ⇒ Object
Data used to generate a new [Coupon](docs.stripe.com/api/coupon) object inline. One of ‘coupon` or `coupon_data` is required when updating discounts.
362 363 364 |
# File 'lib/stripe/params/checkout/session_create_params.rb', line 362 def coupon_data @coupon_data end |
#promotion_code ⇒ Object
The ID of a promotion code to apply to this Session.
364 365 366 |
# File 'lib/stripe/params/checkout/session_create_params.rb', line 364 def promotion_code @promotion_code end |