I'm having some issues with PayPal. I did a CFDUMP of the CFHTTP and got this:
THis is my code:
Any ideas?
____________________________________
Just Imagine.
Code:
CFHTTP - struct
Charset [empty string]
ErrorDetail I/O Exception: peer not authenticated
Filecontent Connection Failure
Header [undefined struct element]
Mimetype Unable to determine MIME type of file.
Responseheader struct [empty]
Statuscode Connection Failure. Status code unavailable.
Text YES
THis is my code:
Code:
<cfif attributes.method is "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 to PayPal system to validate --->
<CFHTTP URL="[URL unfurl="true"]https://www.paypal.com/cgi-bin/webscr?#str#"[/URL] METHOD="GET" RESOLVEURL="false"></CFHTTP>
<!--- debugging --->
<cfoutput>
#cfhttp.filecontent#
<p> </p>
<strong>str -</strong> #str#
<p> </p>
<a href="[URL unfurl="true"]https://www.paypal.com/cgi-bin/webscr?#str#">https://www.paypal.com/cgi-bin/webscr?#str#</a>[/URL]
</cfoutput>
<!-- check notification validation -->
<CFIF #CFHTTP.FileContent# is "VERIFIED">
<cfif FORM.payment_status eq "Completed">
<cfif #FORM.RECEIVER_EMAIL# eq "paypal@emailaddresshere.com">
<!-- process payment -->
<cftry>
<cfmail to="" from="" subject="" bcc="" type="html">
SEND CUSTOME EMAIL AND BCC CLIENT...
</cfmail>
<cfcatch>
ERROR!!
</cfcatch>
</cftry>
</cfif>
</cfif>
<CFELSEIF #CFHTTP.FileContent# is "INVALID">
<!-- log for investigation -->
Something that was purchased was invalid, either the order or the information provided.
This is usually good to log in case someone is trying to purchase with stolen card numbers, etc.
Here simply place a QUERY tag that insert the data above into a database.
<CFELSEIF #CFHTTP.FileContent# is "Connection Failure">
<cfdump var="#CFHTTP#" label="CFHTTP">
<CFELSE>
<!-- error -->
This usually means that something went wrong along the way, you can use this area to log it and keep for your records.
</CFIF>
</cfif>
Any ideas?
____________________________________
Just Imagine.