Class: Stripe::PromotionCodeCreateParams
- Inherits:
-
RequestParams
- Object
- RequestParams
- Stripe::PromotionCodeCreateParams
- Defined in:
- lib/stripe/params/promotion_code_create_params.rb
Defined Under Namespace
Classes: Promotion, Restrictions
Instance Attribute Summary collapse
-
#active ⇒ Object
Whether the promotion code is currently active.
-
#code ⇒ Object
The customer-facing code.
-
#customer ⇒ Object
The customer 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.
-
#promotion ⇒ Object
The promotion referenced by this promotion code.
-
#restrictions ⇒ Object
Settings that restrict the redemption of the promotion code.
Instance Method Summary collapse
-
#initialize(active: nil, code: nil, customer: nil, expand: nil, expires_at: nil, max_redemptions: nil, metadata: nil, promotion: nil, restrictions: nil) ⇒ PromotionCodeCreateParams
constructor
A new instance of PromotionCodeCreateParams.
Methods inherited from RequestParams
Constructor Details
#initialize(active: nil, code: nil, customer: nil, expand: nil, expires_at: nil, max_redemptions: nil, metadata: nil, promotion: nil, restrictions: nil) ⇒ PromotionCodeCreateParams
Returns a new instance of PromotionCodeCreateParams.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/stripe/params/promotion_code_create_params.rb', line 69 def initialize( active: nil, code: nil, customer: nil, expand: nil, expires_at: nil, max_redemptions: nil, metadata: nil, promotion: nil, restrictions: nil ) @active = active @code = code @customer = customer @expand = @expires_at = expires_at @max_redemptions = max_redemptions @metadata = @promotion = promotion @restrictions = restrictions end |
Instance Attribute Details
#active ⇒ Object
Whether the promotion code is currently active.
49 50 51 |
# File 'lib/stripe/params/promotion_code_create_params.rb', line 49 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.
53 54 55 |
# File 'lib/stripe/params/promotion_code_create_params.rb', line 53 def code @code 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.
55 56 57 |
# File 'lib/stripe/params/promotion_code_create_params.rb', line 55 def customer @customer end |
#expand ⇒ Object
Specifies which fields in the response should be expanded.
57 58 59 |
# File 'lib/stripe/params/promotion_code_create_params.rb', line 57 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`.
59 60 61 |
# File 'lib/stripe/params/promotion_code_create_params.rb', line 59 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`.
61 62 63 |
# File 'lib/stripe/params/promotion_code_create_params.rb', line 61 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`.
63 64 65 |
# File 'lib/stripe/params/promotion_code_create_params.rb', line 63 def @metadata end |
#promotion ⇒ Object
The promotion referenced by this promotion code.
65 66 67 |
# File 'lib/stripe/params/promotion_code_create_params.rb', line 65 def promotion @promotion end |
#restrictions ⇒ Object
Settings that restrict the redemption of the promotion code.
67 68 69 |
# File 'lib/stripe/params/promotion_code_create_params.rb', line 67 def restrictions @restrictions end |