Class AccountSession
- All Implemented Interfaces:
StripeActiveObject
,StripeObjectInterface
We recommend that you create an AccountSession each time you need to display an embedded component to your user. Do not save AccountSessions to your database as they expire relatively quickly, and cannot be used more than once.
Related guide: Connect embedded components
-
Nested Class Summary
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 AccountSession
create
(AccountSessionCreateParams params) Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access.static AccountSession
create
(AccountSessionCreateParams params, RequestOptions options) Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access.static AccountSession
Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access.static AccountSession
create
(Map<String, Object> params, RequestOptions options) Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access.boolean
The ID of the account the AccountSession was created for.The client secret of this AccountSession.The timestamp at which this AccountSession 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
setAccount
(String account) The ID of the account the AccountSession was created for.void
setClientSecret
(String clientSecret) The client secret of this AccountSession.void
setComponents
(AccountSession.Components components) void
setExpiresAt
(Long expiresAt) The timestamp at which this AccountSession 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 embedded component 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
-
AccountSession
public AccountSession()
-
-
Method Details
-
create
Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access.- Throws:
StripeException
-
create
public static AccountSession create(Map<String, Object> params, RequestOptions options) throws StripeExceptionCreates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access.- Throws:
StripeException
-
create
Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access.- Throws:
StripeException
-
create
public static AccountSession create(AccountSessionCreateParams params, RequestOptions options) throws StripeException Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access.- Throws:
StripeException
-
setResponseGetter
Whether the embedded component is enabled.- Specified by:
setResponseGetter
in interfaceStripeActiveObject
- Overrides:
setResponseGetter
in classApiResource
- Parameters:
responseGetter
- theStripeResponseGetter
instance to use for making further requests.
-
getAccount
The ID of the account the AccountSession was created for. -
getClientSecret
The client secret of this AccountSession. Used on the client to set up secure access to the givenaccount
.The client secret can be used to provide access to
account
from your frontend. It should not be stored, logged, or exposed to anyone other than the connected account. Make sure that you have TLS enabled on any page that includes the client secret.Refer to our docs to setup Connect embedded components and learn about how
client_secret
should be handled. -
getComponents
-
getExpiresAt
The timestamp at which this AccountSession 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
account_session
. -
setAccount
The ID of the account the AccountSession was created for. -
setClientSecret
The client secret of this AccountSession. Used on the client to set up secure access to the givenaccount
.The client secret can be used to provide access to
account
from your frontend. It should not be stored, logged, or exposed to anyone other than the connected account. Make sure that you have TLS enabled on any page that includes the client secret.Refer to our docs to setup Connect embedded components and learn about how
client_secret
should be handled. -
setComponents
-
setExpiresAt
The timestamp at which this AccountSession 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
account_session
. -
equals
-
canEqual
-
hashCode
public int hashCode()
-