09 - External Providers

All 60+ external integrations grouped by category. The backend uses the ProviderChainExecutor<T> pattern with fallback for high-criticality categories (PAN, Bank, Face Match, eSign).

PAN Verification

Interface: IPanProvider · Executor: ProviderChainExecutor<IPanProvider>

PriorityProviderFile
1Zintlr phone-to-PANZintlrPhoneToPanProvider.cs
2Hyperverge PANHypervergePanProvider.cs
3NSDL PAN (official)NsdlPanProvider.cs
4UTI PANUtiPanProvider.cs
5CVL KRA (encrypted)CvlKraPanProvider.cs
6NDMLNdmlPanProvider.cs

Bank Verification

Interface: IBankVerificationProvider

PriorityProviderNotes
1Hyperverge RPDReverse Penny Drop (UPI-based)
2KarzaForward penny drop
3SETU Reverse Penny90s timeout
4YesBank IMPS / SOAPUses X.509 client certificate
5AINXT Bank OCRBank statement OCR
6Digitap OCRBank statement OCR

Separate: BankAutoVerifyService calls Decentro mobile-to-bank API at Stage 2 (not through ProviderChainExecutor - it is a dedicated background flow).

Face Match

Interface: IFaceMatchProvider

Liveness & Signature

eSign

Router: EsignVendorRouter.cs - primary Hyperverge, fallback eMudhra, last resort NSDL

DigiLocker / Aadhaar

Communication (SMS + Email)

NetcoreSmsProviderSMS via Netcore Cloud or internal MOSL SMS gateway. Honors Sms.Mode=FIXED_OTP.
NetcoreEmailProviderEmail via Netcore Cloud
TheCheckerEmailProviderEmail via TheChecker
KarzaEmailProviderEmail via Karza
SmtpEmailProviderDirect SMTP relay (default localhost:25)
EmailNotificationServiceOrchestrator that tries providers in order

Geocoding & Name Match

CRM, Fraud, Aggregator

Payment Gateways

EpayGatewayProviderPrimary payment gateway
RazorpayGatewayProviderFallback gateway

FundTransferService at Stage 15 orchestrates these through IPaymentGateway.

Link Shorteners

Common Provider Infrastructure

ClassPurpose
IExternalProviderBase interface with ProviderName property
ProviderChainExecutor<T>Generic fallback executor. Reads provider_configurations table, respects circuit breaker, logs to ApiAuditLog, updates health metrics.
CircuitBreakerIn-memory circuit breaker (tracks failure count, opens after threshold)
ApiAuditLoggerWrites every external call to api_audit_log table with request/response/timing/correlation ID
ProviderHealthTrackerUpdates provider_health_metrics per call for WarRoom dashboard

How Providers are Registered

Each provider is registered in Program.cs under its interface. The ProviderChainExecutor injects IEnumerable<IPanProvider> and picks the right one based on ProviderName.

backend/src/MO.Ekyc.Api/Program.csC#provider registration
builder.Services.AddScoped<IPanProvider, ZintlrPhoneToPanProvider>();
builder.Services.AddScoped<IPanProvider, HypervergePanProvider>();
builder.Services.AddScoped<IPanProvider, NsdlPanProvider>();
builder.Services.AddScoped<IPanProvider, UtiPanProvider>();
builder.Services.AddScoped<IPanProvider, CvlKraPanProvider>();
builder.Services.AddScoped<IPanProvider, NdmlPanProvider>();

builder.Services.AddScoped<ProviderChainExecutor<IPanProvider>>();

Mock Mode in Providers

Each provider respects both levels of mock control:

  1. Service level: MockMode:GlobalMockEnabled - services skip provider calls entirely and return mock data
  2. Provider level: provider_configurations.mock_mode - ProviderChainExecutor checks this per provider and returns default when true

See 02 - Mock Mode for details.