title: Paytm payment gateway transaction API not working
body: <p>I need a help in implementing of paytm payment gateway. i am implementing the gateway in android app and i have coded it correctly and i have no errors and the sandbox keys are working fine and i am getting the responses also but then paytm sent me a file naming 'check status API.php' and said this to me i m quoting my email</p>
  
  <blockquote>
    <p>For Transaction Status API, kindly generate new checksum using MID and
    ORDER ID and pass it on below link
    <a href="https://pguat.paytm.com/oltp/HANDLER_INTERNAL/getTxnStatus?JsonData=" rel="nofollow noreferrer">https://pguat.paytm.com/oltp/HANDLER_INTERNAL/getTxnStatus?JsonData=</a>{"MID":"MID","ORDERID":"ORDERID","CHECKSUMHASH":"CHECKSUMHASH"}</p>
    
    <p>Please do Url encoding for the  CHECKSUMHASH after that pass
    checksumhash value to status API.</p>
  </blockquote>
  
  <p>and i have a attachment this file </p>
  
  <p>check status API.php</p>
  
  <pre><code> public function PaytmTransactionStatus($order_id){
  
       header("Pragma: no-cache");
       header("Cache-Control: no-cache");
       header("Expires: 0");
       require_once("lib/config_paytm.php"); 
       require_once("lib/encdec_paytm.php");
  
       $checkSum = "";    
       $data = array(
          "MID"=&gt;"DIY12386817555501617",// please use your own MID.
         "ORDER_ID"=&gt;$order_id,
       );
  
       $key = 'bKMfNxPPf_QdZppa';
       $checkSum =getChecksumFromArray($data, $key);// Please use your own merchant key value.
  
  
       $request=array("MID"=&gt;'**************',
           "ORDERID"=&gt;$order_id,"CHECKSUMHASH"=&gt;$checkSum);
  
       $JsonData =json_encode($request);
       $postData = 'JsonData='.urlencode($JsonData);
       $url = "https://pguat.paytm.com/oltp/HANDLER_INTERNAL/getTxnStatus";
  
       $HEADER[] = "Content-Type: application/json";
       $HEADER[] = "Accept: application/json";
  
       $args['HEADER'] = $HEADER;  
       $ch = curl_init();
       curl_setopt($ch, CURLOPT_URL,$url);
       curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
       curl_setopt($ch, CURLOPT_POST, true);
       curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);   
       curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
       curl_setopt($ch, CURLOPT_HTTPHEADER, $args['HEADER']);
       $server_output = curl_exec($ch);
  
       return json_decode($server_output,true);
  </code></pre>
  
  <p>i modified MID and merchant key with mine and uploaded it to server but the api is not working it is returning me whole code written in the browser but it should return json.</p>