首页 > 解决方案 > Paytm 退款 api 给出 501 - 响应系统错误

问题描述

我在 php 中使用 paytm 退款 api。

这是我的代码:

$checkSum = "";
$paramList = array();            
// Create an array having all required parameters for creating checksum.
$paramList["MID"] = '**********';
$paramList["ORDERID"] = '*******'; //get during paytm transaction response
$paramList["TXNTYPE"] = 'REFUND';
$paramList["REFUNDAMOUNT"] = '50';
$paramList["TXNID"] = '***********'; // get during paytm transaction response
$paramList["REFID"] = 'REFID'.time();
//Here checksum string will return by getChecksumFromArray() function.
$checkSum = getRefundChecksumFromArray($paramList,PAYTM_MERCHANT_KEY);
$paramList["CHECKSUM"] = urlencode($checkSum);
$data_string = 'JsonData='.json_encode($paramList);
// initiate curl
$ch = curl_init();                    
$url = 'https://securegw-stage.paytm.in/refund/HANDLER_INTERNAL/REFUND';
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);
print_r($data);

这是回应,我得到:

Array ( [RESPCODE] => 501 [RESPMSG] => System Error. [STATUS] => PENDING ) 

我不明白这个系统错误是什么意思。有什么解决方案。任何帮助将非常感激。

提前致谢..

标签: phppaytm

解决方案


根据错误文档,错误 501 是 payTm 内部的系统错误。 https://developer.paytm.com/docs/refund-status-api/

我猜你正在使用 payTm 登台服务器。你这边没有问题,我建议你等几个小时再试一次。它会自动工作


推荐阅读