use*_*376 48 dns paypal node.js firebase google-cloud-functions
尝试使用PayPal-node-SDK向Paypal的API发出请求
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);
            }
        });
     });
});
但我经常收到一个错误:
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)
我试过的事情:
ENOTFOUNDcors(req,res, ()=>{...})https://主持人问题是什么?
Jam*_*els 110
您需要制定付费计划才能发出外部API请求.
Firebase的Blaze计划(按需付费)可以免费分配云功能.https://firebase.google.com/pricing/
| 归档时间: | 
 | 
| 查看次数: | 19755 次 | 
| 最近记录: |