Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
neilorourker #1
IPN not returning any form feilds
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.
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.ar
tistid#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:
<cfparam name="Form.FieldNames" default="">
<!-- 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(The Field))#">
</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 [email]neil@galleries-online.co.uk[/email]</p>
</cfif>
<cfelse><p>Payment not complete</p>
</cfif>
<cfelse><p>Not verified</p>
</cfif>
Without the CFparam tag I get an error stating that the variable
Form.FieldNames is not recognised.
I have a feeling I am missing something really obvious here!
Cheers
Neil
neilorourker Guest
-
Creating PDF with Form Feilds - Upgrade?
I am using Acrobat 7 Pro. Need to do: I need to create PDFs that my client can open then be able to type in bits of information and print the PDF... -
Returning form data for list of radio buttons
I am returning a DB query for a set of radio buttons and I am naming them based on the count: <cfouput query="..."> <cfset count = count + 1>... -
access - how can I make feilds into clickable links?
ok what I want to do is pull the feilds from teh database but what is really giving me probs is I want a list of headlines that when clicked will... -
Returning to a form
Hello I hope someone can help me. I have a form page a user needs to fill out. I want to be able to send the user back to the form once it is... -
[PHP] Returning FORM vars from popup
Hi, use onSubmit() and if you have trouble with it please refer to the javascript manual, this list is for php all the best Rich Fox...



Reply With Quote

