PHPackages                             asciisd/kyc-shuftipro - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. asciisd/kyc-shuftipro

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

asciisd/kyc-shuftipro
=====================

ShuftiPro driver for KYC (Know Your Customer) verification

1.8.0(1mo ago)1434↓33.3%MITPHPPHP ^8.3

Since Sep 14Pushed 1mo agoCompare

[ Source](https://github.com/asciisd/kyc-shuftipro)[ Packagist](https://packagist.org/packages/asciisd/kyc-shuftipro)[ RSS](/packages/asciisd-kyc-shuftipro/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (10)Versions (14)Used By (0)

Asciisd KYC ShuftiPro Driver
============================

[](#asciisd-kyc-shuftipro-driver)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a79f50d3605e2bbdab28cb0ba12ca139bd7e452ee21fa0d22224ab89e7ac8bbd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617363696973642f6b79632d73687566746970726f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/asciisd/kyc-shuftipro)[![Total Downloads](https://camo.githubusercontent.com/e4567f4c7c84b0eee751d43e5d8868c209ac90fe86438d4e2656e0b908819ee0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617363696973642f6b79632d73687566746970726f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/asciisd/kyc-shuftipro)[![License](https://camo.githubusercontent.com/94dd4798fb96c39837ac595bf082476401ec968724e2c3eb1ff981b641689c31/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f617363696973642f6b79632d73687566746970726f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/asciisd/kyc-shuftipro)[![PHP Version](https://camo.githubusercontent.com/45445aae139c88cd9869cf39f49b77c9e0b9323d8df8b3d5eaff30d168071407/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f617363696973642f6b79632d73687566746970726f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/asciisd/kyc-shuftipro)

A Laravel package that provides **ShuftiPro integration** for the Asciisd KYC Core package. Features **automatic webhook handling**, **provider-specific status mapping**, and **zero-config infrastructure routes**.

Package Information
-------------------

[](#package-information)

- **Package**: [asciisd/kyc-shuftipro](https://packagist.org/packages/asciisd/kyc-shuftipro)
- **Latest Version**: v1.0.0
- **PHP Requirements**: ^8.2
- **Laravel Requirements**: ^12.0
- **License**: MIT

✨ Features
----------

[](#-features)

- **🚀 Zero-Config Setup**: Automatic webhook routes - no manual configuration needed!
- **🎯 Smart Status Mapping**: ShuftiPro-specific event mapping to standardized KYC statuses
- **🔄 Complete Integration**: Full API integration with ShuftiPro services
- **🛣️ Journey Support**: Support for both IDV journeys and direct API verification
- **📁 Document Management**: Automatic document download and storage
- **🔒 Secure Webhooks**: Signature validation and comprehensive logging
- **🖼️ Image Processing**: Support for document images, selfies, and verification videos
- **🔍 Duplicate Detection**: Built-in duplicate account detection
- **📊 Comprehensive Logging**: Detailed logging for debugging and monitoring
- **⚡ Auto-Infrastructure**: Webhook endpoints automatically registered by KYC Core

Installation
------------

[](#installation)

```
composer require asciisd/kyc-shuftipro
```

Configuration
-------------

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag=shuftipro-config
```

### Environment Variables

[](#environment-variables)

Add these variables to your `.env` file:

```
# ShuftiPro API Configuration
SHUFTIPRO_CLIENT_ID=your_client_id
SHUFTIPRO_SECRET_KEY=your_secret_key
SHUFTIPRO_BASE_URL=https://api.shuftipro.com

# ShuftiPro Webhook Configuration
SHUFTIPRO_WEBHOOK_SECRET=your_webhook_secret
SHUFTIPRO_CALLBACK_URL=https://yourdomain.com/webhooks/kyc/callback
SHUFTIPRO_REDIRECT_URL=https://yourdomain.com/kyc/complete

# ShuftiPro Journey Configuration
SHUFTIPRO_DEFAULT_JOURNEY_ID=your_journey_id

# ShuftiPro Logging
SHUFTIPRO_LOGGING_ENABLED=true
SHUFTIPRO_LOG_CHANNEL=daily
```

Usage
-----

[](#usage)

### Basic Verification

[](#basic-verification)

```
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: 'user@example.com',
    country: 'US',
    language: 'en',
    journeyId: 'your_journey_id'
);

$response = Kyc::createVerification($user, $request);
```

### Journey-based Verification

[](#journey-based-verification)

```
// Use a specific journey ID
$request = new KycVerificationRequest(
    email: 'user@example.com',
    journeyId: 'your_custom_journey_id',
    allowedCountries: ['US', 'CA', 'GB'],
    deniedCountries: ['IR', 'KP']
);

$response = Kyc::createVerification($user, $request);
```

### 🚀 Automatic Webhook Handling

[](#-automatic-webhook-handling)

**NEW!** Webhooks are now handled automatically - no manual route setup required!

#### Auto-Registered Webhook Routes

[](#auto-registered-webhook-routes)

The KYC Core package automatically registers these routes:

```
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
```

#### ShuftiPro Configuration

[](#shuftipro-configuration)

Simply configure your ShuftiPro webhook URL to:

```
SHUFTIPRO_CALLBACK_URL=https://yourdomain.com/api/kyc/webhook
```

#### Benefits

[](#benefits)

- ✅ **Zero Setup** - Works immediately after installation
- ✅ **Automatic Processing** - Webhooks processed with proper status mapping
- ✅ **Secure** - Built-in signature validation
- ✅ **Logged** - Comprehensive logging for debugging
- ✅ **Consistent** - Same behavior across all applications

#### Manual Webhook Processing (Optional)

[](#manual-webhook-processing-optional)

If you need custom webhook handling:

```
// Optional: Custom webhook processing
$response = Kyc::processWebhook($request->all(), $request->headers->all());

if ($response->isSuccessful()) {
    // Custom logic after successful verification
}
```

### Document Management

[](#document-management)

```
// Download documents for a user
$documents = Kyc::downloadDocuments($user, $reference);

// The documents are automatically stored in your configured storage disk
```

Configuration
-------------

[](#configuration-1)

### API Configuration

[](#api-configuration)

```
// config/shuftipro.php
'api' => [
    'client_id' => env('SHUFTIPRO_CLIENT_ID'),
    'secret_key' => env('SHUFTIPRO_SECRET_KEY'),
    'base_url' => env('SHUFTIPRO_BASE_URL', 'https://api.shuftipro.com'),
    'timeout' => env('SHUFTIPRO_TIMEOUT', 30),
],
```

### Webhook Configuration

[](#webhook-configuration)

```
'webhook' => [
    'secret_key' => env('SHUFTIPRO_WEBHOOK_SECRET'),
    'callback_url' => env('SHUFTIPRO_CALLBACK_URL'),
    'redirect_url' => env('SHUFTIPRO_REDIRECT_URL'),
    'signature_validation' => env('SHUFTIPRO_WEBHOOK_SIGNATURE_VALIDATION', true),
],
```

### Document Configuration

[](#document-configuration)

```
'documents' => [
    'auto_download' => env('SHUFTIPRO_AUTO_DOWNLOAD_DOCUMENTS', true),
    'storage_disk' => env('SHUFTIPRO_DOCUMENT_STORAGE_DISK', 's3'),
    'storage_path' => env('SHUFTIPRO_DOCUMENT_STORAGE_PATH', 'shuftipro/documents'),
    'allowed_types' => ['jpg', 'jpeg', 'png', 'pdf', 'mp4'],
    'max_file_size' => env('SHUFTIPRO_MAX_FILE_SIZE', 10485760), // 10MB
],
```

Supported Features
------------------

[](#supported-features)

### Document Types

[](#document-types)

- Identity documents (passport, driver's license, national ID)
- Address verification documents
- Selfie verification
- Video verification
- Verification reports

### Verification Methods

[](#verification-methods)

- IDV Journey verification
- Direct API verification
- Custom journey configurations
- Country-specific verification rules

### Security Features

[](#security-features)

- Webhook signature validation
- Secure document storage
- Duplicate account detection
- Comprehensive audit logging

Events
------

[](#events)

The package fires standard KYC events that you can listen to:

```
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);
});
```

Error Handling
--------------

[](#error-handling)

The package includes comprehensive error handling:

```
use Asciisd\KycShuftiPro\Exceptions\ShuftiProException;

try {
    $response = Kyc::createVerification($user, $request);
} catch (ShuftiProException $e) {
    // Handle ShuftiPro-specific errors
    Log::error('ShuftiPro error: ' . $e->getMessage());
}
```

Testing
-------

[](#testing)

```
composer test
```

🎯 ShuftiPro Status Mapping
--------------------------

[](#-shuftipro-status-mapping)

The driver automatically maps ShuftiPro events to standardized KYC statuses:

```
// ShuftiPro Event → KYC Status
'request.pending'           → RequestPending
'verification.pending'      → InProgress
'verification.in_progress'  → InProgress
'verification.review_pending' → ReviewPending
'verification.completed'    → Completed
'verification.approved'     → Completed
'verification.accepted'     → VerificationCompleted
'verification.failed'       → VerificationFailed
'verification.declined'     → Rejected
'verification.cancelled'    → VerificationCancelled
'request.timeout'          → RequestTimeout
```

### Benefits

[](#benefits-1)

- ✅ **Automatic Mapping** - No manual status handling required
- ✅ **Standardized** - Consistent status across all KYC providers
- ✅ **Provider-Specific** - Handles ShuftiPro's unique event names
- ✅ **Extensible** - Easy to add new event mappings

API Reference
-------------

[](#api-reference)

### ShuftiProDriver Methods

[](#shuftiprodriver-methods)

- `createVerification(Model $user, KycVerificationRequest $request): KycVerificationResponse`
- `createSimpleVerification(Model $user, array $options = []): KycVerificationResponse`
- `retrieveVerification(string $reference): KycVerificationResponse`
- `processWebhook(array $payload, array $headers = []): KycVerificationResponse`
- `downloadDocuments(Model $user, string $reference): array`
- `validateWebhookSignature(array $payload, array $headers): bool`

### Response Data

[](#response-data)

The package returns comprehensive verification data including:

- Verification status and results
- Extracted document data
- Document image URLs
- Verification video URLs
- Duplicate detection results
- Decline reasons (if applicable)

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance90

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~15 days

Recently: every ~4 days

Total

13

Last Release

53d ago

PHP version history (2 changes)v1.0.0PHP ^8.2

1.8.0PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/77636067?v=4)[ASCII SD](/maintainers/asciisd)[@asciisd](https://github.com/asciisd)

---

Top Contributors

[![aemaddin](https://avatars.githubusercontent.com/u/11630742?v=4)](https://github.com/aemaddin "aemaddin (20 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/asciisd-kyc-shuftipro/health.svg)

```
[![Health](https://phpackages.com/badges/asciisd-kyc-shuftipro/health.svg)](https://phpackages.com/packages/asciisd-kyc-shuftipro)
```

###  Alternatives

[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k16.4M48](/packages/lab404-laravel-impersonate)[santigarcor/laratrust

This package provides a flexible way to add Role-based Permissions to Laravel

2.3k5.4M43](/packages/santigarcor-laratrust)[pragmarx/google2fa-laravel

A One Time Password Authentication package, compatible with Google Authenticator.

1.0k15.5M63](/packages/pragmarx-google2fa-laravel)[overtrue/laravel-follow

User follow unfollow system for Laravel.

1.2k404.7k5](/packages/overtrue-laravel-follow)[codegreencreative/laravel-samlidp

Make your PHP Laravel application an Identification Provider using SAML 2.0. This package allows you to implement your own Identification Provider (idP) using the SAML 2.0 standard to be used with supporting SAML 2.0 Service Providers (SP).

263763.5k1](/packages/codegreencreative-laravel-samlidp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
