poool / subscribe-sdk
Poool Subscribe SDK for PHP 🚀
2.0.1
2023-10-17 08:48 UTC
Requires
- php: >=8.1.0
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- phpunit/phpunit: 9.6.11
- squizlabs/php_codesniffer: 3.7.1
This package is not auto-updated.
Last update: 2024-10-01 13:21:42 UTC
README
Poool Subscribe SDK for PHP 🚀
安装
composer require poool/subscribe-sdk
用法
use Poool\Subscribe\SDK\Client; $client = new Client([ 'clientId' => 'yourClientId', 'clientSecret' => 'yourClientSecret', ]); var_dump($client->offers->list());
文档
https://poool.dev/docs/subscribe/server
沙盒模式
您可以使用沙盒模式来测试您的集成而无需进行任何实际付款。通过将 sandbox: true
请求选项(最后一个参数)传递给 SDK 的任何方法来使用它
$client->offers->list(1, 10, [], [], 'active', ['sandbox' => true]);
迁移
v1 到 v2
- 现在需要 php >= 8.1
customers.switchSubscriptionOffer(customerId, subscriptionId, offer, requestOptions)
变更为customers.switchSubscriptionOffer(customerId, subscriptionId, offer, **{ priceId }**, requestOptions)
-> 现在在请求选项之前需要额外的参数来指定如价格 ID 之类的出价选项sandbox: true|false
现在是每个请求的选项(而不仅仅是出价列表),并且已从offers.list()
中删除offers.list(page, count, status, include, exclude)
变更为offers.list(page, count, include, exclude, **status**, requestOptions)
-> 它已移动到参数列表的末尾,以与其他 SDK 保持一致。
贡献
请查看CONTRIBUTING.md 文档以获取贡献指南。
开发
安装依赖
composer install
使用 PHP 内置服务器在 https://:62000/ 上运行示例
composer serve
并测试您的代码
composer test
许可
本软件根据MIT 许可。