【发布时间】:2022-06-19 21:49:22
【问题描述】:
使用 Nodejs 生成 Patym 动态二维码-------> 支付宝支付网关未启用UPI支付模式错误如何解决
我正在尝试在 paytm 支付网关中实现 QR 码,但出现此错误,即商家未启用 UPI 支付模式,所以如果有人知道此错误的解决方案,请提出解决方案,以下是我的代码用于创建动态二维码
const https = require('https');
const express=require('express')
const bodyParser=require('body-parser')
var app=express();
常量端口=3445;
app.listen(PORT,()=>console.log(Server is running on port ${PORT}))
const PaytmChecksum=require('paytmchecksum');
app.post('/qr-code',(req,res)=>{ var paytmParams = {};
paytmParams.body = { “请求类型”:“本机”, “中”:“中”, "orderId" : "OREDRID98765", “金额”:“1303.00”, "businessType" : "UPI_QR_CODE", “posId”:“S12_123”, "paymentMode" : "UPI", "payerAccount" : "7777777777@paytm", };
PaytmChecksum.generateSignature(JSON.stringify(paytmParams.body), "merchant_key").then(function(checksum){
console.log(checksum)
paytmParams.head = {
"clientId" : "C11",
"version" : "v1",
"signature" : checksum
};
var post_data = JSON.stringify(paytmParams);
var options = {
/* for Staging */
hostname: 'securegw-stage.paytm.in',
port: 443,
path: '/paymentservices/qr/create',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': post_data.length
}
};
var response = "";
var post_req = https.request(options, function(post_res) {
post_res.on('data', function (chunk) {
response += chunk;
});
post_res.on('end', function(){
res.send(response)
console.log('Response: ', response);
});
});
post_req.write(post_data);
post_req.end();
});
})
【问题讨论】:
标签: paytm