shapin / stripe
此包已被弃用且不再维护。没有建议的替代包。
Stripe API 的 PHP 客户端
dev-master
2019-12-07 19:20 UTC
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
安装
通过 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
贡献
为了本地测试,您需要安装stripe-mock。
使用 make install
安装正确的版本。
您可以使用 make start
启动 Stripe 模拟服务器,并使用 make stop
停止。
许可证
MIT 许可证(MIT)。有关更多信息,请参阅许可证文件。