Problem/Motivation

While testing the IPN support I noticed the module was reporting the data received from PayPal before sending the it back to them for validating the IPN, but it never went through the whole process of creating the Entity for populating the donations view and sending emails to the donor and to the admin.

Proposed resolution

I found out one issue was on the request to PayPal for IPN validation that was returning HTTP 400 Bad Request.
After researching a bit I noticed the issue was a matter of using the right HTTP version (1.1 instead of 1.0). The reason is the fact that the header "Host" is part of the HTTP 1.1 definition (and it is necessary for dealing with PayPal).

With the HTTP request working properly, I noticed there was an extra space character in the end of ever line from the response, leading the comparison that checks if it says "VERIFIED" to fail (response was bringing "VERIFIED ").
For dealing with this, I've changed the comparison and trimmed the response.

Links for the reference:

https://tools.ietf.org/html/rfc7230#section-5.4
http://www8.org/w8-papers/5c-protocols/key/key.html#SECTION0007000000000...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dscl created an issue. See original summary.

dscl’s picture

Issue summary: View changes

Adding extra issue on the VERIFIED comparison.

dscl’s picture

Priority: Normal » Major
Status: Active » Needs review
FileSize
943 bytes

Here is the patch for both issues.
Hope it helps.

  • dscl committed e4125e0 on 7.x-1.x
    Issue #2826757 by dscl: PayPal IPN not properly processed
    
dscl’s picture

Version: 7.x-1.03 » 7.x-1.x-dev
Status: Needs review » Fixed

Patch merged into 7.x-1.x-dev.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.