|
Rank: Starting Member
Groups: Registered
Joined: 5/21/2011 Posts: 1 Location: Sterling Height, MI
|
Here is what i am trying to do. Is this possible or is there a better way?
I have a sign up form for membership to my web site. The only cost is $25 for a year. I want to form to submit, go back to the top of the page (by leaving the action=''), use a isDefined('Submit') to insert the person's information into the database, then return the new ID number, send it to the paypal popup window for them to pay.
When the payment is complete, have the IPN return to a page (http://mywebsite.com/register/process.cfm) which checks whether the payment was successful or not. If it is, it updates the new record, using the ID, with an 'active'. If failed, it returns to the page and has them try again.
<cfif isDefined('Submit')>
<cfset orgInfo = structNew() /> <cfset orgInfo.orgName = form.orgName /> <cfset orgInfo.city = form.city /> <cfset orgInfo.state = form.state /> <cfset orgInfo.webaddress = form.webaddress /> <cfset orgInfo.phoneNumber = form.phoneNumber /> <cfset orgInfo.zipCode = form.zip /> <cfset orgInfo.accountType = form.accountType /> <cfset orgInfo.orgType = form.orgType /> <cfset orgInfo.speciality = form.speciality /> <cfset userInfo = structNew() /> <cfset userInfo.firstname = form.firstname /> <cfset userInfo.lastname = form.lastname /> <cfset userInfo.username = form.username /> <cfset userInfo.password = Hash(form.pass) /> <cfset userInfo.title = form.title /> <cfset userInfo.emailAddress = form.emailAddress /> <cfset userInfo.role = "admin" /> <cfset userInfo.accountType = "member" /> <cfset orgID = createObject("component", "path.to.my.component").createNewAccount(#orgInfo#, #userInfo#) />
<!---What do I do here?---> </cfif>
|