ahmadrivaldi-arv / mekarisign
PHP library for www.mekarisign.com
Fund package maintenance!
Ahmdrv
Requires
- php: ^8.2
- illuminate/contracts: ^10.0||^11.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.9
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^2.34
- pestphp/pest-plugin-arch: ^2.7
- pestphp/pest-plugin-laravel: ^2.3
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
- spatie/laravel-ray: ^1.35
This package is auto-updated.
Last update: 2025-02-17 13:00:57 UTC
README
Installation
You can install the package via composer:
composer require ahmadrivaldi-arv/mekarisign
You can publish the config file with:
php artisan vendor:publish --tag="mekarisign-config"
This is the contents of the published config file:
return [ /** * The base URL for the MekariSign API. * * This configuration option sets the base URL for the MekariSign API. * It uses the `env` function to retrieve the value from the environment * variable `MEKARISIGN_BASE_URL`. If the environment variable is not set, * it defaults to 'https://sandbox-api.mekari.com/v2/esign/v1'. * */ 'base_url' => env('MEKARISIGN_BASE_URL', 'https://sandbox-api.mekari.com/v2/esign/v1'), /** * Configuration file for MekariSign integration. * * This file contains the configuration settings for the MekariSign service. * * The client ID for the MekariSign service, retrieved from the environment variable 'MEKARISIGN_CLIENT_ID'. */ 'client_id' => env('MEKARISIGN_CLIENT_ID'), /** * The client secret for the MekariSign API. * * This value is retrieved from the environment configuration using the key 'MEKARISIGN_CLIENT_SECRET'. * Ensure that the environment variable is set correctly in your .env file. */ 'client_secret' => env('MEKARISIGN_CLIENT_SECRET'), /** * The client secret for the MekariSign service. * * This value is retrieved from the environment variable 'MEKARISIGN_CLIENT_SECRET'. * It is used to authenticate requests to the MekariSign API. * */ 'template_id' => env('MEKARISIGN_TEMPLATE_ID'), /** * Configuration for MekariSign signer name. * * This value is retrieved from the environment variable 'MEKARISIGN_SIGNER_NAME'. * It is used to specify the name of the signer in the MekariSign service. * */ 'signer_name' => env('MEKARISIGN_SIGNER_NAME'), /** * The email address of the signer. * * This configuration option retrieves the signer's email address from the environment * variable 'MEKARISIGN_SIGNER_EMAIL'. It is used to identify the signer in the MekariSign * service. * */ 'signer_email' => env('MEKARISIGN_SIGNER_EMAIL'), /** * The callback URL for MekariSign. * * This URL is used by MekariSign to send callback requests to your application. * The value is retrieved from the environment variable 'MEKARISIGN_CALLBACK_URL'. * */ 'callback_url' => env('MEKARISIGN_CALLBACK_URL') ];
Usage
see Mekari Sign Documentation for the payloads
use Ahmdrv\MekariSign\Facades\MekariSign; use Ahmdrv\MekariSign\Services\DocumentRequest; use Ahmdrv\MekariSign\Services\Signer; use Ahmdrv\MekariSign\Services\Annotation; $annotation = Annotation::make() ->setPage(1) ->setPosition(61, 442) ->setElementSize(160, 52) ->setCanvasSize(768, 542); $signer = Signer::make('Name of the Signer') ->setEmail('signer@example.com') ->setAnnotation($annotation); $request = DocumentRequest::make($filename) ->setContent($content) ->setTemplate($templateId) ->addSigner($signer) ->toArray(); $response = MekariSign::requestPsreSign($request); // get document id from response $docId = $response->getDocumentId();
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.