在我的移动应用程序中,我已经完美地配置了payumoney,它的工作非常棒。只是个退款的案子。下面是我从应用程序调用的php文件中的代码:
include('../connection.php');
$orderid="AMD197";
$view_rs =$conn->prepare("SELECT * from tbl_payumoney_order WHERE orderid=:orderid");
$view_rs->execute(array(':orderid'=>$orderid));
$vfetch=$view_rs->fetch();
$merchantId="393463";
$paymentId= $vfetch['paymentId'];
$refundAmount= $vfetch['amount'];
$merchantAmount= $vfetch['amount'];
$aggregatorAmount= "0";
$refundType="1";
$data_string="paymentId=".$paymentId."&refundAmount=".$refundAmount."&refundType=".$refundType."&merchantId=".$merchantId."&merchantAmount=".$merchantAmount."&aggregatorAmount=".$aggregatorAmount;
//paymentId=123456&refundAmount=56&refundType=1&merchantId=765433&merchantAmount=6&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'];我收到这样的答复:
数组(状态=> -1行=> 0消息=> ) guid 3k4pcbv6kdqf 405g0lut7id32m sessionId空结果=> guid => 3k4pcbv6kdqf405g0lut7id32m sessionId =>空errorCode => )
有人能告诉我我在这里做了什么错事吗?
发布于 2020-11-04 11:28:18
Refund在测试/沙箱环境中不起作用。
请参阅以下有关活动环境的退款API:
请在标题栏中传递“商人”键、付款ID和金额以及授权头。
发布于 2017-12-23 10:18:41
出了问题.根据PayUmoney API文档的说法,由于应用程序或网站中的500、502、503或504服务器错误,错误出现在PayUmoney的末尾。
要了解更多关于这些HTTP响应代码的信息,您需要遵循以下链接:
此外,更新您的卷曲,以获得更多的信息,如果发生故障,如下所示:
$output = curl_exec($ch);
if ($output === false){
// throw new Exception('Curl error: ' . curl_error($output));
print_r('Curl error: ' . curl_error($output));
}如果您仍然不确定您的问题,那么最好联系PayUmoney支援小组。
https://stackoverflow.com/questions/47951479
复制相似问题