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 charges
cardNumberandcardSecurityare encrypted using AES encryption then the cypher is base64 encoded.
You can find libraries to encrypt on Github
200 Success Response Schema
| Field Name | Field Type | Field Descriptions |
|---|---|---|
status | bool | Response status |
code | number | Response code |
message | string | Response message |
data | object | Response data |
chargeBearer | string | Who will pay the charge |
amount | number | Orde amount |
charge | number | Total charge |
actualAmount | amount | Amount 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.referenceRequest Fields
| Field Name | Type | Description | Example | Required |
|---|---|---|---|---|
transactionReference | string | A unique reference for the transaction. | "DEV1000008837309" | Yes |
merchantMID | string | The merchant's unique identifier. | "TESTJENGA_MISC" | Yes |
apiOperation | string | The type of operation (either CREATE_SESSION or PAYMENT_LINK). | "CREATE_SESSION" | Yes |
responseUrl | string | The URL to which the response will be sent. | "https://webhook.site/fd79166c-68e1-446b-a53a-f8aac45f0273 (opens in a new tab)" | Yes |
returnUrl | string | The URL to which the customer will be redirected after payment. | "https://v3.jengahq.io (opens in a new tab)" | Yes |
merchantLogo | string | The URL of the merchant's logo. | "https://www.finserve.africa/images/finserve-big-logo.svg (opens in a new tab)" | Yes |
order.amount | number | The amount of the order. | 100.56 | Yes |
order.currency | string | The currency for the order amount. | "USD" | Yes |
order.reference | string | A unique reference for the order. | "ORDERDEV10000059893" | Yes |
customer.firstName | string | The first name of the customer. | "Johnstone" | Yes |
customer.lastName | string | The last name of the customer. | "Doherty" | Yes |
customer.email | string | The 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"
}
}