subster/php-sdk
最新稳定版本:v0.0.3
Composer 安装命令:
composer require subster/php-sdk
包简介
Unofficial PHP SDK for Subster
README 文档
README
Work in progress. Not ready for production yet!
Requirements
- PHP 8.1 or later.
Installation
Install via composer:
composer require subster/php-sdk
Usage
Create a checkout session
use Subster\PhpSdk\SubsterConnector; use Subster\PhpSdk\DataObjects\CreateCheckoutSessionData; $subster = new SubsterConnector('your-api-key'); $session = $subster->checkoutSessions()->create( CreateCheckoutSessionData::from([ 'customer' => 'customer-id', 'items' => [ [ 'plan' => 'your-plan-id', ], ], 'success_url' => 'https://example.ru/success', 'cancel_url' => 'https://example.ru/cancel', ]) );
Create a billing portal session
use Subster\PhpSdk\SubsterConnector; use Subster\PhpSdk\DataObjects\CreateBillingPortalSessionData; $subster = new SubsterConnector('your-api-key'); $session = $subster->billingPortalSessions()->create( CreateBillingPortalSessionData::from([ 'customer' => 'customer-id', 'return_url' => 'https://example.ru/billing', ]) );
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-26