Hi.
Could someone please advise...IPN and Quantity. Thanks in advance.
I have continued to troubleshoot my registration form in which users's rate depends on the time that they register. I am now down to 3 forms: form, confirm and ipn.cfm!
How do I resolve payment and quantity with Paypal? For example, if a user signs up alone before the registration deadline, their fee is $100. And if they have guests who will be registered as registrants, then it is $100* guests + the original registrant. Now, if the user signs up only after the registration deadline, their fee is $200. And if they have guests who will be registered as registrants, then it is $200* guests + the original registrant
I am getting the following error:
Error Diagnostic Information
An error occurred while evaluating the expression:
#DOLLARFORMAT(total_payment)#
Error near line 228, column 25.
--------------------------------------------------------------------------------
Error resolving parameter TOTAL_PAYMENT
ColdFusion was unable to determine the value of the parameter. This problem is very likely due to the fact that either:
You have misspelled the parameter name, or
You have not specified a QUERY attribute for a CFOUTPUT, CFMAIL, or CFTABLE tag.
The error occurred while processing an element with a general identifier of (#DOLLARFORMAT(total_payment)#), occupying document position (228:24) to (228:52).
______________________________________________________________________
Here is my code for ipn and subsequently, confirm.cfm. I have a form page too, but I am not sure if that is necessary:
CONFIRM.cfm
<---Header--->
!---GET FORM ELEMENTS--->
<cfparam name="FORM.convention_date" type="string" default="">
<cfset #convention_date# = FORM.convention_date>
<cfparam name="FORM.registration_date" type="string" default="">
<cfset #registration_date# = FORM.registration_date>
<cfparam name="FORM.title" type="string" default="">
<cfset #title# = FORM.title>
<cfparam name="FORM.fname" type="string" default="">
<cfset #fname# = FORM.fname>
<cfparam name="FORM.mi" type="string" default="">
<cfset #mi# = FORM.mi>
<cfparam name="FORM.lname" type="string" default="">
<cfset #lname# = FORM.lname>
<cfparam name="FORM.nickname" type="string" default="">
<cfset #nickname# = FORM.nickname>
<cfparam name="FORM.suffix" type="string" default="">
<cfset #suffix# = FORM.suffix>
<cfparam name="FORM.email" type="string" default="">
<cfset #email# = FORM.email>
<cfparam name="FORM.stno" type="string" default="">
<cfset #stno# = FORM.stno>
<cfparam name="FORM.stno2" type="string" default="">
<cfset #stno2# = FORM.stno2>
<cfparam name="FORM.city" type="string" default="">
<cfset #city# = FORM.city>
<cfparam name="FORM.state" type="string" default="">
<cfset #state# = FORM.state>
<cfparam name="FORM.zip" type="string" default="">
<cfset #zip# = FORM.zip>
<cfparam name="FORM.country" type="string" default="">
<cfset #country# = FORM.country>
<cfparam name="FORM.hphone" type="string" default="">
<cfset #hphone# = FORM.hphone>
<cfparam name="FORM.wphone" type="string" default="">
<cfset #wphone# = FORM.wphone>
<cfparam name="FORM.fax" type="string" default="">
<cfset #fax# = FORM.fax>
<cfparam name="FORM.emercontact" type="string" default="">
<cfset #emercontact# = FORM.emercontact>
<cfparam name="FORM.ephone" type="string" default="">
<cfset #edphone# = FORM.edphone>
<cfparam name="FORM.eephone" type="string" default="">
<cfset #eephone# = FORM.eephone>
<cfparam name="FORM.region" type="string" default="">
<cfset #region# = FORM.region>
<cfparam name="FORM.district" type="string" default="">
<cfset #district# = FORM.district>
<cfparam name="FORM.lodgeno" type="string" default="">
<cfset #lodgeno# = FORM.lodgeno>
<cfparam name="FORM.lodgename" type="string" default="">
<cfset #lodgename# = FORM.lodgename>
<cfparam name="FORM.committee" type="string" default="">
<cfset #committee# = FORM.committee>
<cfparam name="FORM.lodge_pres" type="string" default="">
<cfset #lodge_pres# = FORM.lodge_pres>
<cfparam name="FORM.registration_type" type="string" default="">
<cfset #registration_type# = FORM.registration_type>
<cfparam name="FORM.gfullname" type="string" default="">
<cfset #gfullname# = FORM.gfullname>
<cfparam name="FORM.gcity" type="string" default="">
<cfset #gcity# = FORM.gcity>
<cfparam name="FORM.gstate" type="string" default="">
<cfset #gstate# = FORM.gstate>
<cfparam name="FORM.gcountry" type="string" default="">
<cfset #gcountry# = FORM.gcountry>
<cfparam name="FORM.guestsallmeals" type="string" default="">
<cfset #guestsallmeals# = FORM.guestsallmeals>
<cfparam name="FORM.guestsno" type="string" default="">
<cfset #guestsno# = FORM.guestsno>
<!--- Finish form elements --->
<table cellpadding="2" cellspacing="2" border="0"><tr><td class="text">
<span class="boldtext">Please check the information below and confirm. You will then be taken to <b>PayPal</b> to make a donation.</span>
</td></tr>
<td>
<cfoutput>
<table>
<tr>
<TR>
<TD class="boldtext">
Convention: <span class="text">#convention_date#</span><br><br>
1Registration Status: <span class="text">#registantStatus#</span><br><br>
Prefix: <span class="text">#title#</span><br><br>
First Name: <span class="text">#fname#</span><br><br>
MI:<span class="text">#mi#</span><br><br>
Last Name: <span class="text">#lname#</span><br><br>
Suffix: <span class="text">#suffix#</span><br><br>
Nickname: <span class="text">#nickname#</span><br><br>
Email:<span class="text">#email#</span><br><br>
Address:<span class="text">#stno#</span><br><br>
Apt.<span class="text">#stno2#</span><br><br>
City:<span class="text">#city#</span><br><br>
State/Province:<span class="text">#state#</span><br><br>
Zip/Postal Code:<span class="text">#zip#</span><br><br>
Country:<span class="text">#country#</span>
<br><br>
<span class="boldtext">Daytime Phone</span> (incl. area code):<span class="text">#hphone#</span><br><br>
<span class="boldtext">Evening Phone</span> (incl. area code):<span class="text">#wphone#</span><br><br>
<span class="boldtext">Fax</span> (incl. area code):<span class="text">#fax#</span><br><br>
Emergency Contact:<span class="text">#emercontact#</span><br><br>
<span class="boldtext">Emergency Daytime Phone </span>(incl. area code):
<span class="text">#edphone#</span><br><br>
<span class="boldtext">Emergency Evening Phone</span>(incl. area code):<span class="text">#eephone#</span>
<br><br>
<!-----Membership Information----->
<span class="boldtext">Select a Region</span> (for all members in USA or British Columbia):<span class="text">#region#</span><br><br>
<span class="boldtext">District</span>(Overseas members only):<span class="text">#district#</span><br><br>
Unit/Lodge Number:<span class="text">#lodgeno#</span><br><br>
<span class="boldtext">Unit/Lodge Name</span>(Required for delgates and alternates representing Units & Lodges):<span class="text">#lodgename#</span><br><br>
<span class="boldtext">Are you interested in serving on a Convention Buisness Committee, and if so will you be available to attend a meeting on Sunday June 27th?</span><br><span class="text">#committee#</span><br><br>
<span class="boldtext">Will you be a Unit/Lodge President when the convention takes place?</span><br><span class="text">#lodge_pres#</span><br><br>
Registration Type:<span class="text">#registration_type#</span><br><br>
Will you have guests?<span class="text">#registantStatus#</span><br><br>
How many guests will you have?<span class="text">#guestsno#</span><br><br>
Do you want to register your guests for all sessions, events, and meals?<br>
<span class="text">#guestsallmeals#</span><br><br>
Guest 1 Full Name: <span class="text">#gfullname#</span><br><br>
Guests 1's city:<span class="text">#gcity#</span><br><br>
State:<span class="text">#gstate#</span><br><br>
Country:<span class="text">#gcountry#</span><br><br>
</td>
</tr></table>
<!--- Calculate Registration Fees if 'Guests' is not selected & registrant is on time --->
<cfif #registantStatus# IS "Registrant Only" AND #registration_date# LT "05/28/04">
<cfset #registrationAmount#="295.00">
</cfif>
<tr><td class"text">
<span class="text">
<b>The following fees are required for your registration:</b><br><br>
Registration Fees: <b>#DOLLARFORMAT(registrationAmount)#</b>
</span></td></tr>
<cfif isDefined("URL.calculate">
<cfif #URL.calculate# is "yes">
<form action="conv04_reg_form.cfm" method="post">
<input type="hidden" name="mode" value="edit">
<input type="submit" value="Go Back & Edit">
</form>
<form action=" method="post">
<input type="hidden" name="item_name" value="Convention Registration">
<input type="hidden" name="cmd" value="_ext-enter">
<input type="hidden" name="redirect_cmd" value="_xclick">
<input type="hidden" name="business" value="website@bnaibrith.org">
<input type="hidden" name="item_number" value="#session.total_registrants#">
<input type="hidden" name="first_name" value="#SESSION.fname#">
<input type="hidden" name="amount" value="#SESSION.registrationAmount#">
<input type="hidden" name="last_name" value="#SESSION.lname#">
<input type="hidden" name="address1" value="#SESSION.stno#">
<input type="hidden" name="address2" value="#SESSION.stno2#">
<input type="hidden" name="city" value="#SESSION.city#">
<input type="hidden" name="state" value="#SESSION.state#">
<input type="hidden" name="zip" value="#SESSION.zip#">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="tax" value="0">
<input type="hidden" name="return" value="<input type="hidden" name="notify_url" value="<input type="submit" value="Confirm">
</form>
</cfif>
</cfif>
</cfoutput>
<!--- Calculate Registration Fees if 'Guests' IS NOT selected & registrant is late --->
<!--- <cfelseif #guests# IS "" AND #registration_date# GT "05/28/04"> --->
<cfif #registantStatus# IS "Registrant with Guests" AND #registration_date# GT "05/28/04">
<cfset #registrationAmount#= "325.00">
<cfif isDefined("Form.registrant">
<cfoutput>
<cfif #guests# IS 'Yes' AND #guestsallmeals# IS 'Yes'>
<cfset #total_registrants# = #guestsno# + 1>
<cfset #registrationAmount# =325 * #total_registrants#>
</cfif>
</cfoutput>
</cfif>
<cfoutput>
<tr><td class"text">
<span class="text">
<b>The following fees are required for your registration:</b>
Registered on: #DateFormat(registration_date, 'mm/dd/yyyy')#</<br><br>
Registration Fees: <b>#DOLLARFORMAT(total_payment)#</b>
</span></td></tr>
<form action="conv04_reg_form.cfm" method="post">
<input type="hidden" name="mode" value="edit">
<input type="submit" value="Go Back & Edit">
</form>
<cfif isDefined("URL.calculate">
<cfif #URL.calculate# is "yes">
<form action=" method="post">
<input type="hidden" name="item_name" value="Convention Registration">
<input type="hidden" name="cmd" value="_ext-enter">
<input type="hidden" name="redirect_cmd" value="_xclick">
<input type="hidden" name="business" value="website@bnaibrith.org">
<input type="hidden" name="item_number" value="#session.total_registrants#">
<input type="hidden" name="first_name" value="#SESSION.fname#">
<input type="hidden" name="amount" value="#SESSION.registrationAmount#">
<input type="hidden" name="last_name" value="#SESSION.lname#">
<input type="hidden" name="address1" value="#SESSION.stno#">
<input type="hidden" name="address2" value="#SESSION.stno2#">
<input type="hidden" name="city" value="#SESSION.city#">
<input type="hidden" name="state" value="#SESSION.state#">
<input type="hidden" name="zip" value="#SESSION.zip#">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="tax" value="0">
<input type="hidden" name="return" value="<input type="hidden" name="notify_url" value="<input type="submit" value="Confirm">
</form>
</cfif>
</cfif>
</cfoutput>
</cfif>
<---Footer--->
_________________________________________________________________
IPN.cfm
<!-- 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>
<!-- post back to PayPal system to validate -->
<CFHTTP URL=" METHOD="GET" RESOLVEURL="false">
</CFHTTP>
<!-- assign posted variables to local variables -->
<cfoutput>
<cfset #receiver_email#=#FORM.receiver_email#>
<cfset #payment_status#=#FORM.payment_status#>
<cfset #payment_currency#=#FORM.mc_currency#>
<cfset #txn_id#=#FORM.txn_id#>
<cfset #convention_program# = #FORM.item_name#>
<cfset #total_registrants# = #FORM.item_number#>
<cfset #registration_amount# = #FORM.mc_gross#>
<cfset #fname# = #FORM.first_name#>
<cfset #lname# = #FORM.last_name#>
<cfset #stno1# = #FORM.address_street#>
<cfset #city# = #FORM.address_city#>
<cfset #state# = #FORM.address_state#>
<cfset #zip# = #FORM.address_zip#>
<cfset #email# = #FORM.email#>
</cfoutput>
<cfoutput>
Variables:
#total_registrants# , #registration_amount#, #convention_program#, #fname#<br/>
</cfoutput>
<!-- check notification validation -->
<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">
<!-- process payment -->
<cftry>
<cfquery name="registrant" datasource="bbitestdb">
SELECT * FROM bog_registrant
WHERE
Email = '#email#'
</cfquery>
<cfif registrant.RecordCount NEQ 0>
<cfset #registantStatus# = "registrant only">
<cfelse>
<cfset #registantStatus# = "registrant with guests">
</cfif>
<cfif #registantStatus# is "registrant only">
<cfquery name="FindCustomer" datasource="bbitestdb">
SELECT * FROM Customers
WHERE email = '#email#'
</cfquery>
<cfif FindCustomer.RecordCount NEQ 0>
<cfset registrantID = #FindCustomer.CustomerId#>
</cfif>
<cfif FindCustomer.RecordCount EQ 0>
<cfquery name="InsertCustomer" datasource="bbitestdb">
INSERT INTO Customers
(
fname, lname, stno, city, state, zip, email, IsBOGRegistrant, DateAdded
)
Values
(
'#fname#', '#lname#', '#stno1#', '#city#', '#state#', '#zip#', '#email#', 'y', GETDATE() )
</cfquery>
<cfquery name="FindCustomer" datasource="bbitestdb">
SELECT * FROM Customers
WHERE email = '#email#'
</cfquery>
<cfset registrantID = #FindCustomer.CustomerId#>
<cfelse>
<cfquery name="UpdateCustomer" datasource="bbitestdb">
UPDATE Customers
SET
IsBOGRegistrant = 'y'
WHERE CustomerId = '#registrantID#'
</cfquery>
</cfif>
</cfif>
<cfif #registantStatus# is "registrant with guests">
<cfoutput><br/>RegistrantID: #registrant.RegistrantID#<br/>
Last Name: #registrant.lname#<br/></cfoutput>
<cfquery name="UpdateRegistrant" datasource="bbitestdb">
UPDATE Customers
SET
IsBOGRegistrant = 'y'
WHERE
email = '#email#'
</cfquery>
<cfquery name="UpdateGuest" datasource="bbitestdb">
UPDATE bog_guests
SET
gfullname = <cfqueryparam value="#form.keyword#">,
gcity = <cfqueryparam value="#form.keyword#">,
gstate = <cfqueryparam value="#form.keyword#">,
gcountry = <cfqueryparam value="#form.keyword#">,
registrantID= <cfqueryparam value=#form.registrantID#>
WHERE
registrantID = #Form.registrantID#
</cfquery>
<cfoutput>
<cfset #registantStatus# = #registrant.RegistrantID#>
</cfoutput>
</cfif>
<cfoutput>
<cfquery name="InsertPayment" datasource="bbitestdb">
INSERT INTO customerPayments
(
CustomerId, txnId, lname, conventionType, registrationAmount, datePaid
)
Values
(
'#customerID#', '#txn_id#', '#lname#', '#registantStatus#', '#registration_amount#', GETDATE()
)
</cfquery>
<cfquery name="InsertRegistrantInfo" datasource="bbitestdb">
INSERT INTO bog_registrants
(
convention_date, conventionType, title, fname, mi, lname, suffix, nickname, email, stno, stno2, city, state, zip, country, hphone, wphone, fax, emercontact, edphone, eephone, region, district, lodgeno, lodgename, lodge_pres, committee, registration_type, total_registrants, registration_date, registantStatus,
)
Values
(
'#convention_date#', '#conventionType#', '#title#', '#fname#', '#mi#', '#lname#', '#suffix#', '#nickname#', '#email#', '#stno#', '#stno2#', '#city#', '#state#', '#zip#', '#country#', '#hphone#', '#wphone#', '#fax#', '#emercontact#', '#edphone#','#eephone#','#region#','#district#','#lodgeno#','#lodgename#', '#lodge_pres#', '#committee#', '#registration_type#', '#total_registrants#', GETDATE(),'#registantStatus#',
)
</cfquery>
</cfoutput>
<cfcatch>
<!--- let's log all errors --->
<cffile action="append"
file="D:\WEB\bnaibrith\paypal\paypal_log.txt"
output="Error order info & after written to DB">
</cfcatch>
</cftry>
</cfif>
</cfif>
<CFELSEIF #CFHTTP.FileContent# is "INVALID">
<!-- log for investigation -->
Something that was purchased was invalid, either the order or the information provided. This is usually good to log in case someone is trying to purchase with stolen card numbers, etc. Here simply place a QUERY tag that insert the data above into a database.
<CFELSE>
<!-- error -->
This usually means that something went wrong along the way, you can use this area to log it and keep for your records.
</CFIF>
Laughter cures so much and it is easier than a frown... Go ahead try it...
Could someone please advise...IPN and Quantity. Thanks in advance.
I have continued to troubleshoot my registration form in which users's rate depends on the time that they register. I am now down to 3 forms: form, confirm and ipn.cfm!
How do I resolve payment and quantity with Paypal? For example, if a user signs up alone before the registration deadline, their fee is $100. And if they have guests who will be registered as registrants, then it is $100* guests + the original registrant. Now, if the user signs up only after the registration deadline, their fee is $200. And if they have guests who will be registered as registrants, then it is $200* guests + the original registrant
I am getting the following error:
Error Diagnostic Information
An error occurred while evaluating the expression:
#DOLLARFORMAT(total_payment)#
Error near line 228, column 25.
--------------------------------------------------------------------------------
Error resolving parameter TOTAL_PAYMENT
ColdFusion was unable to determine the value of the parameter. This problem is very likely due to the fact that either:
You have misspelled the parameter name, or
You have not specified a QUERY attribute for a CFOUTPUT, CFMAIL, or CFTABLE tag.
The error occurred while processing an element with a general identifier of (#DOLLARFORMAT(total_payment)#), occupying document position (228:24) to (228:52).
______________________________________________________________________
Here is my code for ipn and subsequently, confirm.cfm. I have a form page too, but I am not sure if that is necessary:
CONFIRM.cfm
<---Header--->
!---GET FORM ELEMENTS--->
<cfparam name="FORM.convention_date" type="string" default="">
<cfset #convention_date# = FORM.convention_date>
<cfparam name="FORM.registration_date" type="string" default="">
<cfset #registration_date# = FORM.registration_date>
<cfparam name="FORM.title" type="string" default="">
<cfset #title# = FORM.title>
<cfparam name="FORM.fname" type="string" default="">
<cfset #fname# = FORM.fname>
<cfparam name="FORM.mi" type="string" default="">
<cfset #mi# = FORM.mi>
<cfparam name="FORM.lname" type="string" default="">
<cfset #lname# = FORM.lname>
<cfparam name="FORM.nickname" type="string" default="">
<cfset #nickname# = FORM.nickname>
<cfparam name="FORM.suffix" type="string" default="">
<cfset #suffix# = FORM.suffix>
<cfparam name="FORM.email" type="string" default="">
<cfset #email# = FORM.email>
<cfparam name="FORM.stno" type="string" default="">
<cfset #stno# = FORM.stno>
<cfparam name="FORM.stno2" type="string" default="">
<cfset #stno2# = FORM.stno2>
<cfparam name="FORM.city" type="string" default="">
<cfset #city# = FORM.city>
<cfparam name="FORM.state" type="string" default="">
<cfset #state# = FORM.state>
<cfparam name="FORM.zip" type="string" default="">
<cfset #zip# = FORM.zip>
<cfparam name="FORM.country" type="string" default="">
<cfset #country# = FORM.country>
<cfparam name="FORM.hphone" type="string" default="">
<cfset #hphone# = FORM.hphone>
<cfparam name="FORM.wphone" type="string" default="">
<cfset #wphone# = FORM.wphone>
<cfparam name="FORM.fax" type="string" default="">
<cfset #fax# = FORM.fax>
<cfparam name="FORM.emercontact" type="string" default="">
<cfset #emercontact# = FORM.emercontact>
<cfparam name="FORM.ephone" type="string" default="">
<cfset #edphone# = FORM.edphone>
<cfparam name="FORM.eephone" type="string" default="">
<cfset #eephone# = FORM.eephone>
<cfparam name="FORM.region" type="string" default="">
<cfset #region# = FORM.region>
<cfparam name="FORM.district" type="string" default="">
<cfset #district# = FORM.district>
<cfparam name="FORM.lodgeno" type="string" default="">
<cfset #lodgeno# = FORM.lodgeno>
<cfparam name="FORM.lodgename" type="string" default="">
<cfset #lodgename# = FORM.lodgename>
<cfparam name="FORM.committee" type="string" default="">
<cfset #committee# = FORM.committee>
<cfparam name="FORM.lodge_pres" type="string" default="">
<cfset #lodge_pres# = FORM.lodge_pres>
<cfparam name="FORM.registration_type" type="string" default="">
<cfset #registration_type# = FORM.registration_type>
<cfparam name="FORM.gfullname" type="string" default="">
<cfset #gfullname# = FORM.gfullname>
<cfparam name="FORM.gcity" type="string" default="">
<cfset #gcity# = FORM.gcity>
<cfparam name="FORM.gstate" type="string" default="">
<cfset #gstate# = FORM.gstate>
<cfparam name="FORM.gcountry" type="string" default="">
<cfset #gcountry# = FORM.gcountry>
<cfparam name="FORM.guestsallmeals" type="string" default="">
<cfset #guestsallmeals# = FORM.guestsallmeals>
<cfparam name="FORM.guestsno" type="string" default="">
<cfset #guestsno# = FORM.guestsno>
<!--- Finish form elements --->
<table cellpadding="2" cellspacing="2" border="0"><tr><td class="text">
<span class="boldtext">Please check the information below and confirm. You will then be taken to <b>PayPal</b> to make a donation.</span>
</td></tr>
<td>
<cfoutput>
<table>
<tr>
<TR>
<TD class="boldtext">
Convention: <span class="text">#convention_date#</span><br><br>
1Registration Status: <span class="text">#registantStatus#</span><br><br>
Prefix: <span class="text">#title#</span><br><br>
First Name: <span class="text">#fname#</span><br><br>
MI:<span class="text">#mi#</span><br><br>
Last Name: <span class="text">#lname#</span><br><br>
Suffix: <span class="text">#suffix#</span><br><br>
Nickname: <span class="text">#nickname#</span><br><br>
Email:<span class="text">#email#</span><br><br>
Address:<span class="text">#stno#</span><br><br>
Apt.<span class="text">#stno2#</span><br><br>
City:<span class="text">#city#</span><br><br>
State/Province:<span class="text">#state#</span><br><br>
Zip/Postal Code:<span class="text">#zip#</span><br><br>
Country:<span class="text">#country#</span>
<br><br>
<span class="boldtext">Daytime Phone</span> (incl. area code):<span class="text">#hphone#</span><br><br>
<span class="boldtext">Evening Phone</span> (incl. area code):<span class="text">#wphone#</span><br><br>
<span class="boldtext">Fax</span> (incl. area code):<span class="text">#fax#</span><br><br>
Emergency Contact:<span class="text">#emercontact#</span><br><br>
<span class="boldtext">Emergency Daytime Phone </span>(incl. area code):
<span class="text">#edphone#</span><br><br>
<span class="boldtext">Emergency Evening Phone</span>(incl. area code):<span class="text">#eephone#</span>
<br><br>
<!-----Membership Information----->
<span class="boldtext">Select a Region</span> (for all members in USA or British Columbia):<span class="text">#region#</span><br><br>
<span class="boldtext">District</span>(Overseas members only):<span class="text">#district#</span><br><br>
Unit/Lodge Number:<span class="text">#lodgeno#</span><br><br>
<span class="boldtext">Unit/Lodge Name</span>(Required for delgates and alternates representing Units & Lodges):<span class="text">#lodgename#</span><br><br>
<span class="boldtext">Are you interested in serving on a Convention Buisness Committee, and if so will you be available to attend a meeting on Sunday June 27th?</span><br><span class="text">#committee#</span><br><br>
<span class="boldtext">Will you be a Unit/Lodge President when the convention takes place?</span><br><span class="text">#lodge_pres#</span><br><br>
Registration Type:<span class="text">#registration_type#</span><br><br>
Will you have guests?<span class="text">#registantStatus#</span><br><br>
How many guests will you have?<span class="text">#guestsno#</span><br><br>
Do you want to register your guests for all sessions, events, and meals?<br>
<span class="text">#guestsallmeals#</span><br><br>
Guest 1 Full Name: <span class="text">#gfullname#</span><br><br>
Guests 1's city:<span class="text">#gcity#</span><br><br>
State:<span class="text">#gstate#</span><br><br>
Country:<span class="text">#gcountry#</span><br><br>
</td>
</tr></table>
<!--- Calculate Registration Fees if 'Guests' is not selected & registrant is on time --->
<cfif #registantStatus# IS "Registrant Only" AND #registration_date# LT "05/28/04">
<cfset #registrationAmount#="295.00">
</cfif>
<tr><td class"text">
<span class="text">
<b>The following fees are required for your registration:</b><br><br>
Registration Fees: <b>#DOLLARFORMAT(registrationAmount)#</b>
</span></td></tr>
<cfif isDefined("URL.calculate">
<cfif #URL.calculate# is "yes">
<form action="conv04_reg_form.cfm" method="post">
<input type="hidden" name="mode" value="edit">
<input type="submit" value="Go Back & Edit">
</form>
<form action=" method="post">
<input type="hidden" name="item_name" value="Convention Registration">
<input type="hidden" name="cmd" value="_ext-enter">
<input type="hidden" name="redirect_cmd" value="_xclick">
<input type="hidden" name="business" value="website@bnaibrith.org">
<input type="hidden" name="item_number" value="#session.total_registrants#">
<input type="hidden" name="first_name" value="#SESSION.fname#">
<input type="hidden" name="amount" value="#SESSION.registrationAmount#">
<input type="hidden" name="last_name" value="#SESSION.lname#">
<input type="hidden" name="address1" value="#SESSION.stno#">
<input type="hidden" name="address2" value="#SESSION.stno2#">
<input type="hidden" name="city" value="#SESSION.city#">
<input type="hidden" name="state" value="#SESSION.state#">
<input type="hidden" name="zip" value="#SESSION.zip#">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="tax" value="0">
<input type="hidden" name="return" value="<input type="hidden" name="notify_url" value="<input type="submit" value="Confirm">
</form>
</cfif>
</cfif>
</cfoutput>
<!--- Calculate Registration Fees if 'Guests' IS NOT selected & registrant is late --->
<!--- <cfelseif #guests# IS "" AND #registration_date# GT "05/28/04"> --->
<cfif #registantStatus# IS "Registrant with Guests" AND #registration_date# GT "05/28/04">
<cfset #registrationAmount#= "325.00">
<cfif isDefined("Form.registrant">
<cfoutput>
<cfif #guests# IS 'Yes' AND #guestsallmeals# IS 'Yes'>
<cfset #total_registrants# = #guestsno# + 1>
<cfset #registrationAmount# =325 * #total_registrants#>
</cfif>
</cfoutput>
</cfif>
<cfoutput>
<tr><td class"text">
<span class="text">
<b>The following fees are required for your registration:</b>
Registered on: #DateFormat(registration_date, 'mm/dd/yyyy')#</<br><br>
Registration Fees: <b>#DOLLARFORMAT(total_payment)#</b>
</span></td></tr>
<form action="conv04_reg_form.cfm" method="post">
<input type="hidden" name="mode" value="edit">
<input type="submit" value="Go Back & Edit">
</form>
<cfif isDefined("URL.calculate">
<cfif #URL.calculate# is "yes">
<form action=" method="post">
<input type="hidden" name="item_name" value="Convention Registration">
<input type="hidden" name="cmd" value="_ext-enter">
<input type="hidden" name="redirect_cmd" value="_xclick">
<input type="hidden" name="business" value="website@bnaibrith.org">
<input type="hidden" name="item_number" value="#session.total_registrants#">
<input type="hidden" name="first_name" value="#SESSION.fname#">
<input type="hidden" name="amount" value="#SESSION.registrationAmount#">
<input type="hidden" name="last_name" value="#SESSION.lname#">
<input type="hidden" name="address1" value="#SESSION.stno#">
<input type="hidden" name="address2" value="#SESSION.stno2#">
<input type="hidden" name="city" value="#SESSION.city#">
<input type="hidden" name="state" value="#SESSION.state#">
<input type="hidden" name="zip" value="#SESSION.zip#">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="tax" value="0">
<input type="hidden" name="return" value="<input type="hidden" name="notify_url" value="<input type="submit" value="Confirm">
</form>
</cfif>
</cfif>
</cfoutput>
</cfif>
<---Footer--->
_________________________________________________________________
IPN.cfm
<!-- 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>
<!-- post back to PayPal system to validate -->
<CFHTTP URL=" METHOD="GET" RESOLVEURL="false">
</CFHTTP>
<!-- assign posted variables to local variables -->
<cfoutput>
<cfset #receiver_email#=#FORM.receiver_email#>
<cfset #payment_status#=#FORM.payment_status#>
<cfset #payment_currency#=#FORM.mc_currency#>
<cfset #txn_id#=#FORM.txn_id#>
<cfset #convention_program# = #FORM.item_name#>
<cfset #total_registrants# = #FORM.item_number#>
<cfset #registration_amount# = #FORM.mc_gross#>
<cfset #fname# = #FORM.first_name#>
<cfset #lname# = #FORM.last_name#>
<cfset #stno1# = #FORM.address_street#>
<cfset #city# = #FORM.address_city#>
<cfset #state# = #FORM.address_state#>
<cfset #zip# = #FORM.address_zip#>
<cfset #email# = #FORM.email#>
</cfoutput>
<cfoutput>
Variables:
#total_registrants# , #registration_amount#, #convention_program#, #fname#<br/>
</cfoutput>
<!-- check notification validation -->
<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">
<!-- process payment -->
<cftry>
<cfquery name="registrant" datasource="bbitestdb">
SELECT * FROM bog_registrant
WHERE
Email = '#email#'
</cfquery>
<cfif registrant.RecordCount NEQ 0>
<cfset #registantStatus# = "registrant only">
<cfelse>
<cfset #registantStatus# = "registrant with guests">
</cfif>
<cfif #registantStatus# is "registrant only">
<cfquery name="FindCustomer" datasource="bbitestdb">
SELECT * FROM Customers
WHERE email = '#email#'
</cfquery>
<cfif FindCustomer.RecordCount NEQ 0>
<cfset registrantID = #FindCustomer.CustomerId#>
</cfif>
<cfif FindCustomer.RecordCount EQ 0>
<cfquery name="InsertCustomer" datasource="bbitestdb">
INSERT INTO Customers
(
fname, lname, stno, city, state, zip, email, IsBOGRegistrant, DateAdded
)
Values
(
'#fname#', '#lname#', '#stno1#', '#city#', '#state#', '#zip#', '#email#', 'y', GETDATE() )
</cfquery>
<cfquery name="FindCustomer" datasource="bbitestdb">
SELECT * FROM Customers
WHERE email = '#email#'
</cfquery>
<cfset registrantID = #FindCustomer.CustomerId#>
<cfelse>
<cfquery name="UpdateCustomer" datasource="bbitestdb">
UPDATE Customers
SET
IsBOGRegistrant = 'y'
WHERE CustomerId = '#registrantID#'
</cfquery>
</cfif>
</cfif>
<cfif #registantStatus# is "registrant with guests">
<cfoutput><br/>RegistrantID: #registrant.RegistrantID#<br/>
Last Name: #registrant.lname#<br/></cfoutput>
<cfquery name="UpdateRegistrant" datasource="bbitestdb">
UPDATE Customers
SET
IsBOGRegistrant = 'y'
WHERE
email = '#email#'
</cfquery>
<cfquery name="UpdateGuest" datasource="bbitestdb">
UPDATE bog_guests
SET
gfullname = <cfqueryparam value="#form.keyword#">,
gcity = <cfqueryparam value="#form.keyword#">,
gstate = <cfqueryparam value="#form.keyword#">,
gcountry = <cfqueryparam value="#form.keyword#">,
registrantID= <cfqueryparam value=#form.registrantID#>
WHERE
registrantID = #Form.registrantID#
</cfquery>
<cfoutput>
<cfset #registantStatus# = #registrant.RegistrantID#>
</cfoutput>
</cfif>
<cfoutput>
<cfquery name="InsertPayment" datasource="bbitestdb">
INSERT INTO customerPayments
(
CustomerId, txnId, lname, conventionType, registrationAmount, datePaid
)
Values
(
'#customerID#', '#txn_id#', '#lname#', '#registantStatus#', '#registration_amount#', GETDATE()
)
</cfquery>
<cfquery name="InsertRegistrantInfo" datasource="bbitestdb">
INSERT INTO bog_registrants
(
convention_date, conventionType, title, fname, mi, lname, suffix, nickname, email, stno, stno2, city, state, zip, country, hphone, wphone, fax, emercontact, edphone, eephone, region, district, lodgeno, lodgename, lodge_pres, committee, registration_type, total_registrants, registration_date, registantStatus,
)
Values
(
'#convention_date#', '#conventionType#', '#title#', '#fname#', '#mi#', '#lname#', '#suffix#', '#nickname#', '#email#', '#stno#', '#stno2#', '#city#', '#state#', '#zip#', '#country#', '#hphone#', '#wphone#', '#fax#', '#emercontact#', '#edphone#','#eephone#','#region#','#district#','#lodgeno#','#lodgename#', '#lodge_pres#', '#committee#', '#registration_type#', '#total_registrants#', GETDATE(),'#registantStatus#',
)
</cfquery>
</cfoutput>
<cfcatch>
<!--- let's log all errors --->
<cffile action="append"
file="D:\WEB\bnaibrith\paypal\paypal_log.txt"
output="Error order info & after written to DB">
</cfcatch>
</cftry>
</cfif>
</cfif>
<CFELSEIF #CFHTTP.FileContent# is "INVALID">
<!-- log for investigation -->
Something that was purchased was invalid, either the order or the information provided. This is usually good to log in case someone is trying to purchase with stolen card numbers, etc. Here simply place a QUERY tag that insert the data above into a database.
<CFELSE>
<!-- error -->
This usually means that something went wrong along the way, you can use this area to log it and keep for your records.
</CFIF>
Laughter cures so much and it is easier than a frown... Go ahead try it...