Class: Stripe::PromotionCode::CreateParams
- Inherits:
-
RequestParams
- Object
- RequestParams
- Stripe::PromotionCode::CreateParams
- Defined in:
- lib/stripe/resources/promotion_code.rb
Defined Under Namespace
Classes: Restrictions
Instance Attribute Summary collapse
-
#active ⇒ Object
Whether the promotion code is currently active.
-
#code ⇒ Object
The customer-facing code.
-
#coupon ⇒ Object
The coupon for this promotion code.
-
#customer ⇒ Object
The customer that this promotion code can be used by.
-
#customer_account ⇒ Object
The account that this promotion code can be used by.
-
#expand ⇒ Object
Specifies which fields in the response should be expanded.
-
#expires_at ⇒ Object
The timestamp at which this promotion code will expire.
-
#max_redemptions ⇒ Object
A positive integer specifying the number of times the promotion code can be redeemed.
-
#metadata ⇒ Object
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object.
-
#restrictions ⇒ Object
Settings that restrict the redemption of the promotion code.
Instance Method Summary collapse
-
#initialize(active: nil, code: nil, coupon: nil, customer: nil, customer_account: nil, expand: nil, expires_at: nil, max_redemptions: nil, metadata: nil, restrictions: nil) ⇒ CreateParams
constructor
A new instance of CreateParams.
Methods inherited from RequestParams
Constructor Details
#initialize(active: nil, code: nil, coupon: nil, customer: nil, customer_account: nil, expand: nil, expires_at: nil, max_redemptions: nil, metadata: nil, restrictions: nil) ⇒ CreateParams
Returns a new instance of CreateParams.
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
# File 'lib/stripe/resources/promotion_code.rb', line 169 def initialize( active: nil, code: nil, coupon: nil, customer: nil, customer_account: nil, expand: nil, expires_at: nil, max_redemptions: nil, metadata: nil, restrictions: nil ) @active = active @code = code @coupon = coupon @customer = customer @customer_account = customer_account @expand = @expires_at = expires_at @max_redemptions = max_redemptions @metadata = @restrictions = restrictions end |
Instance Attribute Details
#active ⇒ Object
Whether the promotion code is currently active.
147 148 149 |
# File 'lib/stripe/resources/promotion_code.rb', line 147 def active @active end |
#code ⇒ Object
The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for a specific customer. Valid characters are lower case letters (a-z), upper case letters (A-Z), and digits (0-9).
If left blank, we will generate one automatically.
151 152 153 |
# File 'lib/stripe/resources/promotion_code.rb', line 151 def code @code end |
#coupon ⇒ Object
The coupon for this promotion code.
153 154 155 |
# File 'lib/stripe/resources/promotion_code.rb', line 153 def coupon @coupon end |
#customer ⇒ Object
The customer that this promotion code can be used by. If not set, the promotion code can be used by all customers.
155 156 157 |
# File 'lib/stripe/resources/promotion_code.rb', line 155 def customer @customer end |
#customer_account ⇒ Object
The account that this promotion code can be used by. If not set, the promotion code can be used by all accounts.
157 158 159 |
# File 'lib/stripe/resources/promotion_code.rb', line 157 def customer_account @customer_account end |
#expand ⇒ Object
Specifies which fields in the response should be expanded.
159 160 161 |
# File 'lib/stripe/resources/promotion_code.rb', line 159 def @expand end |
#expires_at ⇒ Object
The timestamp at which this promotion code will expire. If the coupon has specified a ‘redeems_by`, then this value cannot be after the coupon’s ‘redeems_by`.
161 162 163 |
# File 'lib/stripe/resources/promotion_code.rb', line 161 def expires_at @expires_at end |
#max_redemptions ⇒ Object
A positive integer specifying the number of times the promotion code can be redeemed. If the coupon has specified a ‘max_redemptions`, then this value cannot be greater than the coupon’s ‘max_redemptions`.
163 164 165 |
# File 'lib/stripe/resources/promotion_code.rb', line 163 def max_redemptions @max_redemptions end |
#metadata ⇒ Object
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to ‘metadata`.
165 166 167 |
# File 'lib/stripe/resources/promotion_code.rb', line 165 def @metadata end |
#restrictions ⇒ Object
Settings that restrict the redemption of the promotion code.
167 168 169 |
# File 'lib/stripe/resources/promotion_code.rb', line 167 def restrictions @restrictions end |