Skip to content

shapintv/stripe

Repository files navigation

Stripe PHP SDK

Latest Version Build Status Code Coverage Quality Score Total Downloads

Install

Via Composer

$ composer require shapintv/stripe

Usage

use Shapin\Stripe\StripeClient;
use Symfony\Component\HttpClient\HttpClient;

$httpClient = HttpClient::create([
    'base_uri' => 'http://127.0.0.1:12111/v1/',
    'auth_bearer' => 'api_key',
    'headers' => [
        'Content-Type' => 'application/json',
    ],
]);

$stripeClient = new StripeClient($httpClient);

$subscription = $apiClient->subscriptions()->get('sub_myid');
echo $subscription->isActive(); // true
echo $subscription->getCreatedAt()->getTimestamp(); // 1234567890

Contributing

In order to test locally, you need to have stripe-mock installed.

To install the correct version, use make install.

You can start the Stripe mock server with make start and stop it with make stop.

License

The MIT License (MIT). Please see License File for more information.