AzampayProvider implements the FinConnect provider interface for Azampay, handling JWT token generation and USSD push payment initiation via Azampay’s API.
authenticate()
POST https://authenticator-sandbox.azampay.co.tz/AppRegistration/GenerateToken
Headers: Content-Type:application.json
Request body:
response.data.data.accessToken).
Throws: "Authentication failed: ..." if the request fails.
initiateUssdPushRequest()
sdk.pay() is sent directly.
Endpoint: POST {baseUrl}/azampay/mno/checkout
Request body: The raw payload object.
Headers: Authorization: <token>
Returns: Azampay payment response object.
Throws: "Payment request failed: ..." if the request fails.
getPublicKey()
This method fetches the public key provided by azampay it is used to verify webhook cllas signature.
https://githubusercontent.com + somebody1011/finconnect/main/src/provider/AzampayProvider.ts
handleCallback()
After the USSD push is initiated, payment events are going to be updated by azampay through a webhook, which notifies your app of the event.
https://githubusercontent.com + somebody1011/finconnect/main/src/provider/AzampayProvider.ts
Use
FintechSDK.pay() rather than calling ClickpesaProvider directly. Token generation and request normalisation are handled internally.