Download the PHP package reksakarya/laravel-signature without Composer
On this page you can find all versions of the php package reksakarya/laravel-signature. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-signature
Laravel Signature
Introduction
Laravel Signature will help you to secure data by identifying who is accessing your end-point with signature
Requirements
At this time, Laravel Signature only support:
- Laravel ^7.x.
- PHP ^7.3.0
Installation
-
run
composer require reksakarya/laravel-signature
. -
add autoload to
composer.json
-
run command
-
add provider to `config/app.php
-
To publish signature config into application, run:
-
next, we need to setup environtment variable on your
.env
: - dont forget to run
php artisan config:cache
to save your config change on cache
then, the installation proccess was complete
How to use
by default, Reksa Karya Laravel Signature create signature for existing application E-PNBP Telekomunikasi, E-PNBP POS, Kerjasama Badan Usaha, Management Kas, and Pendapatan Lain Lain
To create signature, call Signature on your class and you can call static method Signature::make(string $url, array $credential)
or you can specific on your apps :
Note!
$credential
variable should be array with value like this:
if you want to validate that the signature, you can call method Signature::validate($request, $app);
where param $app
is string of 'epnbp' or 'kerjasamabu' or 'jasaperbankan' or 'pendapatanlainlain'. here the example :
Implementation on Postman
if you want to test signature by postman, first setup Postman Pre-request Script to test api with signature.
first add this variable to environtment :
VARIABLE |
VALUE |
---|---|
SIGNATURE_EPNBP_ID | YOUR_EPNBP_ID |
SIGNATURE_EPNBP_KEY | YOUR_EPNBP_KEY |
SIGNATURE_EPNBP_SECRET | YOUR_EPNBP_SECRET |
SIGNATURE_KERJASAMABU_ID | YOUR_KERJASAMABU_ID |
SIGNATURE_KERJASAMABU_KEY | YOUR_KERJASAMABU_KEY |
SIGNATURE_KERJASAMABU_SECRET | YOUR_KERJASAMABU_SECRET |
SIGNATURE_JASAPERBANKAN_ID | YOUR_JASAPERBANKAN_ID |
SIGNATURE_JASAPERBANKAN_KEY | YOUR_JASAPERBANKAN_KEY |
SIGNATURE_JASAPERBANKAN_SECRET | YOUR_JASAPERBANKAN_SECRET |
SIGNATURE_PENDAPTAANLAINLAIN_ID | YOUR_JASAPERBANKAN_ID |
SIGNATURE_PENDAPATANLAINLAIN_KEY | YOUR_JASAPERBANKAN_KEY |
SIGNATURE_PENDAPATANLAINLAIN_SECRET | YOUR_JASAPERBANKAN_SECRET |
signature_payload | YOUR_JASAPERBANKAN_SECRET |
signature | YOUR_JASAPERBANKAN_SECRET |
next, add this script to every request to Pre-request Script
to generate signature before sending request :
don't forget to add signature
key on your header request like this :
KEY |
VALUE |
---|---|
signature | {{signature}} |