shapintv / stripe

A Stripe PHP SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

A Stripe PHP SDK

License:MIT License


Languages

Language:PHP 99.7%Language:Makefile 0.3%