YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

form.fieldnames not recieved from IPN Options
neilorourke
#1 Posted : Friday, May 13, 2005 11:21:07 AM
Rank: Starting Member

Groups: Registered

Joined: 5/13/2005
Posts: 1
Location: ,
I am setting up a simple subcription process using Paypals IPN to update my database. For some reason IPN does not appear to be posting any feilds to my action page. I just get an error saying that the variable form.fieldnames cannot be resolved The form is as follows: <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick-subscriptions"> <input type="hidden" name="bn" value="webassist.dreamweaver.4_0_2"> <input type="hidden" name="business" value="neil@galleries-online.co.uk"> <input type="hidden" name="item_name" value="Bronze"> <input type="hidden" name="item_number" value="1"> <input type="hidden" name="currency_code" value="GBP"> <input type="hidden" name="a3" value="1"> <input type="hidden" name="p3" value="1"> <input type="hidden" name="t3" value="M"> <input type="hidden" name="return" value="http://www.galleries-online.co.uk/cms/a_subscribeupdate.cfm"> <cfoutput><input type="hidden" name="cancel_return" value="http://www.galleries-online.co.uk/cms/artist_cms.cfm?artistid=#session.artistid#content=subscribecancel"></cfoutput> <input type="hidden" name="src" value="1"> <input type="hidden" name="sra" value="1"> <input type="hidden" name="receiver_email" value="neil@galleries-online.co.uk"> <input type="hidden" name="mrb" value="R-3WH47588B4505740X"> <input type="hidden" name="pal" value="ANNSXSLJLYR2A"> <input type="hidden" name="payer_id" value="#session.artistid#"> <input type="hidden" name="no_shipping" value="1"> <input type="hidden" name="no_note" value="1"> <input type="image" name="submit" src="http://images.paypal.com/images/x-click-butcc.gif" border="0" alt="Make payments with PayPal, it's fast, free, and secure!"> </form> And the script used to recieve validation is as follows: <!-- 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 to PayPal system to validate --> <CFHTTP URL="https://www.paypal.com/cgi-bin/webscr?#str#" METHOD="GET" RESOLVEURL="false"> </CFHTTP> <!-- check notification validation --> <CFIF #CFHTTP.FileContent# is "VERIFIED"> <!-- check that payment_status=Completed --> <cfif FORM.payment_status eq "Completed"> <!-- check that receiver_email is your email address --> <cfif #FORM.RECEIVER_EMAIL# eq "neil@galleries-online.co.uk"> <!-- process payment --> <cftry> <cfquery name="qInsertOrder" datasource="#ds#"> INSERT INTO tbl_artists( package ) VALUES( '#FORM.ITEM_NUMBER#' ) WHERE artistid=#form.payer_id# </cfquery> <cfcatch> <!--- log all errors ---> <cffile action="append" file="D:\WWWRoot\galleries-onlineco.uk\www\paypal_logs\paypal_log.txt" output="Error order info"> </cfcatch> </cftry> <cfelse><p>email not neil@galleries-online.co.uk</p> </cfif> <cfelse><p>Payment not complete</p> </cfif> <cfelse><p>Not verified</p> </cfif> I have a feeling I am missing something really obvious here! Cheers Neil
Sponsor  
 
jdevine
#2 Posted : Friday, May 20, 2005 11:22:26 AM
Rank: Starting Member

Groups: Registered

Joined: 3/7/2005
Posts: 4
Location: ,
Hi Neil,

Try replacing:

&lt;!-- read post from PayPal system and add 'cmd' --&gt;
&lt;CFSET str="cmd=_notify-validate"&gt;
&lt;CFLOOP INDEX="TheField" list="#Form.FieldNames#"&gt;
&lt;CFSET str = str &
"#LCase(TheField)#=#URLEncodedFormat(Evaluate(TheField))#"&gt;
&lt;/CFLOOP&gt;
&lt;CFIF IsDefined("FORM.payment_date")&gt;
&lt;CFSET str = str &
"&payment_date=#URLEncodedFormat(Form.payment_date)#"&gt;
&lt;/CFIF&gt;
&lt;CFIF IsDefined("FORM.subscr_date")&gt;
&lt;CFSET str = str &
"&subscr_date=#URLEncodedFormat(Form.subscr_date)#"&gt;
&lt;/CFIF&gt;
&lt;!-- post back to PayPal system to validate --&gt;
&lt;CFHTTP URL="https://www.paypal.com/cgi-bin/webscr?#str#" METHOD="GET"
RESOLVEURL="false"&gt;
&lt;/CFHTTP&gt;


With:

&lt;!-- read post from PayPal system and add 'cmd' --&gt;
&lt;cfset x = GetHttpRequestData()&gt;
&lt;CFSET str="cmd=_notify-validate&" & x.content&gt;
&lt;CFIF IsDefined("FORM.payment_date")&gt;
&lt;CFSET str = str & "&payment_date=#URLEncodedFormat(Form.payment_date)#"&gt;
&lt;/CFIF&gt;
&lt;CFIF IsDefined("FORM.subscr_date")&gt;
&lt;CFSET str = str & "&subscr_date=#URLEncodedFormat(Form.subscr_date)#"&gt;
&lt;/CFIF&gt;

&lt;!-- post back to PayPal system to validate --&gt;
&lt;CFHTTP URL="https://www.paypal.com/cgi-bin/webscr?#str#" METHOD="GET" RESOLVEURL="false"&gt;&lt;/CFHTTP&gt;

Let me know if that helps.

Thanks!
Jenny
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFVision Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF | YAF © 2003-2009, Yet Another Forum.NET
This page was generated in 0.097 seconds.