首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >php中的payumoney退款api

php中的payumoney退款api
EN

Stack Overflow用户
提问于 2017-12-23 09:54:54
回答 2查看 1.6K关注 0票数 0

在我的移动应用程序中,我已经完美地配置了payumoney,它的工作非常棒。只是个退款的案子。下面是我从应用程序调用的php文件中的代码:

代码语言:javascript
复制
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 => )

有人能告诉我我在这里做了什么错事吗?

EN

回答 2

Stack Overflow用户

发布于 2020-11-04 11:28:18

Refund在测试/沙箱环境中不起作用。

请参阅以下有关活动环境的退款API:

https://www.payumoney.com/treasury/merchant/refundPayment?merchantKey=merchantkeyvalue&paymentId=1234&refundAmount=10

请在标题栏中传递“商人”键、付款ID和金额以及授权头。

票数 1
EN

Stack Overflow用户

发布于 2017-12-23 10:18:41

出了问题.根据PayUmoney API文档的说法,由于应用程序或网站中的500、502、503或504服务器错误,错误出现在PayUmoney的末尾。

要了解更多关于这些HTTP响应代码的信息,您需要遵循以下链接:

电码

此外,更新您的卷曲,以获得更多的信息,如果发生故障,如下所示:

代码语言:javascript
复制
$output = curl_exec($ch);

if ($output === false){
    // throw new Exception('Curl error: ' . curl_error($output));
    print_r('Curl error: ' . curl_error($output));
}

如果您仍然不确定您的问题,那么最好联系PayUmoney支援小组

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47951479

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档