-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to configure webhooks from stripe to parse server #234
Comments
Have you checked your keys are set-up correctly? A workaround: in index.js (if you used the demo app or in your express routes) you could pass your token etc
|
Thank you for your help, I could find a solution by doing these modifications: You must have in your code:
then add: and finally the code to receive webhook and launch function from cloud code:
In webhook testing mode on stripe I get the response from my cloud code function, in that case "hello world!" |
@cyboolo hi so are webhooks working for you with parse-server and cloudcode? |
Just making this a little clearer for people still having trouble. Also this express doc was super helpful for me. https://expressjs.com/en/api.html#req I was using a webhook with twilio. // index.js
var hooks = require('./cloud/hooks');
var bodyParser = require('body-parser');
//...
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
app.post('/receiveSMS', function(req, res) {
console.log("RECEVIED SMS FROM: " + req.body.From);
console.log("Body: " + req.body.Body);
var passedRequest = {"params": req.body}; // That's how my receiveSMS function expects it. You may not need this.
hooks.receiveSMS(passedRequest, {
success: function(obj) {
res.status(200).send(obj);
},
error: function(error) {
res.status(500).send(error);
}
});
}); Then in hooks.js var client = require('twilio')('keys','andsuch');
var SomeParseObjectYouMightNeed = Parse.Object.extend("SomeParseObjectYouMightNeed");
exports.receiveSMS = function(request, response) {
//...
}; |
Hi |
Cofirming working solution:
|
Hi,
Before migration this webhook configured on stripe dashboard worked perfectly:
https://<**myParseapp**>:javascript-key=<**myJSkey**>@api.parse.com/functions/new_invoice
Now, when I try to do the same with my parse server on heroku:
https://<**myParseapp**>:javascript-key=<**myJSkey**>@something.herokuapp.com/parse/functions/new_invoice
I got error "403 unauthorized" when I test this webhooks from stripe dashboard.
How could I fix that please?
The text was updated successfully, but these errors were encountered: