homeful / kwyc-check
Homeful KwYC Check Package
Fund package maintenance!
Homeful
Requires
- php: ^8.2
- bacon/bacon-qr-code: ^3.0
- illuminate/contracts: ^10.0||^11.0
- jn-devops/contacts: ^1.3
- lorisleiva/laravel-actions: ^2.8
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- khanamiryan/qrcode-detector-decoder: ^2.0
- larastan/larastan: ^2.9
- laravel/pint: ^1.14
- meyfa/php-svg: ^0.16.0
- 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
README
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
Installation
You can install the package via composer:
composer require homeful/kwyc-check
You can publish and run the migrations with:
php artisan vendor:publish --tag="kwyc-check-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="kwyc-check-config"
This is the contents of the published config file:
return [ 'campaign_url' => env('CAMPAIGN_URL', 'https://kwyc-check.net/campaign-checkin/9ccef822-4209-4e0a-bb40-232da5cafdf1') ];
ENV Setup
'HYPERVERGE_APP_BASEURL' = ""
'HYPERVERGE_APP_ID' = ""
'HYPERVERGE_APP_KEY' = ""
'HYPERVERGE_DEFAULT_FILESTORE' = ""
'ENGAGESPARK_APIKEY' = ""
'ENGAGESPARK_ORG_ID' = ""
ENV Setup
There are api end points.
- the payload for process-lead is webhook post from kwyc-check via pipedream
- the payload for attach-media is an array of urls point to images
- the payload for generate-qr is an array of inputs with default values
Route::post('process-lead', ProcessLeadController::class) ->prefix('api') ->middleware('api') ->name('process-lead'); Route::post('attach-media/{lead}', AttachLeadMediaController::class) ->prefix('api') ->middleware('api') ->name('attach-media'); Route::post('generate-qr', GenerateQRCodeController::class) ->prefix('api') ->middleware('api') ->name('generate-qr'); Route::post('validate/id', [HypervergeController::class, 'validate_id']) ->prefix('api') ->middleware('api') ->name('id validation'); Route::post('validate/id/base64', [HypervergeController::class, 'validate_id']) ->prefix('api') ->middleware('api') ->name('id validation'); Route::post('check/liveliness', [HypervergeController::class, 'validate_live_url']) ->prefix('api') ->middleware('api') ->name('liveliness validation'); Route::post('check/liveliness/base64', [HypervergeController::class, 'validate_live_base64']) ->prefix('api') ->middleware('api') ->name('liveliness validation'); Route::post('check/faceverify', [HypervergeController::class, 'face_verify']) ->prefix('api') ->middleware('api') ->name('face match verification'); Route::post('check/faceverify/base64', [HypervergeController::class, 'face_verify_base64']) ->prefix('api') ->middleware('api') ->name('face match verification'); Route::post('create/contact', [EngageSparkController::class, 'formatContactBody']) ->prefix('api') ->middleware('api') ->name('face verification');
To get the data from lead
use Homeful\KwYCCheck\Data\LeadData; use Homeful\KwYCCheck\Models\Lead; $lead = Lead::factory()->forContact()->create(); $data = LeadData::fromModel($lead);
Optionally, you can publish the views using
php artisan vendor:publish --tag="kwyc-check-views"
Usage
use Homeful\KwYCCheck\Facades\KYC; $svg = KYC::generateCampaignQRCOde(query_params: ['code' => 'ABC-123','identifier'=>'DEF-456','choice'=>'GHI-789']); echo $svg; //qr code points to https://kwyc-check.net/campaign-checkin/9ccef822-4209-4e0a-bb40-232da5cafdf1?code=ABC-111&identifier=DEF-222&choice=GHI-333 ```validate/id``` $jsonInput =[{ "imageURL" : "", //should be inside storage folder -- ex. app/public "referenceCode":"", //alpha-numeric "countryId":"",//country code check documentation link for list https://documentation.hyperverge.co/OCR_country_docs_list "documentId":""//id type check documentation link for list https://documentation.hyperverge.co/OCR_country_docs_list }]; ```or``` $jsonInput =[{ "base64Img" : "", //base64 image "referenceCode":"", //alpha-numeric "countryId":"",//country code check documentation link for list https://documentation.hyperverge.co/OCR_country_docs_list "documentId":""//id type check documentation link for list https://documentation.hyperverge.co/OCR_country_docs_list }]; ```check/liveliness``` $jsonInput =[{ "imageURL":"",//should be inside storage folder -- ex. app/public "referenceCode":"",//alpha-numeric }]; ```check/faceverify``` $jsonInput =[{ "imageURL":"",//should be inside storage folder -- ex. app/public "referenceCode":"",//alpha-numeric "imagePath":"",//path inside storage -- ex. app/public "type":"" //selfie or id }]; ```or``` $jsonInput =[{ "base64Img":"",//base64 image "referenceCode":"",//alpha-numeric "imagePath":"",//path inside storage -- ex. app/public "type":"" //selfie or id }]; ```Engagespark``` use Homeful\KwYCCheck\Http\Controllers\EngageSparkController; ```create contact``` $jsonInput = [{ "mobile": "", //number "firstName": "", //alpha-numeric "lastName": "",//alpha-numeric "groupId": [] ////alpha-numeric array }] EngageSparkController::saveContact($jsonInput);
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.