shapin / stripe
PHP client for Stripe API
Installs: 2 056
Dependents: 2
Suggesters: 2
Security: 0
Stars: 4
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/shapin/stripe
Requires
- php: ^7.2
- moneyphp/money: ^3.1
- symfony/config: ^4.3 || ^5.0
- symfony/http-client: ^4.3 || ^5.0
- symfony/http-foundation: ^4.3 || ^5.0
Requires (Dev)
- phpunit/phpunit: ^8.5
- symfony/phpunit-bridge: ^4.4 || ^5.0
This package is auto-updated.
Last update: 2023-12-27 11:25:23 UTC
README
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.