Estou com um pequeno probleminha muito chato :c Toda vez que eu tento obter uma assinatura usando o paypal.billingPlan.get, sempre retorna um error 500. Estou sofrendo com isso a 2 dias, já postei isso no Github e ninguém me respondeu até agora. https://github.com/paypal/PayPal-node-SDK/issues/431 Gostaria de saber se sou a única ou estou fazendo algo errado. O script é este aqui: var fs = require('fs'); var http = require('http'); var https = require('https'); var privateKey = fs.readFileSync('server.key', 'utf8'); var certificate = fs.readFileSync('server.crt', 'utf8'); var credentials = {key: privateKey, cert: certificate}; var express = require('express'); var app = express(); var bodyParser = require('body-parser'); var paypal = require('paypal-rest-sdk'); app.use(bodyParser.json()); // to support JSON-encoded bodies app.use(bodyParser.urlencoded({ // to support URL-encoded bodies extended: true })); paypal.configure(); app.post('*', function (req, res) { console.log(req.body); paypal.notification.webhookEvent.getAndVerify(JSON.stringify(req.body), (error, response) => { if(response === true || response === "true") { console.log(req.body.resource.plan_id); paypal.billingPlan.get(req.body.resource.plan_id, function (error, billingPlan) { if (!error) { console.log("Get Billing Plan"); console.log(billingPlan); if(req.body.event_type === "BILLING.SUBSCRIPTION.CREATED"){ } } else { console.error(error); } }); } res.end(); }); }); // your express configuration here var httpServer = http.createServer(app); var httpsServer = https.createServer(credentials, app); httpServer.listen(80);
... View more