|
Rank: Starting Member
Groups: Registered
Joined: 7/30/2004 Posts: 1 Location: ,
|
I have read through a ton of the posts so far, and cam up with what I thought was the best solution for entering some variables into my database upon completion of payment. I am using the #FORM.FormFields# method just like the sample, and I came into a few problems.
First problem: It said error resolving parameter #FORM.txn_id#.
Second problem: Error resolving parameter #FORM.custom#.
Third problem: Error resolving parameter #FORM.FormFields#.
Does the #FORM.FormFields# parameter exist with PayPal? It sounds as if that doesn't even exist with all of the complaints people are explaining. And why would it come back with the other two errors? Either the fields do not exist and the code is useless, or I'm missing something. Let me know if anyone has any solutions. I appreciate it!
-----------------------------------------------------------------
<CFQUERY>
SELECT XXX
FROM XXX
WHERE XXX = '#FORM.txn_id#'
</CFQUERY>
<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>
<CFHTTP URL="https://www.paypal.com/cgi-bin/webscr?#str#" METHOD="GET" RESOLVEURL="false"></CFHTTP>
<CFIF #CFHTTP.FileContent# is "VERIFIED">
<CFIF #FORM.payment_status# eq "Completed">
<CFIF #XXX.RecordCount# eq "0">
<CFIF #FORM.receiver_email# eq "XXX">
<CFIF #FORM.mc_gross# eq "XXX">
<CFQUERY>
UPDATE XXX
SET XXX = 1,
XXX = '#FORM.txn_id#'
WHERE XXX = '#FORM.custom#'
</CFQUERY>
</CFIF>
</CFIF>
</CFIF>
</CFIF>
<CFELSEIF #CFHTTP.FileContent# is "INVALID">
<CFQUERY>
UPDATE XXX
SET XXX = 0
WHERE XXX = '#FORM.custom#'
</CFQUERY>
</CFIF>
- WaDsTa
|