This endpoint enables you to fetch the transaction status of any given payment that you initiated
https://darajapay.com/api/v1/transaction-status
| Name | Type | Description |
|---|---|---|
| reference* | String | The reference that was returned in the original transaction request |
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Basic authToken |
{
"transaction_date": "2024-11-26T08:41:14.160604Z",
"provider": "m-pesa",
"success": true,
"merchant": "Ron Doe",
"payment_reference": "",
"third_party_reference": "SKQ96C7K7H",
"status": "SUCCESS",
"reference": "6b71cb8b-638d-4b6e-9c7c-b0334a641e3a",
"CheckoutRequestID": "",
"provider_reference": "SKQ96C7K7H"
}
From the response you can pick the status parameter to determine if the transaction was successful or not when successful the value will be SUCCESS any other value means the transaction has not been processed
QUEUED- Payment has been queued and we have not received callback
SUCCESS- Payment has been successfully
FAILED- Payment Failed
<?php
$url = 'https://darajapay.com/api/v1/transactions/status/TRANSACTION_ID';
$headers = array(
'Content-Type: application/json',
'Authorization: Basic YOUR_API_KEY'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;