vivebamba / bamba-sdk-php
Bamba API 的 SDK
1.3.3
2021-11-03 22:44 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
README
Bamba API 的 SDK
安装与使用
要求
PHP 7.2 及以上版本。
Composer
要通过 Composer 安装绑定,请在 composer.json
中添加以下内容
{ "repositories": [ { "type": "vcs", "url": "https://github.com/vivebamba/bamba-sdk-php.git" } ], "require": { "vivebamba/bamba-sdk-php": "*@dev" } }
然后运行 composer install
手动安装
下载文件并包含 autoload.php
<?php require_once('/path/to/bamba-sdk-php/vendor/autoload.php');
入门指南
请按照 安装过程 进行操作,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: ApiKeyAuth $config = Bamba\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = Bamba\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer'); $apiInstance = new Bamba\Api\BambaAdvisorApi( // 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 ); $advisorMessageRequest = new \Bamba\Model\AdvisorMessageRequest(); // \Bamba\Model\AdvisorMessageRequest try { $result = $apiInstance->advisorMessagePost($advisorMessageRequest); print_r($result); } catch (Exception $e) { echo 'Exception when calling BambaAdvisorApi->advisorMessagePost: ', $e->getMessage(), PHP_EOL; }
API 端点
所有 URI 都相对于 https://sandbox.vivebamba.com/v1
模型
- AdvisorMessageRequest
- AdvisorUser
- CancellationResponse
- Customer
- ErrorResponse
- InlineResponse200
- InlineResponse2001
- InlineResponse422
- InlineResponse4221
- InlineResponse422Errors
- Message
- Order
- OrderProducts
- PaymentParams
- Product
- ProductDescription
授权
ApiKeyAuth
- 类型: API 密钥
- API 密钥参数名: x-api-key
- 位置: HTTP 头部
测试
要运行测试,使用
composer install vendor/bin/phpunit
作者
关于此包
此 PHP 包是由 OpenAPI Generator 项目自动生成的
- API 版本:
1.3.3
- 包版本:
1.3.3
- 包版本:
- 构建包:
org.openapitools.codegen.languages.PhpClientCodegen