Check Transaction Status
This endpoint is used to verify the status of a transaction carried out on your Marasoft Pay account
Usage
API Endpoint - https://api.marasoftpay.live/checktransaction
Method - POST
Data Type - FORM-DATA
Limit - No Limit
Parameter | Required? | Description |
---|---|---|
enc_key | Yes | Your encryption key from MarasoftPay. Get it from your dashboard |
transaction_ref | Yes | a unique reference code to identify the transaction. |
Code Sample
<?php
$enc_key = "yourencrytionkey****";
$transaction_ref = "***********";
$url = "https://api.marasoftpay.live/checktransaction";
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$headers = array(
"Content-Type: application/x-www-form-urlencoded",
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$data ="transaction_ref=***********&enc_key=MSFT_Enc_GXUG6*****************";
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
var formdata = new FormData();
formdata.append("enc_key", "");
formdata.append("transaction_ref", "TRZ_956641697061109583");
var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};
fetch("https://api.marasoftpay.live/checktransaction", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
# importing the requests library
import requests
# defining the api-endpoint
API_ENDPOINT = "https://api.marasoftpay.live/checktransaction"
# data to be sent to api
data = {
'enc_key': ********,
'transaction_ref':'**********'
}
# sending post request and saving response as response object
r = requests.post(url = API_ENDPOINT, data = data)
# extracting response text
pastebin_url = r.text
print("The pastebin URL is:%s"%pastebin_url)
Response Sample
{
"status": "true",
"transaction_ref" : "Successful",
"type" : "USSD",
"account_number" : "9011745224",
"amount_received" : "1150",
"transaction_amount" : "1000",
"settled_amount" : "990",
"charge" : "160",
"merchant_ref" : "1660502132",
"msft_ref" : "ref_ZAGUOHS5Y3X16605021696519658",
"created_at" : "14 Aug, 2022 19:37:11",
}