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

Does Coldfusion really work with IPN? Options
rickaclark
#1 Posted : Thursday, December 22, 2005 8:15:10 PM
Rank: Starting Member

Groups: Registered

Joined: 12/22/2005
Posts: 2
Location: ,
I have read manuals 'til I am blue in the face. I have tried every way I can to have Paypal send my variables back to my site, only to have an error message telling me the data forms do not exist. I searched several forums and the overriding sentiment is people can't get coldfusion to work with IPN. I am using the Coldfusion SDK files, but they aren't working. I am trying to get my data from Paypal and insert it into an access database for tracking purposes. Anybody have any advice or suggestions?
Sponsor  
 
ziggyziggy
#2 Posted : Friday, December 23, 2005 2:10:44 AM
Rank: Starting Member

Groups: Registered

Joined: 12/19/2005
Posts: 15
Location: ,
if you mean form variables are missing there is another format to avoid a bug. see the post about working code.

Then again, I just get back INVALID because not exactly whatwas posted to me it seems, but no idea why.
rickaclark
#3 Posted : Friday, December 23, 2005 3:14:23 PM
Rank: Starting Member

Groups: Registered

Joined: 12/22/2005
Posts: 2
Location: ,
I tired using the scripts from the following post:
http://www.paypaldev.org...erms=coldfusion,and,IPN

I used the following ipn script:
<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>

<!-- assign posted variables to local variables -->
<CFSET receiver_email=FORM.receiver_email>


<!-- note: additional IPN variables also available -- see IPN documentation

<CFSET item_name=FORM.item_name>
<CFSET payment_status=FORM.payment_status>
<CFSET payment_gross=FORM.payment_gross>
<CFSET txn_id=FORM.txn_id>
<CFSET payer_email=FORM.payer_email>
<CFIF IsDefined("FORM.item_number")>
<CFSET item_number=FORM.item_number>
</CFIF>

-->

<!-- check notification validation -->
<CFIF #CFHTTP.FileContent# is "VERIFIED">

<cfoutput>
Email: #FORM.receiver_email#<br />
Name: #form.first_name# #form.last_name#<br />
Payment Status: #form.payment_status#<br />
It works!
</cfoutput>

<!-- check that payment_status=Completed -->
<!-- check that txn_id has not been previously processed -->
<!-- check that receiver_email is your email address -->
<!-- process payment -->

<CFELSEIF #CFHTTP.FileContent# is "INVALID">
<!-- log for investigation -->

It's not being verified!

<CFELSE>
<!-- error -->
</CFIF>
<!--- end script --->

I used the following form, suggested by paypa_pb, to test the ipn script and it worked fine:

<form method="post" action="http://www.heartlandcommunitychurch.com/cart/ipn_new.cfm">
<input type="submit" name="" value="Test IPN">
<input type="hidden" name="payment_date" value="17:53:45 Nov 5, 2002 PST">
<input type="hidden" name="txn_type" value="web_accept">
<input type="hidden" name="last_name" value="Breitenbach">
<input type="hidden" name="item_name" value="">
<input type="hidden" name="payment_gross" value="0.01">
<input type="hidden" name="mc_currency" value="USD">
<input type="hidden" name="payment_type" value="instant">
<input type="hidden" name="verify_sign" value="AlWncXKLadIepzMosHhM.VWxC0Z6AZYI0ynXRnEUma0d3RMC.TXWaJro">
<input type="hidden" name="payer_status" value="unverified">
<input type="hidden" name="payer_email" value="pb-test@paypal.com">
<input type="hidden" name="txn_id" value="01G32341KC3727119">
<input type="hidden" name="first_name" value="Patrick">
<input type="hidden" name="quantity" value="1">
<input type="hidden" name="receiver_email" value="pb-sell@paypal.com">
<input type="hidden" name="payer_id" value="QGVDAFGZ9XHLJ">
<input type="hidden" name="payment_method" value="non_cc">
<input type="hidden" name="item_number" value="">
<input type="hidden" name="payment_status" value="Completed">
<input type="hidden" name="mc_gross" value="0.01">
<input type="hidden" name="custom" value="">
<input type="hidden" name="notify_version" value="1.4">
</form>
<!--- end script --->

But when I changed the ipn script to run in snadbox with:
<!-- post back to PayPal system to validate -->
<CFHTTP URL="https://www.sandbox.paypal.com/cgi-bin/webscr?#str#" METHOD="GET" RESOLVEURL="false">
</CFHTTP>

and used the following form:
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="rick@rickclark.com">
<input type="hidden" name="item_name" value="golf shirt">
<input type="hidden" name="item_number" value="hwc1001">
<input type="hidden" name="amount" value="25.00">
<input type="hidden" name="return" value="http://heartlandcommunitychurch.com/cart/ipn_new.cfm">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/x-click-but23.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>

I get the following error:
Element FIELDNAMES is undefined in FORM.

This is what brings me to wonder if I really want to delve into paypal and coldfusion. Any suggestions?
ziggyziggy
#4 Posted : Sunday, December 25, 2005 6:56:32 AM
Rank: Starting Member

Groups: Registered

Joined: 12/19/2005
Posts: 15
Location: ,
Yes, do what I said: "there is another format to avoid a bug. see the post about working code."
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.335 seconds.