tripartie / webapi-phpclient
该包已被废弃且不再维护。未建议替代包。
Tripartie Web API 允许您轻松创建交易模板。
1.0.3
2021-10-13 13:34 UTC
Requires
- php: >=7.2
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.12
- phpunit/phpunit: ^8.0 || ^9.0
This package is auto-updated.
Last update: 2023-01-13 16:27:29 UTC
README
本文档描述了 Tripartie Web API 所提供的所有用例。
Tripartie Web API 允许您轻松创建交易模板。交易模板允许用户(买方)安全地启动由另一个用户(卖方)预先配置的交易。
这允许您在网站页面上添加安全支付按钮。
安装 & 使用
要求
PHP 7.2 及更高版本。
安装
composer require tripartie/webapi-phpclient
入门
请按照 安装程序 进行操作,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); use TripartieWebAPI\Configuration; use TripartieWebAPI\TransactionTemplatesApi; // Configure API key authorization: ClientIdAuth $config = Configuration::getDefaultConfiguration()->setApiKey('client-id', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = TripartieWebAPI\Configuration::getDefaultConfiguration()->setApiKeyPrefix('client-id', 'Bearer'); $apiInstance = new TransactionTemplatesApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); $externalId = 'template-87'; // string | The Transaction template's External ID. try { $result = $apiInstance->fetch($externalId); print_r($result); } catch (Exception $e) { echo 'Exception when calling TransactionTemplatesApi->fetch: ', $e->getMessage(), PHP_EOL; }
API 端点
所有 URI 都相对于 https://platform.preprod.tripartie.com
类 | 方法 | HTTP 请求 | 描述 |
---|---|---|---|
TransactionTemplatesApi | fetch | GET /api/web/transaction-templates/ | 获取 |
TransactionTemplatesApi | create | POST /api/web/transaction-templates/ | 创建 |
UsersApi | unregister | DELETE /api/web/users/ | 注销 |
UsersApi | fetch | GET /api/web/users/ | 获取 |
UsersApi | register | POST /api/web/users/ | 注册 |
WebhooksApi | validate | GET /api/web/webhooks/ | 验证 |
模型
- Error
- ModelTransactionTemplate
- ModelUser
- RequestCreateTransactionTemplate
- RequestCreateTransactionTemplatePackageFormat
- RequestRegisterUser
- Webhook
授权
ClientIdAuth
- 类型: API 密钥
- API 密钥参数名: client-id
- 位置: URL 查询字符串
测试
要运行测试,请使用
composer install vendor/bin/phpunit
作者
关于此包
此 PHP 包由 OpenAPI Generator 项目自动生成
- API 版本:
1.0
- 包版本:
1.0.0
- 包版本:
- 构建包:
org.openapitools.codegen.languages.PhpClientCodegen