Please wait...

PAYMENT STATUS

"{$MID}" , "ORDERID" => "{$orderid}", "MERC_UNQ_REF" => "{$productinfo}"); $checkSum = getChecksumFromArray($requestParamList,'a7eKqVQ8PTTJ1GNo'); $requestParamList['CHECKSUMHASH'] = urlencode($checkSum); $data_string = "JsonData=".json_encode($requestParamList); $ch = curl_init(); // initiate curl //$url = "https://securegw-stage.paytm.in/merchant-status/getTxnStatus"; $url = "https://securegw.paytm.in/merchant-status/getTxnStatus"; curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_POST, true); // tell curl you want to post something curl_setopt($ch, CURLOPT_POSTFIELDS,$data_string); // define what you want to post curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // return the output in string format $headers = array(); $headers[] = 'Content-Type: application/json'; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $output = curl_exec($ch); // execute $info = curl_getinfo($ch); $data = json_decode($output, true); if ($data["STATUS"] == "TXN_SUCCESS") { $status = $data["STATUS"]; $ORDERID = $data["ORDERID"]; $productinfo = $data["MERC_UNQ_REF"]; $txnid = $data["TXNID"]; $MID = $data["MID"]; //$CHECKSUMHASH = $data["CHECKSUMHASH"]; $txnid = $data['TXNID']; $firstname = 'Paytm'; $update="update phdstudadm set FPAYREMARKS = '{$txnid}',FPAYID = '{$txnid}', FPAYSTATUS = 'success', FPAYDATE = now() where fappno ='{$productinfo}'"; $result=$conn->query($update); echo "

Thank You. Your order status is success

"; echo "

Your Transaction ID for this transaction is ".$data['TXNID'].".

"; echo "

We have received a payment of Rs. " . $data['TXNAMOUNT'] ."

"; $html="
Click here to take a PrintOut
"; echo $html; } else { echo "Transaction status is failure" . "
"; } /* if (isset($_POST) && count($_POST)>0 ) { foreach($_POST as $paramName => $paramValue) { echo "
" . $paramName . " = " . $paramValue; } } */ } /* else { echo "Checksum mismatched."; //Process transaction as suspicious. } */ ?>