Permalink
Browse files

Changed the response handling to allow data to arrive in parts

  • Loading branch information...
1 parent ab33795 commit 077e4366fe6e0dde09747f8be44cc4cba31c370d @andzdroid committed Mar 26, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/paypal-ipn.js
View
@@ -24,8 +24,14 @@ exports.verify = function verify(params, callback) {
var req = https.request(req_options, function paypal_request(res) {
+ var data = [];
+
res.on('data', function paypal_response(d) {
- var response = d.toString();
+ data.push(d);
+ });
+
+ res.on('end', function response_end() {
+ var response = data.join('');
//Check if IPN is valid
callback(response != 'VERIFIED', response);

0 comments on commit 077e436

Please sign in to comment.