Firebase的云函数-getaddrinfo ENOTFOUND尝试向Paypal的API发出请求PayPal-Node-SDKexports.requestPayment = functions.https.onRequest((req, res) => {
return new Promise(function (fullfilled, rejected) {
paypal.payment.create(create_payment_json, {}, function (error, payment) {
if (error) {
rejected(error);
} else {
console.log("Create Payment Response");
console.log(payment);
res.status(200).send(JSON.stringify({
paymentID: payment.id })).end();
fullfilled(payment);
}
});
});});但我经常会犯一个错误:Error: getaddrinfo ENOTFOUND api.sandbox.paypal.com api.sandbox.paypal.com:443
at errnoException (dns.js:28:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)我尝试过的事情:向完全不同的主机提出请求ENOTFOUND将请求包装为cors(req,res, ()=>{...})预演https://寄给主人有什么问题吗?
3 回答
- 3 回答
- 0 关注
- 964 浏览
添加回答
举报
0/150
提交
取消