Token
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
Properties
string | $id | A unique identifier for the resource. | from Resource |
protected mixed | $response | A response from Stripe. | from Resource |
Methods
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.
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.
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.
Creates a single-use token that wraps a user’s legal entity information.
No description
Details
in Resource at line 29
string
getId()
Returns the unique identifier for this resource.
in Resource at line 39
mixed
getResponse()
Returns the raw Stripe response.
in Resource at line 47
protected void
setProperties()
Set the response data as properties on the class.
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.
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.
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.
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.