Skip to content

marcusds/stripe-php

Repository files navigation

Stripe PHP bindings

<img src=“https://travis-ci.org/stripe/stripe-php.svg?branch=master” alt=“Build Status” /> <img src=“https://poser.pugx.org/stripe/stripe-php/v/stable.svg” alt=“Latest Stable Version” /> <img src=“https://poser.pugx.org/stripe/stripe-php/downloads.svg” alt=“Total Downloads” /> <img src=“https://poser.pugx.org/stripe/stripe-php/license.svg” alt=“License” /> <img src=“https://coveralls.io/repos/stripe/stripe-php/badge.png?branch=experimental-v2” alt=“Code Coverage” />

You can sign up for a Stripe account at stripe.com.

Requirements

PHP 5.3.3 and later.

Composer

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

{
  "require": {
    "stripe/stripe-php": "2.*"
  }
}

Then install via:

composer.phar install

To use the bindings, use Composer’s (autoload):

require_once('vendor/autoload.php');

Getting Started

Simple usage looks like:

/Stripe::setApiKey('d8e8fca2dc0f896fd7cb4cb0031ba249');
$myCard = array('number' => '4242424242424242', 'exp_month' => 5, 'exp_year' => 2015);
$charge = /Stripe/Charge::create(array('card' => $myCard, 'amount' => 2000, 'currency' => 'usd'));
echo $charge;

Documentation

Please see stripe.com/docs/api for up-to-date documentation.

Tests

In order to run tests first install PHPUnit via Composer:

composer.phar update --dev

To run the test suite:

./vendor/bin/phpunit

About

Stripe PHP bindings

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 99.6%
  • XML 0.4%