Class Session
- All Implemented Interfaces:
HasId
,MetadataStore<Session>
,StripeActiveObject
,StripeObjectInterface
Once payment is successful, the Checkout Session will contain a reference to the Customer, and either the successful PaymentIntent or an active Subscription.
You can create a Checkout Session on your server and redirect to its URL to begin Checkout.
Related guide: Checkout quickstart
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
URL that creates a new Checkout Session when clicked that is a copy of this expired Checkout Session.static class
Get expandedaccount
.static class
static class
Determines the position and visibility of the payment method reuse agreement in the UI.static class
Text may be up to 1200 characters in length.static class
static class
The value entered by the customer.static class
The value of the tax ID.static class
How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.static class
static class
The account subcategories to use to filter for possible accounts to link.static class
static class
static class
static class
The amount on which tax is calculated, in cents (or local equivalent).static class
static class
Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod
-
Field Summary
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON, INTERNAL_GSON
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
static Session
create
(SessionCreateParams params) Creates a Session object.static Session
create
(SessionCreateParams params, RequestOptions options) Creates a Session object.static Session
Creates a Session object.static Session
create
(Map<String, Object> params, RequestOptions options) Creates a Session object.boolean
expire()
A Session can be expired when it is in one of these statuses:open
expire
(RequestOptions options) A Session can be expired when it is in one of these statuses:open
expire
(SessionExpireParams params) A Session can be expired when it is in one of these statuses:open
expire
(SessionExpireParams params, RequestOptions options) A Session can be expired when it is in one of these statuses:open
A Session can be expired when it is in one of these statuses:open
expire
(Map<String, Object> params, RequestOptions options) A Session can be expired when it is in one of these statuses:open
When set, provides configuration for actions to take if this Checkout Session expires.Enables user redeemable promotion codes.Total of all items before discounts or taxes are applied.Total of all items after discounts and taxes are applied.Describes whether Checkout should collect the customer's billing address.If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website.A unique string to reference the Checkout Session.Client secret to be used when initializing Stripe.js embedded checkout.Results ofconsent_collection
for this session.When set, provides configuration for the Checkout Session to gather active consent from customers.Time at which the object was created.Three-letter ISO currency code, in lowercase.Currency conversion details for Adaptive Pricing sessionsGet ID of expandablecustomer
object.Configure whether a Checkout Session creates a Customer when the Checkout Session completes.The customer details including the customer's tax exempt status and the customer's tax IDs.If provided, this value will be used when the Customer object is created.Get expandedcustomer
.Collect additional information from your customer using custom fields.The timestamp at which the Checkout Session will expire.getId()
Unique identifier for the object.Get ID of expandableinvoice
object.Details on the state of invoice creation for the Checkout Session.Get expandedinvoice
.The line items purchased by the customer.Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.The IETF language tag of the locale Checkout is displayed in.Set of key-value pairs that you can attach to an object.getMode()
The mode of the Checkout Session.String representing the object's type.Get ID of expandablepaymentIntent
object.Get expandedpaymentIntent
.Get ID of expandablepaymentLink
object.Get expandedpaymentLink
.Configure whether a Checkout Session should collect a payment method.Information about the payment method configuration used for this Checkout session if using dynamic payment methods.Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.A list of the types of payment methods (e.g.The payment status of the Checkout Session, one ofpaid
,unpaid
, orno_payment_required
.The ID of the original expired Checkout Session that triggered the recovery flow.This parameter applies toui_mode: embedded
.Applies to Checkout Sessions withui_mode: embedded
.Controls saved payment method settings for the session.Get ID of expandablesetupIntent
object.Get expandedsetupIntent
.When set, provides configuration for Checkout to collect a shipping address from a customer.The details of the customer cost of shipping, including the customer chosen ShippingRate.Shipping information for this Checkout Session.The shipping rate options applied to this Session.The status of the Checkout Session, one ofopen
,complete
, orexpired
.Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button.Get ID of expandablesubscription
object.Get expandedsubscription
.The URL the customer will be directed to after the payment or subscription creation is successful.Tax and discount details for the computed total amount.The UI mode of the Session.getUrl()
The URL to the Checkout Session.int
hashCode()
static SessionCollection
list
(SessionListParams params) Returns a list of Checkout Sessions.static SessionCollection
list
(SessionListParams params, RequestOptions options) Returns a list of Checkout Sessions.static SessionCollection
Returns a list of Checkout Sessions.static SessionCollection
list
(Map<String, Object> params, RequestOptions options) Returns a list of Checkout Sessions.When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items.When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items.listLineItems
(SessionListLineItemsParams params, RequestOptions options) When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items.listLineItems
(Map<String, Object> params) When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items.listLineItems
(Map<String, Object> params, RequestOptions options) When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items.static Session
Retrieves a Session object.static Session
retrieve
(String session, RequestOptions options) Retrieves a Session object.static Session
retrieve
(String session, SessionRetrieveParams params, RequestOptions options) Retrieves a Session object.static Session
Retrieves a Session object.void
setAfterExpiration
(Session.AfterExpiration afterExpiration) When set, provides configuration for actions to take if this Checkout Session expires.void
setAllowPromotionCodes
(Boolean allowPromotionCodes) Enables user redeemable promotion codes.void
setAmountSubtotal
(Long amountSubtotal) Total of all items before discounts or taxes are applied.void
setAmountTotal
(Long amountTotal) Total of all items after discounts and taxes are applied.void
setAutomaticTax
(Session.AutomaticTax automaticTax) void
setBillingAddressCollection
(String billingAddressCollection) Describes whether Checkout should collect the customer's billing address.void
setCancelUrl
(String cancelUrl) If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website.void
setClientReferenceId
(String clientReferenceId) A unique string to reference the Checkout Session.void
setClientSecret
(String clientSecret) Client secret to be used when initializing Stripe.js embedded checkout.void
setConsent
(Session.Consent consent) Results ofconsent_collection
for this session.void
setConsentCollection
(Session.ConsentCollection consentCollection) When set, provides configuration for the Checkout Session to gather active consent from customers.void
setCreated
(Long created) Time at which the object was created.void
setCurrency
(String currency) Three-letter ISO currency code, in lowercase.void
setCurrencyConversion
(Session.CurrencyConversion currencyConversion) Currency conversion details for Adaptive Pricing sessionsvoid
setCustomer
(String id) void
setCustomerCreation
(String customerCreation) Configure whether a Checkout Session creates a Customer when the Checkout Session completes.void
setCustomerDetails
(Session.CustomerDetails customerDetails) The customer details including the customer's tax exempt status and the customer's tax IDs.void
setCustomerEmail
(String customerEmail) If provided, this value will be used when the Customer object is created.void
setCustomerObject
(Customer expandableObject) void
setCustomFields
(List<Session.CustomField> customFields) Collect additional information from your customer using custom fields.void
setCustomText
(Session.CustomText customText) void
setExpiresAt
(Long expiresAt) The timestamp at which the Checkout Session will expire.void
Unique identifier for the object.void
setInvoice
(String id) void
setInvoiceCreation
(Session.InvoiceCreation invoiceCreation) Details on the state of invoice creation for the Checkout Session.void
setInvoiceObject
(Invoice expandableObject) void
setLineItems
(LineItemCollection lineItems) The line items purchased by the customer.void
setLivemode
(Boolean livemode) Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.void
The IETF language tag of the locale Checkout is displayed in.void
setMetadata
(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.void
The mode of the Checkout Session.void
String representing the object's type.void
void
setPaymentIntentObject
(PaymentIntent expandableObject) void
setPaymentLink
(String id) void
setPaymentLinkObject
(PaymentLink expandableObject) void
setPaymentMethodCollection
(String paymentMethodCollection) Configure whether a Checkout Session should collect a payment method.void
setPaymentMethodConfigurationDetails
(Session.PaymentMethodConfigurationDetails paymentMethodConfigurationDetails) Information about the payment method configuration used for this Checkout session if using dynamic payment methods.void
setPaymentMethodOptions
(Session.PaymentMethodOptions paymentMethodOptions) Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.void
setPaymentMethodTypes
(List<String> paymentMethodTypes) A list of the types of payment methods (e.g.void
setPaymentStatus
(String paymentStatus) The payment status of the Checkout Session, one ofpaid
,unpaid
, orno_payment_required
.void
setPhoneNumberCollection
(Session.PhoneNumberCollection phoneNumberCollection) void
setRecoveredFrom
(String recoveredFrom) The ID of the original expired Checkout Session that triggered the recovery flow.void
setRedirectOnCompletion
(String redirectOnCompletion) This parameter applies toui_mode: embedded
.void
setResponseGetter
(StripeResponseGetter responseGetter) The amount on which tax is calculated, in cents (or local equivalent).void
setReturnUrl
(String returnUrl) Applies to Checkout Sessions withui_mode: embedded
.void
setSavedPaymentMethodOptions
(Session.SavedPaymentMethodOptions savedPaymentMethodOptions) Controls saved payment method settings for the session.void
setSetupIntent
(String id) void
setSetupIntentObject
(SetupIntent expandableObject) void
setShippingAddressCollection
(Session.ShippingAddressCollection shippingAddressCollection) When set, provides configuration for Checkout to collect a shipping address from a customer.void
setShippingCost
(Session.ShippingCost shippingCost) The details of the customer cost of shipping, including the customer chosen ShippingRate.void
setShippingDetails
(ShippingDetails shippingDetails) Shipping information for this Checkout Session.void
setShippingOptions
(List<Session.ShippingOption> shippingOptions) The shipping rate options applied to this Session.void
The status of the Checkout Session, one ofopen
,complete
, orexpired
.void
setSubmitType
(String submitType) Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button.void
void
setSubscriptionObject
(Subscription expandableObject) void
setSuccessUrl
(String successUrl) The URL the customer will be directed to after the payment or subscription creation is successful.void
setTaxIdCollection
(Session.TaxIdCollection taxIdCollection) void
setTotalDetails
(Session.TotalDetails totalDetails) Tax and discount details for the computed total amount.void
The UI mode of the Session.void
The URL to the Checkout Session.update
(SessionUpdateParams params) Updates a Session object.update
(SessionUpdateParams params, RequestOptions options) Updates a Session object.Updates a Session object.update
(Map<String, Object> params, RequestOptions options) Updates a Session object.Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, getGlobalResponseGetter, getResponseGetter, setExpandableFieldId, setStripeResponseGetter, urlEncode, urlEncodeId
Methods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.stripe.model.StripeActiveObject
trySetResponseGetter
-
Constructor Details
-
Session
public Session()
-
-
Method Details
-
getCustomer
Get ID of expandablecustomer
object. -
setCustomer
-
getCustomerObject
Get expandedcustomer
. -
setCustomerObject
-
getInvoice
Get ID of expandableinvoice
object. -
setInvoice
-
getInvoiceObject
Get expandedinvoice
. -
setInvoiceObject
-
getPaymentIntent
Get ID of expandablepaymentIntent
object. -
setPaymentIntent
-
getPaymentIntentObject
Get expandedpaymentIntent
. -
setPaymentIntentObject
-
getPaymentLink
Get ID of expandablepaymentLink
object. -
setPaymentLink
-
getPaymentLinkObject
Get expandedpaymentLink
. -
setPaymentLinkObject
-
getSetupIntent
Get ID of expandablesetupIntent
object. -
setSetupIntent
-
getSetupIntentObject
Get expandedsetupIntent
. -
setSetupIntentObject
-
getSubscription
Get ID of expandablesubscription
object. -
setSubscription
-
getSubscriptionObject
Get expandedsubscription
. -
setSubscriptionObject
-
create
Creates a Session object.- Throws:
StripeException
-
create
public static Session create(Map<String, Object> params, RequestOptions options) throws StripeExceptionCreates a Session object.- Throws:
StripeException
-
create
Creates a Session object.- Throws:
StripeException
-
create
public static Session create(SessionCreateParams params, RequestOptions options) throws StripeException Creates a Session object.- Throws:
StripeException
-
expire
A Session can be expired when it is in one of these statuses:open
After it expires, a customer can’t complete a Session and customers loading the Session see a message saying the Session is expired.
- Throws:
StripeException
-
expire
A Session can be expired when it is in one of these statuses:open
After it expires, a customer can’t complete a Session and customers loading the Session see a message saying the Session is expired.
- Throws:
StripeException
-
expire
A Session can be expired when it is in one of these statuses:open
After it expires, a customer can’t complete a Session and customers loading the Session see a message saying the Session is expired.
- Throws:
StripeException
-
expire
A Session can be expired when it is in one of these statuses:open
After it expires, a customer can’t complete a Session and customers loading the Session see a message saying the Session is expired.
- Throws:
StripeException
-
expire
A Session can be expired when it is in one of these statuses:open
After it expires, a customer can’t complete a Session and customers loading the Session see a message saying the Session is expired.
- Throws:
StripeException
-
expire
A Session can be expired when it is in one of these statuses:open
After it expires, a customer can’t complete a Session and customers loading the Session see a message saying the Session is expired.
- Throws:
StripeException
-
list
Returns a list of Checkout Sessions.- Throws:
StripeException
-
list
public static SessionCollection list(Map<String, Object> params, RequestOptions options) throws StripeExceptionReturns a list of Checkout Sessions.- Throws:
StripeException
-
list
Returns a list of Checkout Sessions.- Throws:
StripeException
-
list
public static SessionCollection list(SessionListParams params, RequestOptions options) throws StripeException Returns a list of Checkout Sessions.- Throws:
StripeException
-
listLineItems
When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.- Throws:
StripeException
-
listLineItems
When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.- Throws:
StripeException
-
listLineItems
public LineItemCollection listLineItems(Map<String, Object> params, RequestOptions options) throws StripeExceptionWhen retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.- Throws:
StripeException
-
listLineItems
When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.- Throws:
StripeException
-
listLineItems
public LineItemCollection listLineItems(SessionListLineItemsParams params, RequestOptions options) throws StripeException When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.- Throws:
StripeException
-
retrieve
Retrieves a Session object.- Throws:
StripeException
-
retrieve
Retrieves a Session object.- Throws:
StripeException
-
retrieve
public static Session retrieve(String session, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves a Session object.- Throws:
StripeException
-
retrieve
public static Session retrieve(String session, SessionRetrieveParams params, RequestOptions options) throws StripeException Retrieves a Session object.- Throws:
StripeException
-
update
Updates a Session object.- Specified by:
update
in interfaceMetadataStore<Session>
- Throws:
StripeException
-
update
Updates a Session object.- Specified by:
update
in interfaceMetadataStore<Session>
- Throws:
StripeException
-
update
Updates a Session object.- Throws:
StripeException
-
update
Updates a Session object.- Throws:
StripeException
-
setResponseGetter
The amount on which tax is calculated, in cents (or local equivalent).- Specified by:
setResponseGetter
in interfaceStripeActiveObject
- Overrides:
setResponseGetter
in classApiResource
- Parameters:
responseGetter
- theStripeResponseGetter
instance to use for making further requests.
-
getAfterExpiration
When set, provides configuration for actions to take if this Checkout Session expires. -
getAllowPromotionCodes
Enables user redeemable promotion codes. -
getAmountSubtotal
Total of all items before discounts or taxes are applied. -
getAmountTotal
Total of all items after discounts and taxes are applied. -
getAutomaticTax
-
getBillingAddressCollection
Describes whether Checkout should collect the customer's billing address. Defaults toauto
.One of
auto
, orrequired
. -
getCancelUrl
If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. -
getClientReferenceId
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. -
getClientSecret
Client secret to be used when initializing Stripe.js embedded checkout. -
getConsent
Results ofconsent_collection
for this session. -
getConsentCollection
When set, provides configuration for the Checkout Session to gather active consent from customers. -
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
getCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
getCurrencyConversion
Currency conversion details for Adaptive Pricing sessions -
getCustomFields
Collect additional information from your customer using custom fields. Up to 3 fields are supported. -
getCustomText
-
getCustomerCreation
Configure whether a Checkout Session creates a Customer when the Checkout Session completes.One of
always
, orif_required
. -
getCustomerDetails
The customer details including the customer's tax exempt status and the customer's tax IDs. Customer's address details are not present on Sessions insetup
mode. -
getCustomerEmail
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 the payment flow is complete, use thecustomer
attribute. -
getExpiresAt
The timestamp at which the Checkout Session will expire. -
getInvoiceCreation
Details on the state of invoice creation for the Checkout Session. -
getLineItems
The line items purchased by the customer. -
getLivemode
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode. -
getLocale
The IETF language tag of the locale Checkout is displayed in. If blank orauto
, the browser's locale is used.One of
auto
,bg
,cs
,da
,de
,el
,en
,en-GB
,es
,es-419
,et
,fi
,fil
,fr
,fr-CA
,hr
,hu
,id
,it
,ja
,ko
,lt
,lv
,ms
,mt
,nb
,nl
,pl
,pt
,pt-BR
,ro
,ru
,sk
,sl
,sv
,th
,tr
,vi
,zh
,zh-HK
, orzh-TW
. -
getMode
The mode of the Checkout Session.One of
payment
,setup
, orsubscription
. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
checkout.session
. -
getPaymentMethodCollection
Configure whether a Checkout Session should collect a payment method. Defaults toalways
.One of
always
, orif_required
. -
getPaymentMethodConfigurationDetails
Information about the payment method configuration used for this Checkout session if using dynamic payment methods. -
getPaymentMethodOptions
Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession. -
getPaymentMethodTypes
A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept. -
getPaymentStatus
The payment status of the Checkout Session, one ofpaid
,unpaid
, orno_payment_required
. You can use this value to decide when to fulfill your customer's order. -
getPhoneNumberCollection
-
getRecoveredFrom
The ID of the original expired Checkout Session that triggered the recovery flow. -
getRedirectOnCompletion
This parameter applies toui_mode: embedded
. Learn more about the redirect behavior of embedded sessions. Defaults toalways
.One of
always
,if_required
, ornever
. -
getReturnUrl
Applies to Checkout Sessions withui_mode: embedded
. The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. -
getSavedPaymentMethodOptions
Controls saved payment method settings for the session. Only available inpayment
andsubscription
mode. -
getShippingAddressCollection
When set, provides configuration for Checkout to collect a shipping address from a customer. -
getShippingCost
The details of the customer cost of shipping, including the customer chosen ShippingRate. -
getShippingDetails
Shipping information for this Checkout Session. -
getShippingOptions
The shipping rate options applied to this Session. -
getStatus
The status of the Checkout Session, one ofopen
,complete
, orexpired
. -
getSubmitType
Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button.submit_type
can only be specified on Checkout Sessions inpayment
mode. If blank orauto
,pay
is used.One of
auto
,book
,donate
, orpay
. -
getSuccessUrl
The URL the customer will be directed to after the payment or subscription creation is successful. -
getTaxIdCollection
-
getTotalDetails
Tax and discount details for the computed total amount. -
getUiMode
The UI mode of the Session. Defaults tohosted
.One of
embedded
, orhosted
. -
getUrl
The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If you’re using Custom Domains, the URL will use your subdomain. Otherwise, it’ll usecheckout.stripe.com.
This value is only present when the session is active. -
setAfterExpiration
When set, provides configuration for actions to take if this Checkout Session expires. -
setAllowPromotionCodes
Enables user redeemable promotion codes. -
setAmountSubtotal
Total of all items before discounts or taxes are applied. -
setAmountTotal
Total of all items after discounts and taxes are applied. -
setAutomaticTax
-
setBillingAddressCollection
Describes whether Checkout should collect the customer's billing address. Defaults toauto
.One of
auto
, orrequired
. -
setCancelUrl
If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. -
setClientReferenceId
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. -
setClientSecret
Client secret to be used when initializing Stripe.js embedded checkout. -
setConsent
Results ofconsent_collection
for this session. -
setConsentCollection
When set, provides configuration for the Checkout Session to gather active consent from customers. -
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
setCurrencyConversion
Currency conversion details for Adaptive Pricing sessions -
setCustomFields
Collect additional information from your customer using custom fields. Up to 3 fields are supported. -
setCustomText
-
setCustomerCreation
Configure whether a Checkout Session creates a Customer when the Checkout Session completes.One of
always
, orif_required
. -
setCustomerDetails
The customer details including the customer's tax exempt status and the customer's tax IDs. Customer's address details are not present on Sessions insetup
mode. -
setCustomerEmail
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 the payment flow is complete, use thecustomer
attribute. -
setExpiresAt
The timestamp at which the Checkout Session will expire. -
setId
Unique identifier for the object. -
setInvoiceCreation
Details on the state of invoice creation for the Checkout Session. -
setLineItems
The line items purchased by the customer. -
setLivemode
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode. -
setLocale
The IETF language tag of the locale Checkout is displayed in. If blank orauto
, the browser's locale is used.One of
auto
,bg
,cs
,da
,de
,el
,en
,en-GB
,es
,es-419
,et
,fi
,fil
,fr
,fr-CA
,hr
,hu
,id
,it
,ja
,ko
,lt
,lv
,ms
,mt
,nb
,nl
,pl
,pt
,pt-BR
,ro
,ru
,sk
,sl
,sv
,th
,tr
,vi
,zh
,zh-HK
, orzh-TW
. -
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. -
setMode
The mode of the Checkout Session.One of
payment
,setup
, orsubscription
. -
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
checkout.session
. -
setPaymentMethodCollection
Configure whether a Checkout Session should collect a payment method. Defaults toalways
.One of
always
, orif_required
. -
setPaymentMethodConfigurationDetails
public void setPaymentMethodConfigurationDetails(Session.PaymentMethodConfigurationDetails paymentMethodConfigurationDetails) Information about the payment method configuration used for this Checkout session if using dynamic payment methods. -
setPaymentMethodOptions
Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession. -
setPaymentMethodTypes
A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept. -
setPaymentStatus
The payment status of the Checkout Session, one ofpaid
,unpaid
, orno_payment_required
. You can use this value to decide when to fulfill your customer's order. -
setPhoneNumberCollection
-
setRecoveredFrom
The ID of the original expired Checkout Session that triggered the recovery flow. -
setRedirectOnCompletion
This parameter applies toui_mode: embedded
. Learn more about the redirect behavior of embedded sessions. Defaults toalways
.One of
always
,if_required
, ornever
. -
setReturnUrl
Applies to Checkout Sessions withui_mode: embedded
. The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. -
setSavedPaymentMethodOptions
public void setSavedPaymentMethodOptions(Session.SavedPaymentMethodOptions savedPaymentMethodOptions) Controls saved payment method settings for the session. Only available inpayment
andsubscription
mode. -
setShippingAddressCollection
public void setShippingAddressCollection(Session.ShippingAddressCollection shippingAddressCollection) When set, provides configuration for Checkout to collect a shipping address from a customer. -
setShippingCost
The details of the customer cost of shipping, including the customer chosen ShippingRate. -
setShippingDetails
Shipping information for this Checkout Session. -
setShippingOptions
The shipping rate options applied to this Session. -
setStatus
The status of the Checkout Session, one ofopen
,complete
, orexpired
. -
setSubmitType
Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button.submit_type
can only be specified on Checkout Sessions inpayment
mode. If blank orauto
,pay
is used.One of
auto
,book
,donate
, orpay
. -
setSuccessUrl
The URL the customer will be directed to after the payment or subscription creation is successful. -
setTaxIdCollection
-
setTotalDetails
Tax and discount details for the computed total amount. -
setUiMode
The UI mode of the Session. Defaults tohosted
.One of
embedded
, orhosted
. -
setUrl
The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If you’re using Custom Domains, the URL will use your subdomain. Otherwise, it’ll usecheckout.stripe.com.
This value is only present when the session is active. -
equals
-
canEqual
-
hashCode
public int hashCode() -
getId
Unique identifier for the object. -
getMetadata
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.- Specified by:
getMetadata
in interfaceMetadataStore<Session>
-