Firebase的云函數(shù)-getaddrinfo ENOTFOUND嘗試向Paypal的API發(fā)出請求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);
}
});
});});但我經(jīng)常會犯一個錯誤: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)我嘗試過的事情:向完全不同的主機(jī)提出請求ENOTFOUND將請求包裝為cors(req,res, ()=>{...})預(yù)演https://寄給主人有什么問題嗎?
- 3 回答
- 0 關(guān)注
- 994 瀏覽
添加回答
舉報(bào)
0/150
提交
取消