php - 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 )
我不明白这个系统错误是什么意思。有什么解决方案。任何帮助将非常感激。
提前致谢..
解决方案
根据错误文档,错误 501 是 payTm 内部的系统错误。 https://developer.paytm.com/docs/refund-status-api/
我猜你正在使用 payTm 登台服务器。你这边没有问题,我建议你等几个小时再试一次。它会自动工作
推荐阅读
- javascript - Bootstrap datetimepicker 中的周视图
- javascript - vue.js 重定向到另一个页面(与原始页面相同的代码)然后数据库访问 404 错误
- python - 如何将 RSTP 与 OpenCV 连接?
- python - 如何使用python检测数组对
- android - Chrome 自定义选项卡中是否有任何等效的 webViewClient
- reactjs - 不会崩溃但会导致 300% CPU 的无限循环
- python - httpd 与 django3 与 python3.6 在 Centos7
- json - 从 bash 变量和关联数组创建 json
- javascript - Typescript - 修改拦截器以返回 config.data 时如何更改 axios 响应的类型
- python-3.x - 插件中的未知钩子“pytest_namespace”
我正在使用以下代码:
from selenium import webdriver import pytest @pytest.fixture() def setup(browser): if browser == 'chrome': driver = webdriver.Chr