Package com.stripe.param.checkout
Class SessionCreateParams.SubscriptionData.Builder
- java.lang.Object
-
- com.stripe.param.checkout.SessionCreateParams.SubscriptionData.Builder
-
- Enclosing class:
- SessionCreateParams.SubscriptionData
public static class SessionCreateParams.SubscriptionData.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SessionCreateParams.SubscriptionData.Builder
addAllDefaultTaxRate(java.util.List<java.lang.String> elements)
Add all elements to `defaultTaxRates` list.SessionCreateParams.SubscriptionData.Builder
addAllItem(java.util.List<SessionCreateParams.SubscriptionData.Item> elements)
Add all elements to `items` list.SessionCreateParams.SubscriptionData.Builder
addDefaultTaxRate(java.lang.String element)
Add an element to `defaultTaxRates` list.SessionCreateParams.SubscriptionData.Builder
addItem(SessionCreateParams.SubscriptionData.Item element)
Add an element to `items` list.SessionCreateParams.SubscriptionData
build()
Finalize and obtain parameter instance from this builder.SessionCreateParams.SubscriptionData.Builder
putAllExtraParam(java.util.Map<java.lang.String,java.lang.Object> map)
Add all map key/value pairs to `extraParams` map.SessionCreateParams.SubscriptionData.Builder
putAllMetadata(java.util.Map<java.lang.String,java.lang.String> map)
Add all map key/value pairs to `metadata` map.SessionCreateParams.SubscriptionData.Builder
putExtraParam(java.lang.String key, java.lang.Object value)
Add a key/value pair to `extraParams` map.SessionCreateParams.SubscriptionData.Builder
putMetadata(java.lang.String key, java.lang.String value)
Add a key/value pair to `metadata` map.SessionCreateParams.SubscriptionData.Builder
setApplicationFeePercent(java.math.BigDecimal applicationFeePercent)
A non-negative decimal between 0 and 100, with at most two decimal places.SessionCreateParams.SubscriptionData.Builder
setCoupon(java.lang.String coupon)
The ID of the coupon to apply to this subscription.SessionCreateParams.SubscriptionData.Builder
setTrialEnd(java.lang.Long trialEnd)
Unix timestamp representing the end of the trial period the customer will get before being charged for the first time.SessionCreateParams.SubscriptionData.Builder
setTrialFromPlan(java.lang.Boolean trialFromPlan)
Indicates if a plan’strial_period_days
should be applied to the subscription.SessionCreateParams.SubscriptionData.Builder
setTrialPeriodDays(java.lang.Long trialPeriodDays)
Integer representing the number of trial period days before the customer is charged for the first time.
-
-
-
Method Detail
-
build
public SessionCreateParams.SubscriptionData build()
Finalize and obtain parameter instance from this builder.
-
setApplicationFeePercent
public SessionCreateParams.SubscriptionData.Builder setApplicationFeePercent(java.math.BigDecimal applicationFeePercent)
A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. To use an application fee percent, the request must be made on behalf of another account, using theStripe-Account
header or an OAuth key. For more information, see the application fees documentation.
-
setCoupon
public SessionCreateParams.SubscriptionData.Builder setCoupon(java.lang.String coupon)
The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription.
-
addDefaultTaxRate
public SessionCreateParams.SubscriptionData.Builder addDefaultTaxRate(java.lang.String element)
Add an element to `defaultTaxRates` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeSessionCreateParams.SubscriptionData.defaultTaxRates
for the field documentation.
-
addAllDefaultTaxRate
public SessionCreateParams.SubscriptionData.Builder addAllDefaultTaxRate(java.util.List<java.lang.String> elements)
Add all elements to `defaultTaxRates` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeSessionCreateParams.SubscriptionData.defaultTaxRates
for the field documentation.
-
putExtraParam
public SessionCreateParams.SubscriptionData.Builder putExtraParam(java.lang.String key, java.lang.Object value)
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. SeeSessionCreateParams.SubscriptionData.extraParams
for the field documentation.
-
putAllExtraParam
public SessionCreateParams.SubscriptionData.Builder putAllExtraParam(java.util.Map<java.lang.String,java.lang.Object> map)
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. SeeSessionCreateParams.SubscriptionData.extraParams
for the field documentation.
-
addItem
public SessionCreateParams.SubscriptionData.Builder addItem(SessionCreateParams.SubscriptionData.Item element)
Add an element to `items` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeSessionCreateParams.SubscriptionData.items
for the field documentation.
-
addAllItem
public SessionCreateParams.SubscriptionData.Builder addAllItem(java.util.List<SessionCreateParams.SubscriptionData.Item> elements)
Add all elements to `items` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeSessionCreateParams.SubscriptionData.items
for the field documentation.
-
putMetadata
public SessionCreateParams.SubscriptionData.Builder putMetadata(java.lang.String key, java.lang.String value)
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. SeeSessionCreateParams.SubscriptionData.metadata
for the field documentation.
-
putAllMetadata
public SessionCreateParams.SubscriptionData.Builder putAllMetadata(java.util.Map<java.lang.String,java.lang.String> map)
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. SeeSessionCreateParams.SubscriptionData.metadata
for the field documentation.
-
setTrialEnd
public SessionCreateParams.SubscriptionData.Builder setTrialEnd(java.lang.Long trialEnd)
Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. Has to be at least 48 hours in the future.
-
setTrialFromPlan
public SessionCreateParams.SubscriptionData.Builder setTrialFromPlan(java.lang.Boolean trialFromPlan)
Indicates if a plan’strial_period_days
should be applied to the subscription. Settingtrial_end
onsubscription_data
is preferred. Defaults tofalse
.
-
setTrialPeriodDays
public SessionCreateParams.SubscriptionData.Builder setTrialPeriodDays(java.lang.Long trialPeriodDays)
Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1.
-
-