Funciones en la nube para Firebase - getaddrinfo ENOTFOUND
Intentando hacer una solicitud a la API de Paypal usandoPayPal-nodo-SDK
exports.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);
}
});
});
});
pero constantemente recibo un error:
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)
Cosas que he probado:
Hacer una solicitud a un host totalmente diferente, aúnENOTFOUND
Envolviendo la solicitud concors(req,res, ()=>{...})
Antecedentehttps://
al anfitrión¿Cuál es el problema?