Package com.stripe.param
Class CouponCreateParams.Builder
java.lang.Object
com.stripe.param.CouponCreateParams.Builder
- Enclosing class:
- CouponCreateParams
-
Constructor Summary
-
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.Add all map key/value pairs to `currencyOptions` map.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.putCurrencyOption
(String key, CouponCreateParams.CurrencyOption value) Add a key/value pair to `currencyOptions` 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.setAmountOff
(Long amountOff) A positive integer representing the amount to subtract from an invoice total (required ifpercent_off
is not passed).setAppliesTo
(CouponCreateParams.AppliesTo appliesTo) A hash containing directions for what this Coupon will apply discounts to.setCurrency
(String currency) Three-letter ISO code for the currency of theamount_off
parameter (required ifamount_off
is passed).setDuration
(CouponCreateParams.Duration duration) Specifies how long the discount will be in effect if used on a subscription.setDurationInMonths
(Long durationInMonths) Required only ifduration
isrepeating
, in which case it must be a positive integer that specifies the number of months the discount will be in effect.Unique string of your choice that will be used to identify this coupon when applying it to a customer.setMaxRedemptions
(Long maxRedemptions) A positive integer specifying the number of times the coupon can be redeemed before it's no longer valid.setMetadata
(EmptyParam metadata) Set of key-value pairs that you can attach to an object.setMetadata
(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.Name of the coupon displayed to customers on, for instance invoices, or receipts.setPercentOff
(BigDecimal percentOff) A positive float larger than 0, and smaller or equal to 100, that represents the discount the coupon will apply (required ifamount_off
is not passed).setRedeemBy
(Long redeemBy) Unix timestamp specifying the last time at which the coupon can be redeemed.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
Finalize and obtain parameter instance from this builder. -
setAmountOff
A positive integer representing the amount to subtract from an invoice total (required ifpercent_off
is not passed). -
setAppliesTo
A hash containing directions for what this Coupon will apply discounts to. -
setCurrency
Three-letter ISO code for the currency of theamount_off
parameter (required ifamount_off
is passed). -
putCurrencyOption
public CouponCreateParams.Builder putCurrencyOption(String key, CouponCreateParams.CurrencyOption value) Add a key/value pair to `currencyOptions` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. SeeCouponCreateParams.currencyOptions
for the field documentation. -
putAllCurrencyOption
public CouponCreateParams.Builder putAllCurrencyOption(Map<String, CouponCreateParams.CurrencyOption> map) Add all map key/value pairs to `currencyOptions` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. SeeCouponCreateParams.currencyOptions
for the field documentation. -
setDuration
Specifies how long the discount will be in effect if used on a subscription. Defaults toonce
. -
setDurationInMonths
Required only ifduration
isrepeating
, in which case it must be a positive integer that specifies the number of months the discount will be in effect. -
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. SeeCouponCreateParams.expand
for 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. SeeCouponCreateParams.expand
for the field documentation. -
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. SeeCouponCreateParams.extraParams
for 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. SeeCouponCreateParams.extraParams
for the field documentation. -
setId
Unique string of your choice that will be used to identify this coupon when applying it to a customer. If you don't want to specify a particular code, you can leave the ID blank and we'll generate a random code for you. -
setMaxRedemptions
A positive integer specifying the number of times the coupon can be redeemed before it's no longer valid. For example, you might have a 50% off coupon that the first 20 readers of your blog can use. -
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. SeeCouponCreateParams.metadata
for 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. SeeCouponCreateParams.metadata
for the field documentation. -
setMetadata
Set of key-value pairs 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 tometadata
. -
setMetadata
Set of key-value pairs 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 tometadata
. -
setName
Name of the coupon displayed to customers on, for instance invoices, or receipts. By default theid
is shown ifname
is not set. -
setPercentOff
A positive float larger than 0, and smaller or equal to 100, that represents the discount the coupon will apply (required ifamount_off
is not passed). -
setRedeemBy
Unix timestamp specifying the last time at which the coupon can be redeemed. After the redeem_by date, the coupon can no longer be applied to new customers.
-