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
Request Fields
Field NameTypeDescriptionExampleRequired
transactionReferencestringA unique reference for the transaction."DEV1000008837309"Yes
merchantMIDstringThe merchant's unique identifier."TESTJENGA_MISC"Yes
apiOperationstringThe type of operation (either CREATE_SESSION or PAYMENT_LINK)."CREATE_SESSION"Yes
responseUrlstringThe URL to which the response will be sent."https://webhook.site/fd79166c-68e1-446b-a53a-f8aac45f0273 (opens in a new tab)"Yes
returnUrlstringThe URL to which the customer will be redirected after payment."https://v3.jengahq.io (opens in a new tab)"Yes
merchantLogostringThe URL of the merchant's logo."https://www.finserve.africa/images/finserve-big-logo.svg (opens in a new tab)"Yes
order.amountnumberThe amount of the order.100.56Yes
order.currencystringThe currency for the order amount."USD"Yes
order.referencestringA unique reference for the order."ORDERDEV10000059893"Yes
customer.firstNamestringThe first name of the customer."Johnstone"Yes
customer.lastNamestringThe last name of the customer."Doherty"Yes
customer.emailstringThe email address of the customer."johnstone.doherty@equitybank.co.ke"Yes
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"
    }
}