title: payumoney refund api in php
body: <p>In my mobile app, I have configured payumoney perfectly and its working great. Its just a case of refund. Below is the code in the php file which I call from the app:</p>
  
  <pre><code>include('../connection.php');
  
  $orderid="AMD197";   
  
  $view_rs =$conn-&gt;prepare("SELECT * from tbl_payumoney_order WHERE orderid=:orderid");       
  
  $view_rs-&gt;execute(array(':orderid'=&gt;$orderid));                 
  $vfetch=$view_rs-&gt;fetch();
  
  $merchantId="393463"; 
  $paymentId= $vfetch['paymentId'];
  $refundAmount= $vfetch['amount'];
  $merchantAmount= $vfetch['amount'];
  $aggregatorAmount= "0";
  $refundType="1";
  
  $data_string="paymentId=".$paymentId."&amp;refundAmount=".$refundAmount."&amp;refundType=".$refundType."&amp;merchantId=".$merchantId."&amp;merchantAmount=".$merchantAmount."&amp;aggregatorAmount=".$aggregatorAmount; 
  
  //paymentId=123456&amp;refundAmount=56&amp;refundType=1&amp;merchantId=765433&amp;merchantAmount=6&amp;aggregatorAmount=50 
  
  
  $ch = curl_init();      
  $url = "https://test.payumoney.com/payment/refund/refundPayment";   
  
  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); 
  $info = curl_getinfo($ch);
  
  $data = json_decode($output, true); 
  
  print_r($data);
  
  $status= $data['status']; 
  $message= $data['message'];
  $result= $data['result'];
  </code></pre>
  
  <p>I am getting this response:</p>
  
  <blockquote>
    <p>Array ( [status] => -1 [rows] => 0 [message] => Something went Wrong
    guid 3k4pcbv6kdqf405g0lut7id32m sessionId null [result] => [guid] =>
    3k4pcbv6kdqf405g0lut7id32m [sessionId] => null [errorCode] => )</p>
  </blockquote>
  
  <p>Can anyone suggest if I am doing anything wrong here?</p>