public class

StripeTokenClient

extends Object
java.lang.Object
   ↳ com.wsl.modules.stripe.client.StripeTokenClient

Class Overview

Encapsulates Token-related Stripe API calls.

Summary

Public Constructors
StripeTokenClient()
Public Methods
Token createBankAccountToken(String bankAccountId, BankAccount bankAccount)
Create a Bank Account Token Creates a single use token that wraps the details of a bank account.
Token createCardToken(String cardId, Source card, String customer)
Create a Card Token
Token retrieveToken(String id)
Retrieve a Token Retrieves the token with the given ID
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public StripeTokenClient ()

Public Methods

public Token createBankAccountToken (String bankAccountId, BankAccount bankAccount)

Create a Bank Account Token Creates a single use token that wraps the details of a bank account. This token can be used in place of a bank account Map with any API method. These tokens can only be used once: by attaching them to a recipient.

Parameters
bankAccountId The bank account's ID, or...
bankAccount ... Otherwise, if you do not pass a bank account ID, a Map containing a the account details
Returns
  • The created bank account token object is returned if successful. Otherwise, this call throws an error.
Throws
StripeConnectorException when there is a problem with the Connector

public Token createCardToken (String cardId, Source card, String customer)

Create a Card Token

Parameters
cardId The card this token will represent. If you also pass in a customer, the card must be the ID of a card belonging to the customer...
card ... Otherwise, if you do not pass a customer, a Map containing a user's credit card details
customer For use with Stripe Connect only; this can only be used with an OAuth access token or Stripe-Account header.. For more details, see the shared customers documentation. A customer (owned by the application's account) to create a token for.
Returns
  • The created card token object is returned if successful. Otherwise, this call throws an error.
Throws
StripeConnectorException when there is a problem with the Connector

public Token retrieveToken (String id)

Retrieve a Token Retrieves the token with the given ID

Parameters
id The ID of the desired token
Returns
  • Returns a token if a valid ID was provided. Throws an error otherwise.
Throws
StripeConnectorException when there is a problem with the Connector