Problem with Paypal since CF 9
Hi, I recently upgraded an old CF site from version 5 to version 9. Since then, my Instant Payment Notification from Paypal is broken. It CFHTTP the Paypal server, but the response is now INVALID instead of VERIFIED as it used to be. There must be something changed in the CFHTTP which makes the request look bad to Paypal. I don't know with which version since CF5 this would happen. Has any one encountered any similar problem? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336724 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with Paypal since CF 9
Things have changed a lot since CF5 and there is likley to be a fair few things that no longer work the same. If you cfdump the cfhttp results in CF5 and CF9 and compare them then you will see the difference. If you are using a 3rd party tag then there are more up to date ones you could use instead, take a look on www.easycfm.com for a tutorial to help you fix your existing code, or take a look at www.riaforge.org for an open source solution or www.cftagstore.com for a commercial solution. -- Russ Michaels www.cfmldeveloper.com - Supporting the CF community since 1999 FREE ColdFusion/Railo hosting for developers. blog: www.michaels.me.uk ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336726 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with Paypal since CF 9
If you cfdump the cfhttp results in CF5 and CF9 and compare them then you will see the difference. Not easy to to. The template is called by the Paypal server for every transaction. The template should return all form fields IN SAME ORDER in another CFHTTP request to Paypal. If everything looks fine, Paypal returns VERIFIED, other wise it returns INVALID. This template that I developped myself has been working fine for years, so I suspect the problem is not with Paypal. CF 9 must be doing something wrong in the HTTP request. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336736 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with Paypal since CF 9
As someone who is working on a new PayPal integration and has run into the same issue as you, make sure all form fields are lower case. I seem to remember CF defaulting to upper case in the transition to MX, Phil On Wed, Sep 1, 2010 at 1:15 PM, wrote: If you cfdump the cfhttp results in CF5 and CF9 and compare them then you will see the difference. Not easy to to. The template is called by the Paypal server for every transaction. The template should return all form fields IN SAME ORDER in another CFHTTP request to Paypal. If everything looks fine, Paypal returns VERIFIED, other wise it returns INVALID. This template that I developped myself has been working fine for years, so I suspect the problem is not with Paypal. CF 9 must be doing something wrong in the HTTP request. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336738 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with Paypal since CF 9
I'm pretty sure its it some sort of encoding problem. I've found this on the Paypal site: PayPal's IPN server expects that your script will POST back all variables that were posted to it and more importantly, that they are encoded the same way as they were sent to your script. If your script inadvertently changed the encoding of a character or interprets an encoded character as another character and POSTs back, you will likely see INVALID. Under CF5, everything was iso-8859-1 by default, now it is UTF-8. I can see Charset UTF-8 in the CFHTTP data, but there is also charset = windows-1252 in the form fields sent by Paypal. I checked, and the same template still works under CF5. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336742 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with Paypal since CF 9
There are two dates the come over encoded but aren't when you look at your string back that caused my issues initially and only when i outputted each form value and looked at the resulting string did I see the issue. I forget which ones they are and I'm not able to look at our listener right now, Phil On Wed, Sep 1, 2010 at 5:04 PM, wrote: I'm pretty sure its it some sort of encoding problem. I've found this on the Paypal site: PayPal's IPN server expects that your script will POST back all variables that were posted to it and more importantly, that they are encoded the same way as they were sent to your script. If your script inadvertently changed the encoding of a character or interprets an encoded character as another character and POSTs back, you will likely see INVALID. Under CF5, everything was iso-8859-1 by default, now it is UTF-8. I can see Charset UTF-8 in the CFHTTP data, but there is also charset = windows-1252 in the form fields sent by Paypal. I checked, and the same template still works under CF5. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336744 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Problem with Paypal since CF 9
There are two dates the come over encoded but aren't when you look at your string back that caused my issues initially Yeah, I've seen that. Fields ending with _date are not listed in form.fieldnames. Curiously enough, this bug was already in CF 5, but Paypal would accept the verification anyway. I added the date fields, but it still doesn't work under cf9 It is really a shame Paypal does not give any detail while in test mode about WHY the request is invalid. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336746 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm