homeful/kwyc-check 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

homeful/kwyc-check

最新稳定版本:v1.5.6

Composer 安装命令:

composer require homeful/kwyc-check

包简介

Homeful KwYC Check Package

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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.

统计信息

  • 总下载量: 2.63k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-08-20