1. Go to this page and download the library: Download asciisd/kyc-shuftipro library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
asciisd / kyc-shuftipro example snippets
use Asciisd\KycCore\Facades\Kyc;
use Asciisd\KycCore\DTOs\KycVerificationRequest;
// Create a simple verification
$response = Kyc::createSimpleVerification($user, [
'country' => 'US',
'language' => 'en'
]);
// Create a full verification request
$request = new KycVerificationRequest(
email: '[email protected]',
country: 'US',
language: 'en',
journeyId: 'your_journey_id'
);
$response = Kyc::createVerification($user, $request);
// Use a specific journey ID
$request = new KycVerificationRequest(
email: '[email protected]',
journeyId: 'your_custom_journey_id',
allowedCountries: ['US', 'CA', 'GB'],
deniedCountries: ['IR', 'KP']
);
$response = Kyc::createVerification($user, $request);
POST /api/kyc/webhook // ✅ Use this URL in ShuftiPro dashboard
POST /api/kyc/webhook/callback // ✅ Alternative webhook endpoint
GET /api/kyc/verification/complete // ✅ Verification completion callback
// Optional: Custom webhook processing
$response = Kyc::processWebhook($request->all(), $request->headers->all());
if ($response->isSuccessful()) {
// Custom logic after successful verification
}
// Download documents for a user
$documents = Kyc::downloadDocuments($user, $reference);
// The documents are automatically stored in your configured storage disk
use Asciisd\KycCore\Events\VerificationStarted;
use Asciisd\KycCore\Events\VerificationCompleted;
use Asciisd\KycCore\Events\VerificationFailed;
Event::listen(VerificationCompleted::class, function ($event) {
// Handle successful verification
Log::info('ShuftiPro verification completed for user: ' . $event->user->id);
});