我正在尝试使用API集成Paytm支付网关。
我已经从他们的git项目中将.net 4.5 paytm.dll添加到了以.net framework 4.7为目标的asp.net API项目中
为此,我使用以下代码创建了检查:
String merchantKey = "hNIXDAclG8Li#D5X";
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters.Add("MID", "aTSCQu39976373303724");
parameters.Add("CHANNEL_ID", "WEB");
parameters.Add("INDUSTRY_TYPE_ID", "Retail");
parameters.Add("WEBSITE", "WEBSTAGING");
parameters.Add("CUST_ID", "CUST_01");
parameters.Add("ORDER_ID", "o_1234");
parameters.Add("TXN_AMOUNT", "100.00");
parameters.Add("CALLBACK_URL", "https://securegw.paytm.in/theia/paytmCallback?ORDER_ID=o_1234");
String paytmChecksum = CheckSum.generateCheckSum(merchantKey, parameters);
使用生成的校验和,我试图使用POSTMAN中的以下API调用和JSON对象创建付款。 https://securegw-stage.paytm.in/link/create
{
"body": {
"mid": "aTSCQu39976373303724",
"linkType": "INVOICE",
"linkDescription": "Test Payment",
"linkName": "Test",
"sendSms": false,
"sendEmail": false
},
"head": {
"tokenType": "AES",
"signature": "lQWs6oOwK/hEpmfPN9x5GMLUe5pFpcIKdnIYQeDHT5csnul3H1RMsPfCyOQcTXB9FccSsFTbmi5R6S/BUjWCFFcjWxqgdF+jhSFY9uALLqo="
}
}
但是它响应并显示以下错误
{
"head": {
"version": "v2",
"timestamp": "06/06/2020 17:56:31",
"channelId": null,
"signature": null,
"tokenType": null,
"clientId": null
},
"body": {
"resultInfo": {
"resultStatus": "FAILED",
"resultCode": "5028",
"resultMessage": "Checksum provided is invalid."
}
}
}
有人可以解决这个问题吗? 先感谢您。请原谅我语法不好。