https://github.com/jacobbennett/stripetesttoken
Use this to quickly generate Stripe test tokens for successful or exceptional responses from Stripe.
https://github.com/jacobbennett/stripetesttoken
php stripe
Last synced: 10 months ago
JSON representation
Use this to quickly generate Stripe test tokens for successful or exceptional responses from Stripe.
- Host: GitHub
- URL: https://github.com/jacobbennett/stripetesttoken
- Owner: JacobBennett
- License: mit
- Created: 2016-12-18T03:12:24.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-10-25T19:22:24.000Z (over 2 years ago)
- Last Synced: 2025-04-05T00:43:55.115Z (10 months ago)
- Topics: php, stripe
- Language: PHP
- Homepage:
- Size: 226 KB
- Stars: 148
- Watchers: 2
- Forks: 17
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Stripe Test Tokens
[](https://packagist.org/packages/jacobbennett/stripe-test-token)
[](https://travis-ci.org/JacobBennett/StripeTestToken)
[](LICENSE)
Use this to quickly create Stripe test tokens for successful and exceptional responses from Stripe.
## Install
```bash
composer require jacobbennett/stripe-test-token
```
## Usage
```php
500,
'currency' => 'usd',
'source' => StripeTestToken::validVisa(),
]);
// Fake a Failing Charge
try {
Charge::create([
'amount' => 500,
'currency' => 'usd',
'source' => StripeTestToken::cvcFail(),
]);
} catch (\Stripe\Error\Card $e) {
// handle errors
}
```
## Docs
> Find full descriptions at original [Stripe Docs Reference](https://stripe.com/docs/testing#cards)
### Using Methods
To use any of the methods below, call the listed method as a static on the `StripeTestToken` class. If you only want to return the corresponding card number, such as with Selenium or Laravel Dusk, you can call the same method on the `StripeCardNumber` class.
```php