我正在将 PayUmoney 支付网关集成到我的 MEAN 堆栈应用程序中。我正在获取从角度控制器到节点的每个必填字段,并且还生成了哈希键。之后,我不会重定向到“ https://test.payu.in/_payment ”。我试过如下
应用程序.js
router.post('/buyItem',function(req,res){
var KEY = "OygoFs";
var SALT = "BV1QBwCv";
var shasum = crypto.createHash('sha512'),
reqData = req.body;
dataSequence = KEY + '|' + reqData.txnid + '|' + reqData.amount + '|' + reqData.productinfo + '|' + reqData.firstname + '|' + reqData.email + '|||||||||||' + SALT;
resultKey = shasum.update(dataSequence).digest('hex');
res.redirect('https://test.payu.in/_payment');
});
当我运行这个错误来了。
XMLHttpRequest cannot load http://locahost:3000/api/buyItem. Redirect from 'http://locahost:3000/api/buyItem' to 'https://test.payu.in/_payment' has been blocked by CORS policy: Request requires preflight, which is disallowed to follow cross-origin redirect.