Package com.stripe.param.checkout
Class SessionCreateParams.Builder
- java.lang.Object
-
- com.stripe.param.checkout.SessionCreateParams.Builder
-
- Enclosing class:
- SessionCreateParams
public static class SessionCreateParams.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.BuilderaddAllDiscount(java.util.List<SessionCreateParams.Discount> elements)Add all elements to `discounts` list.SessionCreateParams.BuilderaddAllExpand(java.util.List<java.lang.String> elements)Add all elements to `expand` list.SessionCreateParams.BuilderaddAllLineItem(java.util.List<SessionCreateParams.LineItem> elements)Add all elements to `lineItems` list.SessionCreateParams.BuilderaddAllPaymentMethodType(java.util.List<SessionCreateParams.PaymentMethodType> elements)Add all elements to `paymentMethodTypes` list.SessionCreateParams.BuilderaddAllShippingRate(java.util.List<java.lang.String> elements)Add all elements to `shippingRates` list.SessionCreateParams.BuilderaddDiscount(SessionCreateParams.Discount element)Add an element to `discounts` list.SessionCreateParams.BuilderaddExpand(java.lang.String element)Add an element to `expand` list.SessionCreateParams.BuilderaddLineItem(SessionCreateParams.LineItem element)Add an element to `lineItems` list.SessionCreateParams.BuilderaddPaymentMethodType(SessionCreateParams.PaymentMethodType element)Add an element to `paymentMethodTypes` list.SessionCreateParams.BuilderaddShippingRate(java.lang.String element)Add an element to `shippingRates` list.SessionCreateParamsbuild()Finalize and obtain parameter instance from this builder.SessionCreateParams.BuilderputAllExtraParam(java.util.Map<java.lang.String,java.lang.Object> map)Add all map key/value pairs to `extraParams` map.SessionCreateParams.BuilderputAllMetadata(java.util.Map<java.lang.String,java.lang.String> map)Add all map key/value pairs to `metadata` map.SessionCreateParams.BuilderputExtraParam(java.lang.String key, java.lang.Object value)Add a key/value pair to `extraParams` map.SessionCreateParams.BuilderputMetadata(java.lang.String key, java.lang.String value)Add a key/value pair to `metadata` map.SessionCreateParams.BuildersetAllowPromotionCodes(java.lang.Boolean allowPromotionCodes)Enables user redeemable promotion codes.SessionCreateParams.BuildersetAutomaticTax(SessionCreateParams.AutomaticTax automaticTax)SessionCreateParams.BuildersetBillingAddressCollection(SessionCreateParams.BillingAddressCollection billingAddressCollection)Specify whether Checkout should collect the customer's billing address.SessionCreateParams.BuildersetCancelUrl(java.lang.String cancelUrl)The URL the customer will be directed to if they decide to cancel payment and return to your website.SessionCreateParams.BuildersetClientReferenceId(java.lang.String clientReferenceId)A unique string to reference the Checkout Session.SessionCreateParams.BuildersetCustomer(java.lang.String customer)ID of an existing Customer, if one exists.SessionCreateParams.BuildersetCustomerEmail(java.lang.String customerEmail)If provided, this value will be used when the Customer object is created.SessionCreateParams.BuildersetCustomerUpdate(SessionCreateParams.CustomerUpdate customerUpdate)Controls what fields on Customer can be updated by the Checkout Session.SessionCreateParams.BuildersetLocale(SessionCreateParams.Locale locale)The IETF language tag of the locale Checkout is displayed in.SessionCreateParams.BuildersetMode(SessionCreateParams.Mode mode)The mode of the Checkout Session.SessionCreateParams.BuildersetPaymentIntentData(SessionCreateParams.PaymentIntentData paymentIntentData)A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions inpaymentmode.SessionCreateParams.BuildersetPaymentMethodOptions(SessionCreateParams.PaymentMethodOptions paymentMethodOptions)Payment-method-specific configuration.SessionCreateParams.BuildersetSetupIntentData(SessionCreateParams.SetupIntentData setupIntentData)A subset of parameters to be passed to SetupIntent creation for Checkout Sessions insetupmode.SessionCreateParams.BuildersetShippingAddressCollection(SessionCreateParams.ShippingAddressCollection shippingAddressCollection)When set, provides configuration for Checkout to collect a shipping address from a customer.SessionCreateParams.BuildersetSubmitType(SessionCreateParams.SubmitType submitType)Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button.SessionCreateParams.BuildersetSubscriptionData(SessionCreateParams.SubscriptionData subscriptionData)A subset of parameters to be passed to subscription creation for Checkout Sessions insubscriptionmode.SessionCreateParams.BuildersetSuccessUrl(java.lang.String successUrl)The URL to which Stripe should send customers when payment or setup is complete.SessionCreateParams.BuildersetTaxIdCollection(SessionCreateParams.TaxIdCollection taxIdCollection)
-
-
-
Method Detail
-
build
public SessionCreateParams build()
Finalize and obtain parameter instance from this builder.
-
setAllowPromotionCodes
public SessionCreateParams.Builder setAllowPromotionCodes(java.lang.Boolean allowPromotionCodes)
Enables user redeemable promotion codes.
-
setAutomaticTax
public SessionCreateParams.Builder setAutomaticTax(SessionCreateParams.AutomaticTax automaticTax)
-
setBillingAddressCollection
public SessionCreateParams.Builder setBillingAddressCollection(SessionCreateParams.BillingAddressCollection billingAddressCollection)
Specify whether Checkout should collect the customer's billing address.
-
setCancelUrl
public SessionCreateParams.Builder setCancelUrl(java.lang.String cancelUrl)
The URL the customer will be directed to if they decide to cancel payment and return to your website.
-
setClientReferenceId
public SessionCreateParams.Builder setClientReferenceId(java.lang.String clientReferenceId)
A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the session with your internal systems.
-
setCustomer
public SessionCreateParams.Builder setCustomer(java.lang.String customer)
ID of an existing Customer, if one exists. Inpaymentmode, the customer’s most recent card payment method will be used to prefill the email, name, card details, and billing address on the Checkout page. Insubscriptionmode, the customer’s default payment method will be used if it’s a card, and otherwise the most recent card will be used. A valid billing address is required for Checkout to prefill the customer's card details.If the customer changes their email on the Checkout page, the Customer object will be updated with the new email.
If blank for Checkout Sessions in
paymentorsubscriptionmode, Checkout will create a new Customer object based on information provided during the payment flow.You can set
payment_intent_data.setup_future_usageto have Checkout automatically attach the payment method to the Customer you pass in for future reuse.
-
setCustomerEmail
public SessionCreateParams.Builder setCustomerEmail(java.lang.String customerEmail)
If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. Use this parameter to prefill customer data if you already have an email on file. To access information about the customer once a session is complete, use thecustomerfield.
-
setCustomerUpdate
public SessionCreateParams.Builder setCustomerUpdate(SessionCreateParams.CustomerUpdate customerUpdate)
Controls what fields on Customer can be updated by the Checkout Session. Can only be provided whencustomeris provided.
-
addDiscount
public SessionCreateParams.Builder addDiscount(SessionCreateParams.Discount element)
Add an element to `discounts` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeSessionCreateParams.discountsfor the field documentation.
-
addAllDiscount
public SessionCreateParams.Builder addAllDiscount(java.util.List<SessionCreateParams.Discount> elements)
Add all elements to `discounts` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeSessionCreateParams.discountsfor the field documentation.
-
addExpand
public SessionCreateParams.Builder addExpand(java.lang.String element)
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. SeeSessionCreateParams.expandfor the field documentation.
-
addAllExpand
public SessionCreateParams.Builder addAllExpand(java.util.List<java.lang.String> elements)
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. SeeSessionCreateParams.expandfor the field documentation.
-
putExtraParam
public SessionCreateParams.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.extraParamsfor the field documentation.
-
putAllExtraParam
public SessionCreateParams.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.extraParamsfor the field documentation.
-
addLineItem
public SessionCreateParams.Builder addLineItem(SessionCreateParams.LineItem element)
Add an element to `lineItems` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeSessionCreateParams.lineItemsfor the field documentation.
-
addAllLineItem
public SessionCreateParams.Builder addAllLineItem(java.util.List<SessionCreateParams.LineItem> elements)
Add all elements to `lineItems` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeSessionCreateParams.lineItemsfor the field documentation.
-
setLocale
public SessionCreateParams.Builder setLocale(SessionCreateParams.Locale locale)
The IETF language tag of the locale Checkout is displayed in. If blank orauto, the browser's locale is used.
-
putMetadata
public SessionCreateParams.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.metadatafor the field documentation.
-
putAllMetadata
public SessionCreateParams.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.metadatafor the field documentation.
-
setMode
public SessionCreateParams.Builder setMode(SessionCreateParams.Mode mode)
The mode of the Checkout Session. Required when using prices orsetupmode. Passsubscriptionif the Checkout Session includes at least one recurring item.
-
setPaymentIntentData
public SessionCreateParams.Builder setPaymentIntentData(SessionCreateParams.PaymentIntentData paymentIntentData)
A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions inpaymentmode.
-
setPaymentMethodOptions
public SessionCreateParams.Builder setPaymentMethodOptions(SessionCreateParams.PaymentMethodOptions paymentMethodOptions)
Payment-method-specific configuration.
-
addPaymentMethodType
public SessionCreateParams.Builder addPaymentMethodType(SessionCreateParams.PaymentMethodType element)
Add an element to `paymentMethodTypes` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeSessionCreateParams.paymentMethodTypesfor the field documentation.
-
addAllPaymentMethodType
public SessionCreateParams.Builder addAllPaymentMethodType(java.util.List<SessionCreateParams.PaymentMethodType> elements)
Add all elements to `paymentMethodTypes` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeSessionCreateParams.paymentMethodTypesfor the field documentation.
-
setSetupIntentData
public SessionCreateParams.Builder setSetupIntentData(SessionCreateParams.SetupIntentData setupIntentData)
A subset of parameters to be passed to SetupIntent creation for Checkout Sessions insetupmode.
-
setShippingAddressCollection
public SessionCreateParams.Builder setShippingAddressCollection(SessionCreateParams.ShippingAddressCollection shippingAddressCollection)
When set, provides configuration for Checkout to collect a shipping address from a customer.
-
addShippingRate
public SessionCreateParams.Builder addShippingRate(java.lang.String element)
Add an element to `shippingRates` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeSessionCreateParams.shippingRatesfor the field documentation.
-
addAllShippingRate
public SessionCreateParams.Builder addAllShippingRate(java.util.List<java.lang.String> elements)
Add all elements to `shippingRates` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeSessionCreateParams.shippingRatesfor the field documentation.
-
setSubmitType
public SessionCreateParams.Builder setSubmitType(SessionCreateParams.SubmitType submitType)
Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button.submit_typecan only be specified on Checkout Sessions inpaymentmode, but not Checkout Sessions insubscriptionorsetupmode.
-
setSubscriptionData
public SessionCreateParams.Builder setSubscriptionData(SessionCreateParams.SubscriptionData subscriptionData)
A subset of parameters to be passed to subscription creation for Checkout Sessions insubscriptionmode.
-
setSuccessUrl
public SessionCreateParams.Builder setSuccessUrl(java.lang.String successUrl)
The URL to which Stripe should send customers when payment or setup is complete. If you’d like access to the Checkout Session for the successful payment, read more about it in the guide on fulfilling orders.
-
setTaxIdCollection
public SessionCreateParams.Builder setTaxIdCollection(SessionCreateParams.TaxIdCollection taxIdCollection)
-
-