Verify Payment
The following endpoint is used to verify specific payment details. Usually requested after successful completion payment to verify that the returning result is from Fatora itself or if it is hacking.
The following endpoint is used to get order(payment) details, you may need to call it after each succes_url for double checking the calling
curl -X POST 'https://api.fatora.io/v1/payments/verify' \
--header 'api_key: E4B73FEE-F492-4607-A38D-852B0EBC91C9' \
--header 'Content-Type: application/json' \
--data-raw '{
"transaction_id" : "123456789",
"order_id" : "123456789"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.fatora.io/v1/payments/verify',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => array(
'api_key: E4B73FEE-F492-4607-A38D-852B0EBC91C9',
'Content-Type: application/json'
),
CURLOPT_POSTFIELDS =>'{
"transaction_id" : "123456789",
"order_id" : "123456789"
}'
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
using (var httpClient = new HttpClient())
{
using (var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.fatora.io/v1/payments/verify"))
{
request.Headers.TryAddWithoutValidation("api_key", "E4B73FEE-F492-4607-A38D-852B0EBC91C9");
request.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json");
VerfiyPayment verfiyPayment = new VerfiyPayment(){
{
transaction_id = "123456789",
order_id = "123456"
};
string payload = JsonConvert.SerializeObject(payment);
request.Content = new StringContent(payload);
var response = httpClient.SendAsync(request);
}
}}
{
status: "SUCCESS",
"result": {
"order_id": "XXXXXX",
"transaction_id": "XXXXXX",
"amount": XXX,
"currency": "XXX",
"client":{
"name": "XXXXXXXXX",
"email":"XXXXXXXXX",
"phone":"XXXXXXXXX"
},
"note": "Demo of Payment",
"payment_date": "YYYY-MM-DDTHH:mm:ss.ms",
"payment_status": "SUCCESS|PENDING|FAILURE",
"mode": "live",
"auth_code": "XXXXXX",
"exchange_details":{
"exchange_rate": XX,
"amount": XXX,
"currency":"XXX"
},
"transfer_details":{
"interchange_fees": XXX,
"rate":XX.X,
"transfer_number":"XXXXXX"
},
"description": "Transaction Successful - Approved",
"card_token": "XXXXXX",
"refund_details":{
"status":"proccessing|completed",
"transfer_number":"transafer number",
"refund_transaction_id": "XXXXXX"
},
"card_details": {
"card_type": "MasterCard",
"last_4_digits": "XXXX",
"type": "Credit"
}
}
}
Try it now: Verify payment API
Header Parameters
Header | Value |
---|---|
api_key
REQUIRED
|
Use the valid API key of your Fatora account. Read more information about Authentication. |
Content-Type
REQUIRED
|
application/json |
Request Body
Parameter | Description |
---|---|
transaction_id
OPTIONAL
|
stringThe transaction id of payment issued from the bank. |
order_id
REQUIRED
|
stringA unique identifier for order in your application |
Response
The successful request returns the HTTP 200 OK status code and a JSON response body that shows information about payment.
Response Schema: application/json | |
---|---|
status
|
string the status of response. SUCCESS |
result
|
arrayThe result array contins the following
values:
|
Otherwise if there was a problem with your request, you'll receive an error response such as 400 status code, and the response will include an error object describing why this request failed.
Response Schema: application/json | |
---|---|
status
|
string The status of response. |
error
|
object:
|