Guides & Tutorials
Jenga API
MPGS Direct Integration
Validate Payment

MPGS Validate Payment

Test URL

POSThttps://uat.finserve.africa/mpgs-direct-integration/api/v3.2/validatePayment

Live URL

POSThttps://api-unt.finserve.africa/mpgs-direct-integration/api/v3.2/validatePayment

This API will validate payment before card authorization. The API will do the following

  • Check if the merchant is subscribed to the Card APIs service
  • Check if they are subscribed to the MID they are using.
  • Fetch the relevant chargescardNumber and cardSecurity are encrypted using AES encryption then the cypher is base64 encoded.

You can find libraries to encrypt on Github

200 Success Response Schema

Field NameField TypeField Descriptions
statusboolResponse status
codenumberResponse code
messagestringResponse message
dataobjectResponse data
chargeBearerstringWho will pay the charge
amountnumberOrde amount
chargenumberTotal charge
actualAmountamountAmount plus charge

Example Request

⚠️

In the example below, please remember to replace the variables enclosed within curly brackets {{ }} with the actual values.

Signature Formula
transactionReference+merchantMID+apiOperation+order.amount+order.currency+order.reference
Example Request
curl --request POST \
     --url https://uat-unt.finserve.africa/mpgs-direct-integration/api/v3.2/validatePayment \
     --header 'Authorization: {{token}}' \
     --header 'Signature: {{signature}}' \
     --header 'content-type: application/json' \
     --data '
        {
            "transactionReference": "DEV1000008837309",
            "merchantMID": "TESTJENGA_MISC",
            "apiOperation": "CREATE_SESSION",//CREATE_SESSION/PAYMENT_LINK
            "responseUrl": "https://webhook.site/fd79166c-68e1-446b-a53a-f8aac45f0273",
            "returnUrl": "https://v3.jengahq.io",
            "merchantLogo": "https://www.finserve.africa/images/finserve-big-logo.svg",
            "order": {
                "amount": 100.56,
                "currency": "USD",
                "reference": "ORDERDEV10000059893"
            },
            "customer": {
                "firstName": "Johnstone",
                "lastName": "Doherty",
                "email": "johnstone.doherty@equitybank.co.ke"
            }
        }
'

Example Response

Example Response
{
    "status": true,
    "code": 200,
    "message": "Payment validated successfully.",
    "data": {
        "chargeBearer": "CUSTOMER",
        "amount": 100.56,
        "code": 0,
        "charge": 3.52,
        "cardSchemeServiceId": 341,
        "actualAmount": 104.08,
        "message": "success"
    }
}