hraph/paygreen-api-php

PHP SQK 用于 Paygreen.io 支付提供商

1.1.1 2021-11-12 15:44 UTC

This package is auto-updated.

Last update: 2024-09-12 22:24:58 UTC


README

使用 OpenAPI 生成器生成的 Paygreen.io 支付提供商的 PHP SDK

Paygreen.io API 的规范可在 此处 获取

需求

PHP 7.1 及以上版本

安装与使用

Composer

通过 Composer 安装

运行 composer require hraph/paygreen-api-php

手动安装

下载文件并包含 autoload.php

    require_once('/path/to/paygreen-api-php/vendor/autoload.php');

测试

运行单元测试

composer install
./vendor/bin/phpunit

入门

请按照 安装说明 进行操作,然后运行以下命令

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new Hraph\PaygreenApi\Api\AuthentificationOAuthApi(
    // 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()
);
$client_id = 'client_id_example'; // string | Variable OAuth contenant `accessPublic`. Exemple&nbsp;: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
$grant_type = 'grant_type_example'; // string | Variable OAuth contenant la valeur du \"grant type\" OAuth (valeur: authorization_code)
$code = 'code_example'; // string | Variable OAuth contenant le code generate après l'appel authorize OAuth

try {
    $result = $apiInstance->apiAuthAccessTokenPost($client_id, $grant_type, $code);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthentificationOAuthApi->apiAuthAccessTokenPost: ', $e->getMessage(), PHP_EOL;
}

?>

API 端点文档

所有 URI 都相对于 https://paygreen.fr

模型文档