FintechSDK instance is scoped to one provider and one set of credentials. Use environment variables to keep credentials out of your source code.
Environment variables
Add a.env file to your project root with the variables for the providers you use:
.env to your .gitignore so credentials are never committed to version control.
PesaPal configuration
Pass these fields in theconfig object when initializing with ProviderType.pesapal:
ClickPesa configuration
Pass these fields in theconfig object when initializing with ProviderType.clickpesa:
Azampay configuration
Pass these fields in theconfig object when initializing with ProviderType.azampay:
Sandbox vs. production
You switch between sandbox and production by changingbaseUrl. No other code changes are needed.
Validation
ProviderFactory validates that all required config fields are present before instantiating a provider. If any field is missing, the constructor throws immediately with a descriptive error: