我试图将Paytm支付网关集成到我的Angular通用项目中。
问题是,当我尝试运行支付网关的Url时,我看到的是 Please wait! Do not refresh the page
而不是把我的支付门户,它是重定向到 callback
网址
我加了 /payment
航线 server.ts
以下是代码。
server.get('/payment', (req, res) => {
let params = {}
params['MID'] = 'xxx',
params['WEBSITE'] = 'WEBSTAGING',
params['CHANNEL_ID'] = 'WEB',
params['INDUSTRY_TYPE_ID'] = 'Retail',
params['ORDER_ID'] = 'ORD0001',
params['CUST_ID'] = 'CUST0011',
params['TXN_AMOUNT'] = '100',
params['CALLBACK_URL'] = 'http://localhost:' + port + '/callback',
params['EMAIL'] = '[email protected]',
params['MOBILE_NO'] = 'xxxx'
checksum_lib.genchecksum(params, 'xxx', function (err, checksum) {
let txn_url = "https://securegw-stage.paytm.in/order/process"
let form_fields = ""
for (let x in params) {
form_fields += "<input type='hidden' name='" + x + "' value='" + params[x] + "'/>"
}
form_fields += "<input type='hidden' name='CHECKSUMHASH' value='" + checksum + "' />"
var html = '<html><body><center><h1>Please wait! Do not refresh the page</h1></center><form method="post" action="' + txn_url + '" name="f1">' + form_fields + '</form><script type="text/javascript">document.f1.submit()</script></body></html>'
res.writeHead(200, { 'Content-Type': 'text/html' })
res.write(html)
res.end()
})
})
似乎你在多个请求中传递了相同的订单ID。订单ID应该是每个付款请求中唯一的。
您可以参考回调URL中请求体中的RESPCODE和RESPMSG(因为回调是后请求)来检查这个问题。另外,您的订单ID也需要不同。