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

Passing variables from Paypal to CF. Options
scoppard@xtra.co.nz
#1 Posted : Wednesday, October 15, 2003 6:56:48 AM
Rank: Starting Member

Groups: Registered

Joined: 10/15/2003
Posts: 1
Location: ,
Hi there, I would like to achieve the following: 1) A user fills in a CF form to subscribe for my service. A session variable is defined at this point for my user. 2) They are posted to the Paypal site where I use CF to pre-populate the customer details. 3) On successful payment, I need to direct them back to my success CF page with a variable (session or other passed in my originating form). 4) I then use this variable to process the purchase and update my database. I can't seem to see how I can get a variable back from Paypal but I can pass one to it (as a custom hidden field etc). Is the IPN my only solution? This doesn't seem to pass back the variable I need either? Can you please help? Cheers. Steve New Zealand
Sponsor  
 
Ms Reba
#2 Posted : Monday, October 20, 2003 8:20:07 PM
Rank: Starting Member

Groups: Registered

Joined: 9/23/2003
Posts: 10
Location: ,
I am having the same problem. I can't even get my IPN to work. Totally lost.

<!---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>


Above code giving me an error:

Error resolving parameter FORM.FIELDNAMES

Just when I think I'm catching on -- BAM! I hit a brick wall. Please if anyone can help. I'm sure we would be greatful.

Live well, laugh often, love much AND "Pay it forward"
Ms Reba
#3 Posted : Monday, October 20, 2003 8:26:14 PM
Rank: Starting Member

Groups: Registered

Joined: 9/23/2003
Posts: 10
Location: ,
I can't figure out what the #Form.FieldNames# should be. I tried the same field names as my hidden input but....

Live well, laugh often, love much AND "Pay it forward"
Azriel
#4 Posted : Sunday, November 23, 2003 9:41:31 PM
Rank: Starting Member

Groups: Registered

Joined: 11/21/2003
Posts: 4
Location: ,
Ms Reba,

Do you have IPN enabled in your Paypal account. The way IPN works is to send form variables to a page you designate in your Paypal user area. IPN has nothing to do with your return page: <input type="hidden" name="return" value="http://www.yoursite.com/blah.cfm">. Think it might help ya to read a bit more of the documentation explaining how IPN works.
MultimediaGuy
#5 Posted : Tuesday, May 11, 2004 12:24:36 PM
Rank: Starting Member

Groups: Registered

Joined: 5/10/2004
Posts: 3
Location: ,
Azriel - I am getting the same error as Ms Reba, and I have read the manuals until I am blue in the face - I cannot get this thing working no matter what I do, and it always comes ack with the error: Error resolving parameter FORM.FIELDNAMES on Line 20. I have tried just about EVERY sample code posted on this forum, as well as the sample code from PayPal's site.

I HAVE IPN enabled in my account as well...

There are alot of very frustrated people on these forums - all trying to get this thing working. The least PayPal could do is to post a better example script, or at least address the issues with the one they have posted.

Arg!
jmarin@jadeinc.com
#6 Posted : Wednesday, July 13, 2005 6:52:01 PM
Rank: Starting Member

Groups: Registered

Joined: 6/29/2005
Posts: 11
Location: ,
I'd love to see an example of how to make this work.
Abinidi
#7 Posted : Tuesday, July 26, 2005 5:07:06 AM
Rank: Starting Member

Groups: Registered

Joined: 7/24/2004
Posts: 2
Location: ,
You want to pass the variable in the URL of the return page:
EX:

<cfhttpparam type="formfield" name="return" value="http://www.yourdomain.com/signupcomplete.cfm?user=#session.username#">

And this to your ipn 'notify' page:

<cfhttpparam type="formfield" name="notify_url" value="http://www.yourdomain.com/ipnpage.cfm?user=#session.username#">


Then on the page you have processing the IPN, declare somewhere in the code the url variable since the notify page will pass the url variable to that page, you will be able to use it:

<cfset Username = '#url.user#'>

Then query this against your db, and update the records based on that user.

You should of created the db records prior on your site when they created the account, perhaps on your signup page or whatever.

Send me an email if you need more help. I managed last year to get it working. I am currently creating a CFC that will do all the functions better, as I sometimes get errors.
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.510 seconds.