IPN Response Message is sent by paypal, received by my server, but the body is empty?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello there, basically we have a suscribe button and we have an IPN listener on the server, we receive the IPN listener just fine, but when we try to get the body to verify it, it comes up completely empty, although in the IPN history, it comes with all the correct information.
We're using a node server with body-parser and express
Here's the code.
app.post('/ipn', function (params, response) { response.sendStatus(200); console.log('accedio al ipn'); console.log(params.body); });
We send back the 200 status as states on the docs, then the request body is completely empty.
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I wouldn't send your own 200 response. That will happen automatically by the server if everything runs correctly. If not it would return a 500 and then IPN would know it needs re-try sending the data until it does get a 200 response. If you were going to send your own status you'd want to do it at the end of your script after everything has run.
I'm not very familiar with node, but it looks like you're basically calling an API via app.post() and pointing it to your IPN URL..?? You would need to first use PHP or something to process the data and save it to your own database. Then you could build your little web service to pull that data via node call from your own database.
PayPal Partner and Certified Developer - Kudos are Greatly Appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I removed the 200 status code but it still sends an empty body.
Supposedly I should be able to get the body without involving any database, or that's what I thought atleast... I need to get who made the payment so I can update ther state on the database.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The data is available in $_POST without saving to the database, but of course that's PHP I'm referring to. I'm assuming there is something similar with Node.
PayPal Partner and Certified Developer - Kudos are Greatly Appreciated!
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Paypal via Adyen Permission Denied in REST APIs
- permission_denied response in call to patch order when paying by Card in Braintree Client-side Integration (JS, iOS, Android SDKs)
- Compliance violation. flag based on the account origin ? in Sandbox Environment
- Payment confirmation button does not exist in PayPal Upgrade Community
- Some negative testing value only reply 403 Forbidden in Sandbox Environment