paypal / ipn-code-samples

Other
562 stars 486 forks source link

[GCP] Use rawBody on IPN sample (fixes INVALID responses) #157

Open Salakar opened 5 years ago

Salakar commented 5 years ago

This example wasn't working out the box for addresses or names with special characters, all requests were coming back as INVALID unless they had no special characters.

This issue relates to converting to JSON via express body-parser and then trying to convert back to a raw string via querystring.

As you can now access the raw body in GCP Functions (and Firebase) via rawBody (docs), I've swapped out querystring for using rawBody instead.

Tested on my project and now works correctly without INVALID messages.