Stripe PHP Library

Installs: 872 264

Dependents: 50

Stars: 725

Watchers: 79

Forks: 183

Open Issues: 4

Language: PHP


Build Status Latest Stable Version Total Downloads License Code Coverage

You can sign up for a Stripe account at


PHP 5.3.3 and later.


You can install the bindings via Composer. Add this to your composer.json:

  "require": {
    "stripe/stripe-php": "3.*"

Then install via:

composer install

To use the bindings, use Composer's autoload:


Manual Installation

If you do not wish to use Composer, you can download the latest release. Then, to use the bindings, include the init.php file.


Getting Started

Simple usage looks like:

$myCard = array('number' => '4242424242424242', 'exp_month' => 8, 'exp_year' => 2018);
$charge = \Stripe\Charge::create(array('card' => $myCard, 'amount' => 2000, 'currency' => 'usd'));
echo $charge;


Please see for up-to-date documentation.

Legacy Version Support

If you are using PHP 5.2, you can download v1.18.0 (zip, tar.gz) from our releases page. This version will continue to work with new versions of the Stripe API for all common uses.

This legacy version may be included via require_once("/path/to/stripe-php/lib/Stripe.php");, and used like:

$myCard = array('number' => '4242424242424242', 'exp_month' => 8, 'exp_year' => 2018);
$charge = Stripe_Charge::create(array('card' => $myCard, 'amount' => 2000, 'currency' => 'usd'));
echo $charge;


In order to run tests first install PHPUnit via Composer:

composer update --dev

To run the test suite: