public class StripeApiHandler
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CHARSET |
static java.lang.String |
LIVE_API_BASE |
static java.lang.String |
TOKENS |
static java.lang.String |
VERSION |
| Constructor and Description |
|---|
StripeApiHandler() |
| Modifier and Type | Method and Description |
|---|---|
static Token |
createToken(java.util.Map<java.lang.String,java.lang.Object> cardParams,
RequestOptions options)
Create a
Token using the input card parameters. |
static Token |
retrieveToken(RequestOptions options,
java.lang.String tokenId)
Retrieve a
Token by its ID. |
public static final java.lang.String LIVE_API_BASE
public static final java.lang.String CHARSET
public static final java.lang.String TOKENS
public static final java.lang.String VERSION
@Nullable public static Token createToken(@NonNull java.util.Map<java.lang.String,java.lang.Object> cardParams, @NonNull RequestOptions options) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException
Token using the input card parameters.cardParams - a mapped set of parameters representing the object for which this token
is being createdoptions - a RequestOptions object that contains connection data like the api
key, api version, etcToken that can be used to perform other operations with this cardAuthenticationException - if there is a problem authenticating to the Stripe APIInvalidRequestException - if one or more of the parameters is incorrectAPIConnectionException - if there is a problem connecting to the Stripe APICardException - if there is a problem with the card informationAPIException - for unknown Stripe API errors. These should be rare.@Nullable public static Token retrieveToken(@NonNull RequestOptions options, @NonNull java.lang.String tokenId) throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException
Token by its ID.options - a RequestOptions object that containstokenId - the id of the token that you're looking forToken if one exists and you have the permissions to access itAuthenticationException - if there is a problem authenticating to the Stripe APIInvalidRequestException - if the token ID parameter is invalidAPIConnectionException - if there is a problem connecting to the Stripe APIAPIException - for unknown Stripe API errors. These should be rare.