Via Composer
$ composer require shapintv/stripe
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
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
.
The MIT License (MIT). Please see License File for more information.