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
Modifier and TypeClassDescriptionstatic class
Configuration 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_GSON
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
static CustomerSession
create
(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 CustomerSession
create
(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 CustomerSession
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 CustomerSession
create
(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.boolean
The 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 expandablecustomer
object.Get expandedcustomer
.The timestamp at which this Customer Session will expire.Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.String representing the object's type.int
hashCode()
void
setClientSecret
(String clientSecret) The client secret of this Customer Session.void
setComponents
(CustomerSession.Components components) Configuration for the components supported by this Customer Session.void
setCreated
(Long created) Time at which the object was created.void
setCustomer
(String id) void
setCustomerObject
(Customer expandableObject) void
setExpiresAt
(Long expiresAt) The timestamp at which this Customer Session will expire.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
String representing the object's type.void
setResponseGetter
(StripeResponseGetter responseGetter) Whether the pricing table is enabled.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
-
CustomerSession
public CustomerSession()
-
-
Method Details
-
getCustomer
Get ID of expandablecustomer
object. -
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:
setResponseGetter
in interfaceStripeActiveObject
- Overrides:
setResponseGetter
in classApiResource
- Parameters:
responseGetter
- theStripeResponseGetter
instance 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
customer
from 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. -
getExpiresAt
The timestamp at which this Customer Session will expire. -
getLivemode
Has the valuetrue
if the object exists in live mode or the valuefalse
if 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
customer
from 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. -
setExpiresAt
The timestamp at which this Customer Session will expire. -
setLivemode
Has the valuetrue
if the object exists in live mode or the valuefalse
if 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()
-