Jump to content


Photo

Cold Fusion IPN Code Does Not Work!


  • This topic is locked This topic is locked
4 replies to this topic

#1 jpsalit

jpsalit

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 27 December 2002 - 02:20 PM

Greetings,
I've been trying to make the available sample IPN Cold Fusion code work (from PayPal, from easycfm.com, from superfreaker.com, etc.) for the last couple of days. None of my debugging attemps has really shed any light on what the problem might be. Currently, this code seems to fail while attempting to reply back to PayPal.

<!-- Read post from PayPal system and add 'cmd' -->
<CFSET str="cmd=_notify-validate">
<CFLOOP INDEX="TheField" list="#Form.FieldNames#">
<CFSET str = str & "#LCase(TheField)#=#URLEncodedFormat(Evaluate(TheField))#">
</CFLOOP>
<CFIF IsDefined("FORM.payment_date")>
<CFSET str = str & "&payment_date=#URLEncodedFormat(Form.payment_date)#">
</CFIF>
<CFIF IsDefined("FORM.subscr_date")>
<CFSET str = str & "&subscr_date=#URLEncodedFormat(Form.subscr_date)#">
</CFIF>

<!-- Post back for validation -->
<cfhttp url="https://www.paypal.com/cgi-bin/webscr" method="POST" resolveurl="no">
<cfhttpparam type="FORMFIELD" name="cmd" value="#str#">
</CFHTTP>

My CF logs indicate the error "(code segment has wrong length)" when trying to process this page. Interestingly, part of this code sends an email on failure and I do get a valid Transaction ID from this code when testing with eliteweaver; however, I do NOT get the Transaction ID when testing with PayPal - live!?

Does anyone know what that means? Has anyone encountered this problem? Can anyone debug that Loop or the Post-Back? This is terribly frustrating as it seems there are only a couple of us out there having this same problem and no real answers on the horrizon.

Particulars:
Cold Fusion MX
Windows 2K Enterprise Server (SP2)
IIS 5.0 (totally patched)
IIS Lockdown tool as Exchange Webmail Server
URLSCAN (default from Lockdown tool)
Exchange 2000 (SP3)
Trend Antivirus (Server & for Exchange)
IPN Code is for a Subscription Transaction

Help! Thanks in advance for any guidance!

Jason


#2 jpsalit

jpsalit

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 27 December 2002 - 03:09 PM

Clarification:
"Interestingly, part of this code sends an email on failure and I do get a valid Transaction ID from this code when testing with eliteweaver; however, I do NOT get the Transaction ID when testing with PayPal - live!?"

Indicates that even the partially working aspects will fail when processed directly by PayPal. Has anything changed since these demo's were posted? And if so, how come all the working systems didn't break?

Thanks again,

Jason


#3 jmercmon

jmercmon

    Member

  • Members
  • PipPip
  • 14 posts

Posted 16 January 2003 - 07:19 AM

jpsalit,

Please consider trying my custom code I have written for handling IPN's from Paypal. It is written in CF and very easy to use and customize.

http://jshop.homeip...._paypal_ipn.cfm

Thanks
Jason

#4 RobertD

RobertD

    Member

  • Members
  • PipPip
  • 10 posts

Posted 16 March 2003 - 11:17 AM

Just downloaded your code. Figured for $20 what the hey.
(It would be really nice if you used indents around if's so we can read it. )

However, your code does not overcome the basic problem I have with the setup. When originally getting the message from PP I do NOT get a valid #form.fieldnames#

Can you explain that?

Robert


<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by jmercmon
[br]jpsalit,

Please consider trying my custom code I have written for handling IPN's from Paypal. It is written in CF and very easy to use and customize.

http://jshop.homeip...._paypal_ipn.cfm

Thanks
Jason
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

#5 jmercmon

jmercmon

    Member

  • Members
  • PipPip
  • 14 posts

Posted 16 March 2003 - 11:25 AM

Robert,

Please email me with your problem and I will help you resolve it. My email is included in the ipn code.

Jason




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users