FintechSDK is the main class you interact with. It wraps a provider instance created by ProviderFactory and exposes the two core methods: pay() and registerIpn().
Constructor
The provider to use. Use
ProviderType enum values: ProviderType.pesapal or ProviderType.clickpesa. String values ("pesapal", "clickpesa") are also accepted and matched case-insensitively.Provider-specific configuration object. Must include
baseUrl and the required credentials for the chosen provider. See ProviderFactory for the full list of required fields per provider."Invalid configuration: Missing required fields for [Provider]" if any required config fields are absent.
sdk.pay()
ipnId is merged into the payload as notification_id. For ClickPesa, data is sent directly without modification.
Payment payload. The required fields depend on the provider — see the provider-specific guides for payload structure.
IPN ID returned by
registerIpn(). Required for PesaPal payments. Not used by ClickPesa."Payment request failed: ..." on error.
- PesaPal
- ClickPesa
- AzamPay
sdk.registerIpn()
Publicly accessible URL that the provider will call when a payment status changes. Must be HTTPS in production.
HTTP method the provider uses when delivering notifications. Defaults to
"GET" in FintechSDK.ipn_id string returned by PesaPal. Pass this value as the second argument to sdk.pay().
Throws: "IPN registration not supported by this provider" when called with a ClickPesa instance.