Forums: extra fields - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

extra fields

#1 User is offline   griller 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 17-April 08

Posted 02 July 2008 - 02:55 PM

Hi
I need to pass some extra fields to paypal and then pass them back into the database when the user has payed

I have added 2 fields to the members database, "packagename" and "packagevalue"
I want these so that I can later use the values to detemine which package a user has paid for and impose limits.

I have added the following to the paypal_submit event

if request.form("ppal")="ok" and (session("ppuid")<>"" or request.form("uid")<>"") then
if request.form("uid")<>"" then session("ppuid")=request.form("uid")
if request.form("paytype")<>"" then ptype=request.form("paytype")
Set rstmp = server.CreateObject("ADODB.Recordset")
tmpSQL="select * from prices where ID=" & ptype
rstmp.open tmpSQL, dbConnection
price=replace(rstmp("Price"),",",".")
packagename=replace(rstmp("Packagename"),",",".")
packagelevel=replace(rstmp("Packagelevel"),",",".")
rstmp.close
tmpSQL="select * from options"
rstmp.open tmpSQL, dbConnection
IPNPage=rstmp("IPNaddress")
psuccess=rstmp("Successpage")
pcancel=rstmp("Cancelpage")
email=rstmp("Ppemail")
rstmp.close
info = "<BODY onload=""document.forms.xclick.submit();"">"
info=info & "<FORM name=xclick action=""https://www.paypal.com/cgi-bin/webscr"" method=post>"
info=info & "<input type=""hidden"" name=""cmd"" value=""_xclick"">"
info=info & "<input type=""hidden"" name=""business"" value=""" & email & """>"
' info=info & "<input type=""hidden"" name=""currency_code"" value=""" & dataInfo("Currency") & """>"
info=info & "<input type=""hidden"" name=""item_name"" value=""Registration"">"
info=info & "<input type=""hidden"" name=""amount"" value=""" & price & """>"
info=info & "<input type=""hidden"" name=""quantity"" value=""1"">"
info=info & "<input type=""hidden"" name=""item_number"" value=""" & SESSION("ppuid") & """>"
info=info & "<input type=""hidden"" name=""custom"" value=""" & ptype & """>"
info=info & "<input type=""hidden"" name=""package"" value=""" & packagename & """>"
info=info & "<input type=""hidden"" name=""level"" value=""" & packagelevel & """>"


How do I post this to paypal and then update the database with the extra fields on customer completing payment?
0

#2 User is online   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 16046
  • Joined: 03-February 03

Posted 04 July 2008 - 04:58 PM

Your code looks good to me.

Just make sure the following appears as two lines in your code:

packagelevel=replace(rstmp("Packagelevel"),",",".") 
rstmp.close

Best regards,
Sergey Kornilov
0

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked