Can't get my IPN script to post back, or PayPal is not posting to my script "Verified".
The form:
The funny thing is if I remove:
The email comes through. Seems I just can't get the cfhttp to post back, or paypal is not posting back verified.
Does anyone see any problems? Any ideas? Has anyone gotten this to work?
I've been through PayPals script a 1000 times, paypal developer network script, easycfm.com's script. Im exausted and this is all I have left for this project to be complete ...
----------------------------------------
Florida Web Design
Orlando Web Hosting
Florida Coldfusion Hosting
Code:
<cfset x = GetHttpRequestData()>
<cfset str="cmd=_notify-validate&" & x.content>
<!-- POST BACK FOR VALIDATION -->
<cfhttp url="[URL unfurl="true"]https://www.paypal.com/cgi-bin/webscr?#str#"[/URL] method="get" resolveurl="false">
<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 "mypaypalemail@mysite.com">
<!-- Simplified for testing-->
<cfmail
to="myemail@me.com"
from="myemail@me.com"
subject="Pay Pal Order ">
Success
</cfmail>
</cfif>
</cfif>
</cfif>
The form:
Code:
<cfset paypalAccount = "myemail@me.com">
<cfset returnURL = "[URL unfurl="true"]http://www.mywebsite/paymentthanks.cfm">[/URL]
<cfset cancelURL = "[URL unfurl="true"]http://www.mywebsite/canceledpayment.cfm">[/URL]
<!-- Loop Through Cart Session To Get Total -->
<cfset ordertotal = 0>
<cfloop from="1" to="#ArrayLen(Session.Cart.ProductID)#" index="ThisItem">
<cfquery name="getItem" datasource="#request.dsn#" username="#request.dsnUsername#" password="#request.dsnPassword#">
SELECT ProductPrice,ProductCatID,ProductID,ProductName FROM Products WHERE ProductID = '#Session.Cart.ProductID[ThisItem]#'
</cfquery>
<cfset total = 0>
<cfset total = total + (getItem.ProductPrice * Session.Cart.Qty[ThisItem]) >
<cfset ordertotal = ordertotal + total>
</cfloop>
<!-- Find Member Id to submit to paypal as invoice -->
<cfquery name="getNewMemberID" datasource="#request.dsn#" username="#request.dsnUsername#" password="#request.dsnPassword#">
SELECT ID FROM Members WHERE ID = '#Session.InvoiceNumber#'
</cfquery>
<form action="[URL unfurl="true"]https://www.paypal.com/cgi-bin/webscr"[/URL] method="post">
<input type="hidden" name="cmd" value="_ext-enter" />
<input type="hidden" name="redirect_cmd" value="_xclick" />
<input type="hidden" name="business" value="<cfoutput>#paypalAccount#</cfoutput>" />
<input type="hidden" name="return" value="<cfoutput>#returnURL#</cfoutput>" />
<input type="hidden" name="cancel_return" value="<cfoutput>#cancelURL#</cfoutput>" />
<input type="hidden" name="item_name" value="Florida Council for the Social Studies Purchase" />
<input type="hidden" name="amount" value="<cfoutput>#DollarFormat(ordertotal)#</cfoutput>" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="invoice" value="<cfoutput>#getNewMemberID.ID#</cfoutput>" />
<input type="hidden" name="email" value="<cfoutput>#getNewMemberID.Email#</cfoutput>" />
<input type="hidden" name="notify_url" value="[URL unfurl="true"]http://www.fcss.org/gateway/paypal.cfm">[/URL]
<input type="hidden" name="rm" value="1">
<input type="image" src="[URL unfurl="true"]https://www.paypal.com/en_US/i/btn/x-click-but5.gif"[/URL] border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" />
</form>
The funny thing is if I remove:
Code:
<CFIF #CFHTTP.FileContent# is "VERIFIED">
The email comes through. Seems I just can't get the cfhttp to post back, or paypal is not posting back verified.
Does anyone see any problems? Any ideas? Has anyone gotten this to work?
I've been through PayPals script a 1000 times, paypal developer network script, easycfm.com's script. Im exausted and this is all I have left for this project to be complete ...
----------------------------------------
Florida Web Design
Orlando Web Hosting
Florida Coldfusion Hosting