homeful / kwyc-check
Homeful KwYC Check 包
v1.4.9
2024-09-11 08:30 UTC
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
这里应该放置您的描述。请限制为一段或两段。考虑添加一个小示例。
安装
您可以通过composer安装此包
composer require homeful/kwyc-check
您可以使用以下命令发布和运行迁移
php artisan vendor:publish --tag="kwyc-check-migrations"
php artisan migrate
您可以使用以下命令发布配置文件
php artisan vendor:publish --tag="kwyc-check-config"
这是已发布配置文件的内容
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' = "" ENV Setup
存在API端点。
- process-lead的负载是来自kwyc-check通过pipedream的webhook post
- attach-media的负载是指向图像的URL数组
- generate-qr的负载是具有默认值的输入数组
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');
要从线索中获取数据
use Homeful\KwYCCheck\Data\LeadData; use Homeful\KwYCCheck\Models\Lead; $lead = Lead::factory()->forContact()->create(); $data = LeadData::fromModel($lead);
可选地,您可以使用以下命令发布视图
php artisan vendor:publish --tag="kwyc-check-views"
用法
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 }];
测试
composer test
变更日志
有关最近更改的更多信息,请参阅变更日志。
贡献
有关详细信息,请参阅贡献指南。
安全漏洞
请审查我们的安全策略,了解如何报告安全漏洞。
致谢
许可证
MIT许可证(MIT)。有关更多信息,请参阅许可证文件。