Class Token
- All Implemented Interfaces:
HasId,StripeActiveObject,StripeObjectInterface
If you can't use client-side tokenization, you can also create tokens using the API with either your publishable or secret API key. If your integration uses this method, you're responsible for any PCI compliance that it might require, and you must keep your secret API key safe. Unlike with client-side tokenization, your customer's information isn't sent directly to Stripe, so we can't determine how it's handled or stored.
You can't store or use tokens more than once. To store card or bank account information for later use, create Customer objects or External accounts. Radar, our integrated solution for automatic fraud protection, performs best with integrations that use client-side tokenization.
-
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_GSONFields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanstatic Tokencreate(TokenCreateParams params) Creates a single-use token that represents a bank account’s details.static Tokencreate(TokenCreateParams params, RequestOptions options) Creates a single-use token that represents a bank account’s details.static TokenCreates a single-use token that represents a bank account’s details.static Tokencreate(Map<String, Object> params, RequestOptions options) Creates a single-use token that represents a bank account’s details.booleanThese bank accounts are payment methods onCustomerobjects.getCard()You can store multiple cards on a customer in order to charge the customer later.IP address of the client that generates the token.Time at which the object was created.getId()Unique identifier for the object.Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.String representing the object's type.getType()Type of the token:account,bank_account,card, orpii.getUsed()Determines if you have already used this token (you can only use tokens once).inthashCode()static TokenRetrieves the token with the given ID.static Tokenretrieve(String token, RequestOptions options) Retrieves the token with the given ID.static Tokenretrieve(String token, TokenRetrieveParams params, RequestOptions options) Retrieves the token with the given ID.static TokenRetrieves the token with the given ID.voidsetBankAccount(BankAccount bankAccount) These bank accounts are payment methods onCustomerobjects.voidYou can store multiple cards on a customer in order to charge the customer later.voidsetClientIp(String clientIp) IP address of the client that generates the token.voidsetCreated(Long created) Time at which the object was created.voidUnique identifier for the object.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) Method is used by the containing object orStripeResponseGetterimplementations to set theStripeResponseGetterinstance used to make further requests.voidType of the token:account,bank_account,card, orpii.voidDetermines if you have already used this token (you can only use tokens once).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
-
Token
public Token()
-
-
Method Details
-
create
Creates a single-use token that represents a bank account’s details. You can use this token with any v1 API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a connected account where controller.requirement_collection isapplication, which includes Custom accounts.- Throws:
StripeException
-
create
public static Token create(Map<String, Object> params, RequestOptions options) throws StripeExceptionCreates a single-use token that represents a bank account’s details. You can use this token with any v1 API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a connected account where controller.requirement_collection isapplication, which includes Custom accounts.- Throws:
StripeException
-
create
Creates a single-use token that represents a bank account’s details. You can use this token with any v1 API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a connected account where controller.requirement_collection isapplication, which includes Custom accounts.- Throws:
StripeException
-
create
Creates a single-use token that represents a bank account’s details. You can use this token with any v1 API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a connected account where controller.requirement_collection isapplication, which includes Custom accounts.- Throws:
StripeException
-
retrieve
Retrieves the token with the given ID.- Throws:
StripeException
-
retrieve
Retrieves the token with the given ID.- Throws:
StripeException
-
retrieve
public static Token retrieve(String token, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves the token with the given ID.- Throws:
StripeException
-
retrieve
public static Token retrieve(String token, TokenRetrieveParams params, RequestOptions options) throws StripeException Retrieves the token with the given ID.- Throws:
StripeException
-
setResponseGetter
Description copied from interface:StripeActiveObjectMethod is used by the containing object orStripeResponseGetterimplementations to set theStripeResponseGetterinstance used to make further requests.- Specified by:
setResponseGetterin interfaceStripeActiveObject- Overrides:
setResponseGetterin classApiResource- Parameters:
responseGetter- theStripeResponseGetterinstance to use for making further requests.
-
getBankAccount
These bank accounts are payment methods onCustomerobjects.On the other hand External Accounts are transfer destinations on
Accountobjects for connected accounts. They can be bank accounts or debit cards as well, and are documented in the links above.Related guide: Bank debits and transfers
-
getCard
You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later.Related guide: Card payments with Sources
-
getClientIp
IP address of the client that generates the token. -
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
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
token. -
getType
Type of the token:account,bank_account,card, orpii. -
getUsed
Determines if you have already used this token (you can only use tokens once). -
setBankAccount
These bank accounts are payment methods onCustomerobjects.On the other hand External Accounts are transfer destinations on
Accountobjects for connected accounts. They can be bank accounts or debit cards as well, and are documented in the links above.Related guide: Bank debits and transfers
-
setCard
You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later.Related guide: Card payments with Sources
-
setClientIp
IP address of the client that generates the token. -
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setId
Unique identifier for the object. -
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
token. -
setType
Type of the token:account,bank_account,card, orpii. -
setUsed
Determines if you have already used this token (you can only use tokens once). -
equals
-
canEqual
-
hashCode
public int hashCode() -
getId
Unique identifier for the object.
-