class Token extends Resource implements TokenInterface

Tokenization is the process Stripe uses to collect sensitive card or bank account details, or personally identifiable information (PII), directly from your customers in a secure manner. A token representing this information is returned to your server to use. You should use Checkout, Elements, or our mobile libraries to perform this process, client-side. This ensures that no sensitive card data touches your server, and allows your integration to operate in a PCI-compliant way.

Traits

Retrieve.

Properties

string $id A unique identifier for the resource. from Resource
protected mixed $response A response from Stripe. from Resource

Methods

string
getId()

Returns the unique identifier for this resource.

from Resource
mixed
getResponse()

Returns the raw Stripe response.

from Resource
void
setProperties()

Set the response data as properties on the class.

from Resource
retrieve(string $id)

Get a resource by the ID.

from Retrieve
createCard(int $number, int $expMonth, int $expYear, int $cvc, array $arguments = [], string $key = null)

Creates a single-use token that represents a credit card’s details. This token can be used in place of a credit card associative array with any API method. These tokens can be used only once: by creating a new Charge object, or by attaching them to a Customer object.

createBankAccount(string $country, string $currency, string $accountHolderName, string $accountHolderType, int $routingNumber, int $accountNumber, array $arguments = [], string $key = null)

Creates a single-use token that represents a bank account’s details. This token can be used in place of a bank account associative array with any API method. These tokens can be used only once: by attaching them to a recipient or Custom account.

createPii(string $personalIdNumber, string $key = null)

Creates a single-use token that represents the details of personally identifiable information (PII). This token can be used in place of a personal_id_number in the Account Update API method. A PII token can be used only once.

createAccount(array $arguments = [], string $key = null)

Creates a single-use token that wraps a user’s legal entity information.

void
stripe(string $method, $arguments, string $idempotencyKey = null)

No description

Details

in Resource at line 29
string getId()

Returns the unique identifier for this resource.

Return Value

string

in Resource at line 39
mixed getResponse()

Returns the raw Stripe response.

Return Value

mixed

in Resource at line 47
protected void setProperties()

Set the response data as properties on the class.

Return Value

void

in Retrieve at line 17
Retrieve retrieve(string $id)

Get a resource by the ID.

Parameters

string $id

Return Value

Retrieve

at line 40
TokenInterface createCard(int $number, int $expMonth, int $expYear, int $cvc, array $arguments = [], string $key = null)

Creates a single-use token that represents a credit card’s details. This token can be used in place of a credit card associative array with any API method. These tokens can be used only once: by creating a new Charge object, or by attaching them to a Customer object.

Parameters

int $number
int $expMonth
int $expYear
int $cvc
array $arguments
string $key

Return Value

TokenInterface

See also

at line 71
TokenInterface createBankAccount(string $country, string $currency, string $accountHolderName, string $accountHolderType, int $routingNumber, int $accountNumber, array $arguments = [], string $key = null)

Creates a single-use token that represents a bank account’s details. This token can be used in place of a bank account associative array with any API method. These tokens can be used only once: by attaching them to a recipient or Custom account.

Parameters

string $country
string $currency
string $accountHolderName
string $accountHolderType
int $routingNumber
int $accountNumber
array $arguments
string $key

Return Value

TokenInterface

See also

at line 98
TokenInterface createPii(string $personalIdNumber, string $key = null)

Creates a single-use token that represents the details of personally identifiable information (PII). This token can be used in place of a personal_id_number in the Account Update API method. A PII token can be used only once.

Parameters

string $personalIdNumber
string $key

Return Value

TokenInterface

See also

at line 121
TokenInterface createAccount(array $arguments = [], string $key = null)

Creates a single-use token that wraps a user’s legal entity information.

Use this when creating or updating a Connect account. See the account tokens documentation to learn more.

Parameters

array $arguments
string $key

Return Value

TokenInterface

See also

at line 128
protected void stripe(string $method, $arguments, string $idempotencyKey = null)

Parameters

string $method
$arguments
string $idempotencyKey

Return Value

void