FinConnect uses a provider model where each supported payment platform (PesaPal, ClickPesa,Azampay) is wrapped in a provider class that implements a common interface. You pick a provider at initialization and the SDK handles the rest — authentication, request formatting, and response parsing all happen under the hood.
How providers work
FinConnect exposes a ProviderType enum-like values for each supported provider. When you construct a FintechSDK instance, it passes your chosen provider type and config to ProviderFactory.createProvider(), which validates your config and returns the appropriate provider instance. FintechSDK stores this internally as gateway and delegates all method calls to it.
ProviderFactory.createProvider() validates that all required config fields are present before instantiating a provider. If you pass an unrecognized provider string, it throws:
Provider comparison
registerIpn() on ClickPesa (and any provider that does not override the base implementation) throws "IPN registration not supported by this provider".
Selecting a provider
Pass a ProviderType value and the matching config object to FintechSDK:
Required config fields
Each provider validates its own required fields at construction time and throws if any are missing.
PesaPal
ClickPesa
AzamPay