Test

<?php
//==== Verify Transaction after redirect back user on callback URL ======

//---- NO NEED THIS CODING IF YOU ARE USING IPN VERIFICATION SYSTEM ==/


$web_id="3244";   // Your Web ID here (you can found this on cashmaal account where you add site) 

if(isset($_POST['CM_TID'])){


$CM_TID=$_POST['CM_TID'];   // getting TID with user redirection   



$url="https://www.cashmaal.com/Pay/verify_v2.php?CM_TID=".urlencode($CM_TID)."&web_id=".urlencode($web_id);



$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $url);
$result = curl_exec($ch);
curl_close($ch);

$obj = json_decode($result);

if($obj['status'] == 1){ // its mean payment received....


//response format in JSON
//Example Response
/*
   {"status":"1","receiver_account":"8","USD_amount":"1.670","fee_in_USD":"0.000","PKR_amount":"280","fee_in_PKR":"0","USD_amount_with_fee":"1.670","PKR_amount_with_fee":"280","trx_website":"website.com","transaction_id":"2JW9651118P","trx_date":"25-03-2020 9:13:48 PM","order_id":"12345678","addi_info":"Test Payment","sender_details":"Fund Received From 161919","trx_details":"$1.67 Receive against TID: '2JW9651118P'"}
 
 */
// Verify All things and Confirm user order here

if($obj['USD_amount'] == '200'){

// Payment Confirmed USD 200 Received

}else{

// error: we have not receive full amount

}

}else{

echo "Error:".$obj['error'];

}

}

?>