Class: Stripe::Checkout::Session::CreateParams::Discount

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

Defined Under Namespace

Classes: CouponData

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(coupon: nil, coupon_data: nil, promotion_code: nil) ⇒ Discount

Returns a new instance of Discount.



1647
1648
1649
1650
1651
# File 'lib/stripe/resources/checkout/session.rb', line 1647

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

Instance Attribute Details

#couponObject

The ID of the coupon to apply to this Session.



1641
1642
1643
# File 'lib/stripe/resources/checkout/session.rb', line 1641

def coupon
  @coupon
end

#coupon_dataObject

Data used to generate a new [Coupon](stripe.com/docs/api/coupon) object inline. One of ‘coupon` or `coupon_data` is required when updating discounts.



1643
1644
1645
# File 'lib/stripe/resources/checkout/session.rb', line 1643

def coupon_data
  @coupon_data
end

#promotion_codeObject

The ID of a promotion code to apply to this Session.



1645
1646
1647
# File 'lib/stripe/resources/checkout/session.rb', line 1645

def promotion_code
  @promotion_code
end