ColdFusion and PayPal IPN
After a few hours of trying to get the paypal IPN verification process to work I was at my wits end. According to their code samples all that is required is to loop over the form.fieldNames variable. Sounds simple enough. But after hours of trying to get it to work, different combinations of lCase, urlEncodedFormat, etc. I know that coldfusion organizes the FORM structure in an alpha order by key, but the fieldnames should stay in their original order.
I finally thought to look at the GETHTTPREQUESTDATA().content, the variable order didn’t match what was in the form.fieldNames list.
First try after changing the verification string it worked like a champ, hopefully this post can save someone some grief.
<cfset postData = GETHTTPREQUESTDATA()>
<cfset verifyURL = "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_notify-validate&#postData.content#">


say wwwwwhat?
The error (as I ran into this same issue) is not that the order is different, it is that coldfusion adds a variable to the form scope. So, this being the case, when you loop through your form variable to recreate the post back to paypal you are thus adding the FIELDNAMES variable and thus making the callback INVALID.
Do your loop as normal and just make sure you are not adding form.FIELDNAMES to your callback.