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-06-11 12:02:00 UTC
README
Poool Subscribe SDK for PHP 🚀
Installation
composer require poool/subscribe-sdk
Usage
use Poool\Subscribe\SDK\Client; $client = new Client([ 'clientId' => 'yourClientId', 'clientSecret' => 'yourClientSecret', ]); var_dump($client->offers->list());
Documentation
https://poool.dev/docs/subscribe/server
Sandbox mode
You can use the sandbox mode to test your integration without any real payment.
Pass the sandbox: true
request option (last parameter) to any method of the SDK to use it:
$client->offers->list(1, 10, [], [], 'active', ['sandbox' => true]);
Migrations
v1 to v2
- Now requires php >= 8.1
customers.switchSubscriptionOffer(customerId, subscriptionId, offer, requestOptions)
becomescustomers.switchSubscriptionOffer(customerId, subscriptionId, offer, **{ priceId }**, requestOptions)
-> it now takes an additional parameter before request options to speficy offer options like price idsandbox: true|false
is now an option on every request (instead of only offers list) and has been removed fromoffers.list()
offers.list(page, count, status, include, exclude)
becomesoffers.list(page, count, include, exclude, **status**, requestOptions)
-> it is moved to the end of the parameters list to be consistent with other SDKs.
Contributing
Please check the CONTRIBUTING.md doc for contribution guidelines.
Development
Install dependencies:
composer install
Run examples at http://localhost:62000/ with php built-in server:
composer serve
And test your code:
composer test
License
This software is licensed under MIT.