Cloud-Funktionen für die FB - getaddrinfo ENOTFOUND

Versuchen, stellen Sie einen Antrag auf Paypal-API mit PayPal-Knoten-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);
            }
        });
     });
});

aber ich bin immer ein Fehler:

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)

Dinge, die ich versucht habe:

  1. Eine Anfrage an einen völlig anderen Rechner, noch ENOTFOUND
  2. Einwickeln der Anfrage mit cors(req,res, ()=>{...})
  3. Voranstellen https:// an den host

Was ist das problem?

InformationsquelleAutor user47376 | 2017-03-13
Schreibe einen Kommentar