Skip to main content

PayPal Community

  • Dashboard
  • Send and Request
  • Wallet
  • Business
  • Help
Log in
  • Welcome
    • Guidelines
    • News and Events
    • Suggestions for PayPal
    • General Discussions
  • PayPal Help Community
    • Managing Account
    • Transactions
    • Wallet
    • Security and Fraud
    • Products & Services
    • Reporting
  • MTS Community
    • PayPal Upgrade Community
    • PayPal Payments Standard
    • REST APIs
    • NVP/SOAP APIs
    • SDKs
    • Sandbox Environment
    • PayPal Reporting
    • Payflow
    • Ideas for MTS
    • Client-side Integration
    • Server-side Integration
  • The Archives
    • PayPal Help Community Archives
      • Managing Account Archives
      • Transactions Archives
      • Wallet Archives
      • Security and Fraud Archives
      • Products & Services Archives
      • Reporting Archives
    • Help Community
      • PayPal Basics Archives
      • Payments Archives
      • My Money Archives
      • My Account Archives
      • Disputes and Limitations Archives
      • Products and Services Archives
      • PayPal Credit Archives
    • Merchant Community
      • Merchant Products
      • Business Tools Archives
      • Reporting Archives
      • Managing Risk and Fraud Archives
    • Help Archives
      • About Business (Archive)
      • About Payments (Archive)
      • About Settings (Archive)
      • About eBay (Archive)
      • About Protections (Archive)
      • About Products (Archive)
    • Social and Your Voice Archives
      • Off Topic (Archive)
      • My Feedback for PayPal (Archive)
    • About PayPal Archives
      • Watercooler (Archive)
      • Tax Information (Archive)
      • Fees (Archive)
      • eBay and PayPal (Archive)
      • Coupons and promotions (Archive)
    • My Account Archives
      • My account settings (Archive)
      • Account limits and verification (Archive)
      • Account balance (Archive)
      • Bank accounts and credit cards (Archive)
    • Payments Archives
      • Sending money (Archive)
      • Receiving money (Archive)
      • Refunds (Archive)
      • Donations and Fundraising (Archive)
    • Disputes and Security Archives
      • Disputes and claims (Archive)
      • Fraud, phishing and spoof (Archive)
    • My Business Archives
      • Merchant services (Archive)
      • Reporting and tracking (Archive)
      • Shipping (Archive)
    • PayPal Products Archives
      • PayPal Debit Mastercard (Archive)
      • PayPal Extras MasterCard (Archive)
      • PayPal Mobile & Other Services (Archive)
      • Student Accounts (Archive)
      • Bill Me Later (Archive)
    • Getting to know PayPal
      • My PayPal account
      • Security and protection
    • Receiving and sending money
      • Buying with PayPal
      • Selling with PayPal
    • PayPal Here UK
      • PayPal Here News and Events
      • PayPal Here Community
      • Chip and Pin Card Reader
      • PayPal Here App

The Community Forum is not available for new posts or responses; previous posts remain available to review. For comprehensive support options, please visit PayPal.com/HelpCenter
Merchant Technical Support: For technical support and related questions, please visit our Technical Support Help Center or Developer Central

If you want to report illegal content under the EU Digital Services Act, please do so here

since ‎Jun-18-2020
WaluigiDev
WaluigiDev
New Community Member
1
Post
0
Kudos
0
Solutions
Active
View all
Latest Contributions by WaluigiDev
  • Topics WaluigiDev has Participated In
  • Latest Contributions by WaluigiDev

PayPal IPN NodeJS production invalid, sandbox is v...

by WaluigiDev in REST APIs
‎Jun-18-2020 11:23 AM
‎Jun-18-2020 11:23 AM
Our sandbox/testing environment is able to verify IPNs from paypal, they return 'VALID'. However, our production IPN validation, being the same as our sandbox validation just with the production URL to 'https://ipnpb.paypal.com/cgi-bin/webscr', always returns 'INVALID'. The content of the IPN body is almost identical, just changing a few alphanumeric values and no new special characters. We also made sure the buttons on the front-end pointed to the right URLs/environment. Is there something we are missing? We went through all the troubleshooting on PayPal developer's site, but we still cannot get an IPN to be valid. Here is the code: ``` let postreq = 'cmd=_notify-validate' // Iterate the original request payload object and prepend its keys and values to the post string Object.keys(req.body).map((key) => { postreq = `${postreq}&${key}=${req.body[key]}` return key }) const options = { url: 'https://ipnpb.paypal.com/cgi-bin/webscr', // production // url: 'https://ipnpb.sandbox.paypal.com/cgi-bin/webscr', // sandbox method: 'POST', headers: { 'Content-Length': postreq.length }, encoding: 'utf-8', body: postreq } // Request to paypal to verify authenticity of IPN request request(options, (error, response, resBody) => { if (error || response.statusCode !== 200) { reject(new Error(error)) return } // Validate the response from PayPal and resolve / reject the promise. if (resBody.substring(0, 😎 === 'VERIFIED') { // resolve(true) isValidIPN = true console.log('PAYPAL IPN OBJECT: ', resBody) } else if (resBody.substring(0, 7) === 'INVALID') { console.log('IPN Message is invalid.') console.log(resBody) } else { console.log('Unexpected response body.') console.log('URB error: ', new Error(error)) } // Do database actions }   ``` ... View more
Paypal Logo
  • Help
  • Contact Us
  • Security
  • Fees
  • © 1999-2025 PayPal, Inc. All rights reserved.
  • Privacy
  • Legal
  • Cookies
  • Policy Updates

The money in your balance is eligible for pass-through FDIC insurance.

The PayPal Cash Mastercard is issued by The Bancorp Bank pursuant to a license by Mastercard International Incorporated. The Bancorp Bank; Member FDIC.

Powered by Khoros
Welcome to the PayPal Community!