Package com.stripe.param
Class PromotionCodeCreateParams.Builder
java.lang.Object
com.stripe.param.PromotionCodeCreateParams.Builder
- Enclosing class:
- PromotionCodeCreateParams
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAllExpand(List<String> elements) Add all elements to `expand` list.Add an element to `expand` list.build()Finalize and obtain parameter instance from this builder.putAllExtraParam(Map<String, Object> map) Add all map key/value pairs to `extraParams` map.putAllMetadata(Map<String, String> map) Add all map key/value pairs to `metadata` map.putExtraParam(String key, Object value) Add a key/value pair to `extraParams` map.putMetadata(String key, String value) Add a key/value pair to `metadata` map.Whether the promotion code is currently active.The customer-facing code.Required. The coupon for this promotion code.setCustomer(String customer) The customer that this promotion code can be used by.setExpiresAt(Long expiresAt) The timestamp at which this promotion code will expire.setMaxRedemptions(Long maxRedemptions) A positive integer specifying the number of times the promotion code can be redeemed.setRestrictions(PromotionCodeCreateParams.Restrictions restrictions) Settings that restrict the redemption of the promotion code.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
Finalize and obtain parameter instance from this builder. -
setActive
Whether the promotion code is currently active. -
setCode
The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for a specific customer. If left blank, we will generate one automatically. -
setCoupon
Required. The coupon for this promotion code. -
setCustomer
The customer that this promotion code can be used by. If not set, the promotion code can be used by all customers. -
addExpand
Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeePromotionCodeCreateParams.expandfor the field documentation. -
addAllExpand
Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeePromotionCodeCreateParams.expandfor the field documentation. -
setExpiresAt
The timestamp at which this promotion code will expire. If the coupon has specified aredeems_by, then this value cannot be after the coupon'sredeems_by. -
putExtraParam
Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. SeePromotionCodeCreateParams.extraParamsfor the field documentation. -
putAllExtraParam
Add all map key/value pairs to `extraParams` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. SeePromotionCodeCreateParams.extraParamsfor the field documentation. -
setMaxRedemptions
A positive integer specifying the number of times the promotion code can be redeemed. If the coupon has specified amax_redemptions, then this value cannot be greater than the coupon'smax_redemptions. -
putMetadata
Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. SeePromotionCodeCreateParams.metadatafor the field documentation. -
putAllMetadata
Add all map key/value pairs to `metadata` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. SeePromotionCodeCreateParams.metadatafor the field documentation. -
setRestrictions
public PromotionCodeCreateParams.Builder setRestrictions(PromotionCodeCreateParams.Restrictions restrictions) Settings that restrict the redemption of the promotion code.
-