wpify / benefit-plus-gateway-sdk
这是Benefit Plus电子商务支付网关3的"swagger"定义的API。您可以从您的电子商务网站利用此API集成通过员工福利计划资金进行支付。此版本的计划使用移动支付应用Benefit Plus Pay。
Requires
- php: ^7.4 || ^8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- phpunit/phpunit: ^8.0 || ^9.0
This package is not auto-updated.
Last update: 2024-09-27 16:11:13 UTC
README
这是Benefit Plus电子商务支付网关3的"swagger"定义的API。您可以从您的电子商务网站利用此API集成通过员工福利计划资金进行支付。此版本的计划使用移动支付应用Benefit Plus Pay。 <br/><br/>RFC版本 - 这是一个供Benefit Plus合作商家审查和集成规划的概念性文件。
请求签名
除/auth/token
之外的所有请求必须由"SHA-256 with RSA"(RSASSA-PKCS1-v1_5,RFC 8017第8.2节)电子签名进行签名。有关详细信息,请参阅在线网关文档。
如需更多信息,请访问 https://profirmy.benefit-plus.cz/podpora/。
安装 & 使用
要求
PHP 7.4及以后版本。也应与PHP 8.0兼容。
Composer
要通过Composer安装绑定,请将以下内容添加到composer.json
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/wpify/benefit-plus-gateway-sdk.git"
}
],
"require": {
"wpify/benefit-plus-gateway-sdk": "*@dev"
}
}
然后运行composer install
手动安装
下载文件并包含autoload.php
<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
入门
请按照安装程序进行操作,然后运行以下命令
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: bearerAuth
$config = BenefitPlusGatewaySdk\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new BenefitPlusGatewaySdk\Api\LandingPageApi(
// 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
);
try {
$result = $apiInstance->getLandingPage();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LandingPageApi->getLandingPage: ', $e->getMessage(), PHP_EOL;
}
API端点
所有URI均相对于https://pay.benefit-plus.cz
类 | 方法 | HTTP请求 | 描述 |
---|---|---|---|
LandingPageApi | getLandingPage | GET / | |
MerchantEShopAuthenticationApi | authenticate | POST /v1/auth/token | authenticate() |
MerchantPaymentApi | cancelPayment | PUT /v1/payments/{paymentId}/cancel | cancelPayment() |
MerchantPaymentApi | getPaymentState | GET /v1/payments/{paymentId}/state | getPaymentState() |
MerchantPaymentApi | initPayment | POST /v1/payments/init | initPayment() |
模型
- AuthenticationRequest
- AuthenticationResponse
- BadRequestErrorResponse
- Currency
- ErrorResponse
- InitPaymentRequest
- InitPaymentResponse
- PaymentStateResponse
授权
为API定义的认证方案
basicAuth
- 类型: HTTP基本认证
bearerAuth
- 类型: Bearer认证(JWT)
测试
要运行测试,请使用
composer install
vendor/bin/phpunit
作者
partneri@benefit-plus.cz
关于此包
此PHP包是由OpenAPI Generator项目自动生成的
- API版本:
1.0.RFC8
- 构建包:
org.openapitools.codegen.languages.PhpClientCodegen