Package com.stripe.model
Class CustomerSession
java.lang.Object
com.stripe.model.StripeObject
com.stripe.net.ApiResource
com.stripe.model.CustomerSession
- All Implemented Interfaces:
StripeActiveObject,StripeObjectInterface
A Customer Session allows you to grant Stripe's frontend SDKs (like Stripe.js) client-side access
control over a Customer.
Related guides: Customer Session with the Payment Element, Customer Session with the Pricing Table, Customer Session with the Buy Button.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConfiguration for the components supported by this Customer Session.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_GSONFields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanstatic CustomerSessioncreate(CustomerSessionCreateParams params) Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.static CustomerSessioncreate(CustomerSessionCreateParams params, RequestOptions options) Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.static CustomerSessionCreates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.static CustomerSessioncreate(Map<String, Object> params, RequestOptions options) Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.booleanThe client secret of this Customer Session.Configuration for the components supported by this Customer Session.Time at which the object was created.Get ID of expandablecustomerobject.The Account that the Customer Session was created for.Get expandedcustomer.The timestamp at which this Customer Session will expire.Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.String representing the object's type.inthashCode()voidsetClientSecret(String clientSecret) The client secret of this Customer Session.voidsetComponents(CustomerSession.Components components) Configuration for the components supported by this Customer Session.voidsetCreated(Long created) Time at which the object was created.voidsetCustomer(String id) voidsetCustomerAccount(String customerAccount) The Account that the Customer Session was created for.voidsetCustomerObject(Customer expandableObject) voidsetExpiresAt(Long expiresAt) The timestamp at which this Customer Session will expire.voidsetLivemode(Boolean livemode) Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidString representing the object's type.voidsetResponseGetter(StripeResponseGetter responseGetter) Whether the pricing table is enabled.Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, getGlobalResponseGetter, getResponseGetter, setExpandableFieldId, setGlobalResponseGetter, urlEncode, urlEncodeIdMethods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.stripe.model.StripeActiveObject
trySetResponseGetter
-
Constructor Details
-
CustomerSession
public CustomerSession()
-
-
Method Details
-
getCustomer
Get ID of expandablecustomerobject. -
setCustomer
-
getCustomerObject
Get expandedcustomer. -
setCustomerObject
-
create
Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.- Throws:
StripeException
-
create
public static CustomerSession create(Map<String, Object> params, RequestOptions options) throws StripeExceptionCreates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.- Throws:
StripeException
-
create
Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.- Throws:
StripeException
-
create
public static CustomerSession create(CustomerSessionCreateParams params, RequestOptions options) throws StripeException Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.- Throws:
StripeException
-
setResponseGetter
Whether the pricing table is enabled.- Specified by:
setResponseGetterin interfaceStripeActiveObject- Overrides:
setResponseGetterin classApiResource- Parameters:
responseGetter- theStripeResponseGetterinstance to use for making further requests.
-
getClientSecret
The client secret of this Customer Session. Used on the client to set up secure access to the givencustomer.The client secret can be used to provide access to
customerfrom your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret. -
getComponents
Configuration for the components supported by this Customer Session. -
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
getCustomerAccount
The Account that the Customer Session was created for. -
getExpiresAt
The timestamp at which this Customer Session will expire. -
getLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
customer_session. -
setClientSecret
The client secret of this Customer Session. Used on the client to set up secure access to the givencustomer.The client secret can be used to provide access to
customerfrom your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret. -
setComponents
Configuration for the components supported by this Customer Session. -
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setCustomerAccount
The Account that the Customer Session was created for. -
setExpiresAt
The timestamp at which this Customer Session will expire. -
setLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
customer_session. -
equals
-
canEqual
-
hashCode
public int hashCode()
-