timothecrespy/yousign-api-php-client

A PHP client library for accessing Yousign REST APIs (https://yousign.com/en-uk/api)

1.3.1 2020-03-03 16:54 UTC

This package is auto-updated.

Last update: 2024-03-29 03:51:41 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Yousign REST API Client.

PRs are of course highly appreciated, as well as improvement suggestions!

Structure

src/
tests/

Install

Via Composer

$ composer require timothecrespy/yousign-api-php-client

Usage

Note

For testing, and obviously for production, an internet connexion is required.

Framework agnostic

use TimotheCrespy\YousignClient;

// It is recommended to store these values in a .env or equivalent file
const YOUSIGN_PRODUCTION_API_URL = 'https://api.yousign.com';
const YOUR_PRODUCTION_API_KEY = '[YOUR_PRODUCTION_API_KEY]';

$yousignClient = new YousignClient([
    'api_url' => self::YOUSIGN_PRODUCTION_API_URL,
    'api_key' => self::YOUR_PRODUCTION_API_KEY
]);

As the Yousign production API is not free, you might want to test it, with the staging environment:

use TimotheCrespy\YousignClient;

// It is recommended to store these values in a .env or equivalent file
const YOUSIGN_STAGING_API_URL = 'https://staging-api.yousign.com';
const YOUR_STAGING_API_KEY = '[YOUR_STAGING_API_KEY]';

$yousignClient = new YousignClient([
    'api_url' => self::YOUSIGN_STAGING_API_URL,
    'api_key' => self::YOUR_STAGING_API_KEY
]);

Laravel

Requirement : version 6.* minimum

// If you are using Laravel (https://github.com/laravel/laravel), you could specify the default Laravel logger:
$loggerInstance = Illuminate\Support\Facades\Log::getLogger();
$yousignClient->setLogger($loggerInstance);

$yousignClient->getUsers();

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

All this package is based on the notion that the Yousign's staging environment is strictly similar to the production environment. Hence the tests based on this staging environment. Therefore, the API is not stubbed, as this staging environment is free and without any restriction.

Testing for a PR is however done this way:

$ composer test

or

$ ./vendor/bin/phpcs
$ ./vendor/bin/phpunit

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email contact@timothecrespy.fr instead of using the issue tracker.

Credits

Special thanks

License

The MIT License (MIT). Please see License File for more information.