wpify/benefit-plus-gateway-sdk

这是Benefit Plus电子商务支付网关3的"swagger"定义的API。您可以从您的电子商务网站利用此API集成通过员工福利计划资金进行支付。此版本的计划使用移动支付应用Benefit Plus Pay。

dev-master 2024-08-30 15:54 UTC

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请求描述
LandingPageApigetLandingPageGET /
MerchantEShopAuthenticationApiauthenticatePOST /v1/auth/tokenauthenticate()
MerchantPaymentApicancelPaymentPUT /v1/payments/{paymentId}/cancelcancelPayment()
MerchantPaymentApigetPaymentStateGET /v1/payments/{paymentId}/stategetPaymentState()
MerchantPaymentApiinitPaymentPOST /v1/payments/initinitPayment()

模型

授权

为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