PHP code example of hraph / paygreen-api-php

1. Go to this page and download the library: Download hraph/paygreen-api-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hraph / paygreen-api-php example snippets


    


piInstance = 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;
}