Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Paypal and CF- Not calculating- no time...could someone help me?

Status
Not open for further replies.

radiance

Programmer
Joined
Jan 4, 2003
Messages
164
Location
US
Could someone please help me.

I have redone my form so many times. I am finally getting "confirm" which is going to paypal, and edit (which is not working).

1) My calculations are not working. I am having problems with <cfif isDefined URL.calculate>

2) The value of the registrantAmount is not going through to Paypal. Instead, the user fills in an amount. This is not what i want them to do.


3) My value for registrant_total is not showing either

Please advise...
________________________________________________________

<cfparam name=&quot;FORM.convention_date&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset convention_date = FORM.convention_date>

<cfparam name=&quot;FORM.registration_date&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset registration_date = FORM.registration_date>

<cfparam name=&quot;FORM.title&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset title = FORM.title>

<cfparam name=&quot;FORM.fname&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset fname = FORM.fname>

<cfparam name=&quot;FORM.mi&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset mi = FORM.mi>

<cfparam name=&quot;FORM.lname&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset lname = FORM.lname>

<cfparam name=&quot;FORM.nickname&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset nickname = FORM.nickname>

<cfparam name=&quot;FORM.suffix&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset suffix = FORM.suffix>

<cfparam name=&quot;FORM.email&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset email = FORM.email>

<cfparam name=&quot;FORM.stno&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset stno = FORM.stno>

<cfparam name=&quot;FORM.stno2&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset stno2 = FORM.stno2>

<cfparam name=&quot;FORM.city&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset city = FORM.city>

<cfparam name=&quot;FORM.state&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset state = FORM.state>

<cfparam name=&quot;FORM.zip&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset zip = FORM.zip>

<cfparam name=&quot;FORM.country&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset country = FORM.country>

<cfparam name=&quot;FORM.hphone&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset hphone = FORM.hphone>

<cfparam name=&quot;FORM.wphone&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset wphone = FORM.wphone>

<cfparam name=&quot;FORM.fax&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset fax = FORM.fax>


<cfparam name=&quot;FORM.emercontact&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset emercontact = FORM.emercontact>


<cfparam name=&quot;FORM.ephone&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset edphone = FORM.edphone>


<cfparam name=&quot;FORM.eephone&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset eephone = FORM.eephone>


<cfparam name=&quot;FORM.region&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset region = FORM.region>


<cfparam name=&quot;FORM.district&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset district = FORM.district>

<cfparam name=&quot;FORM.registration_type&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset registration_type = FORM.registration_type>

<cfparam name=&quot;FORM.lodgeno&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset lodgeno = FORM.lodgeno>


<cfparam name=&quot;FORM.lodgename&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset lodgename = FORM.lodgename>


<cfparam name=&quot;FORM.committee&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset committee = FORM.committee>


<cfparam name=&quot;FORM.lodge_pres&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset lodge_pres = FORM.lodge_pres>

<cfparam name=&quot;FORM.registration_type&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset registration_type = FORM.registration_type>

<cfparam name=&quot;FORM.gfullname&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset gfullname = FORM.gfullname>

<cfparam name=&quot;FORM.gcity&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset gcity = FORM.gcity>

<cfparam name=&quot;FORM.gstate&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset gstate = FORM.gstate>

<cfparam name=&quot;FORM.gcountry&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset gcountry = FORM.gcountry>

<cfparam name=&quot;FORM.guestsallmeals&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset guestsallmeals = FORM.guestsallmeals>

<cfparam name=&quot;FORM.guestsno&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfset guestsno = FORM.guestsno>

<cfparam name=&quot;FORM.registrantStatus&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfparam name=&quot;FORM.total_registrants&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfparam name=&quot;FORM.registrationAmount&quot; type=&quot;string&quot; default=&quot;&quot;>
<cfif registrantStatus IS 'Registrant_Guests' AND guestsallmeals IS 'yes' AND registration_date LT 05/28/04>
<cfset total_registrants = (#guestsno# +1)>
<cfset registrationAmount=(295 * #total_registrants#)>
<cfelseif registrantStatus IS 'Registrant_Guests' AND guestsallmeals IS 'no' AND registration_date LT 05/28/04>
<cfset total_registrants = 1>
<cfset registrationAmount=(295 * #total_registrants#)>
<cfelseif registrantStatus IS 'Registrant_Guests' AND guestsallmeals IS 'yes' AND registration_date GT 05/29/04>
<cfset total_registrants = (#guestsno# +1)>
<cfset registrationAmount=(325 * #total_registrants#)>
<cfelseif registrantStatus IS 'Registrant_Guests' AND guestsallmeals IS 'no' AND registration_date GT 05/29/04>
<cfset total_registrants = 1>
<cfset registrationAmount=(325 * #total_registrants#)>
<cfelseif registrantStatus IS 'Registrant_Only' AND registration_date LT 05/28/04>
<cfset total_registrants = 1>
<cfset registrationAmount=(295 * #total_registrants#)>
<cfelseif registrantStatus IS 'Registrant_Only' AND registration_date GT 05/29/04>
<cfset total_registrants = 1>
<cfset registrationAmount=(325 * #total_registrants#)>
</cfif>

<!--- Finish form elements --->

<table cellpadding=&quot;2&quot; cellspacing=&quot;2&quot; border=&quot;0&quot;><tr><td class=&quot;text&quot;>
<span class=&quot;boldtext&quot;>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=&quot;boldtext&quot;>
Convention: <span class=&quot;text&quot;>#convention_date#</span><br><br>

Registration Status: <span class=&quot;text&quot;>#registantStatus#</span><br><br>

Prefix: <span class=&quot;text&quot;>#title#</span><br><br>

First Name: <span class=&quot;text&quot;>#fname#</span><br><br>

MI:<span class=&quot;text&quot;>#mi#</span><br><br>

Last Name: <span class=&quot;text&quot;>#lname#</span><br><br>

Suffix: <span class=&quot;text&quot;>#suffix#</span><br><br>

Nickname: <span class=&quot;text&quot;>#nickname#</span><br><br>

Email:<span class=&quot;text&quot;>#email#</span><br><br>

Address:<span class=&quot;text&quot;>#stno#</span><br><br>

Apt.<span class=&quot;text&quot;>#stno2#</span><br><br>

City:<span class=&quot;text&quot;>#city#</span><br><br>

State/Province:<span class=&quot;text&quot;>#state#</span><br><br>

Zip/Postal Code:<span class=&quot;text&quot;>#zip#</span><br><br>

Country:<span class=&quot;text&quot;>#country#</span>
<br><br>

<span class=&quot;boldtext&quot;>Daytime Phone</span> (incl. area code):<span class=&quot;text&quot;>#hphone#</span><br><br>

<span class=&quot;boldtext&quot;>Evening Phone</span> (incl. area code):<span class=&quot;text&quot;>#wphone#</span><br><br>

<span class=&quot;boldtext&quot;>Fax</span> (incl. area code):<span class=&quot;text&quot;>#fax#</span><br><br>


Emergency Contact:<span class=&quot;text&quot;>#emercontact#</span><br><br>


<span class=&quot;boldtext&quot;>Emergency Daytime Phone </span>(incl. area code):
<span class=&quot;text&quot;>#edphone#</span><br><br>

<span class=&quot;boldtext&quot;>Emergency Evening Phone</span>(incl. area code):<span class=&quot;text&quot;>#eephone#</span>
<br><br>

<!-----Membership Information----->

<span class=&quot;boldtext&quot;>Select a Region</span> (for all members in USA or British Columbia):<span class=&quot;text&quot;>#region#</span><br><br>

<span class=&quot;boldtext&quot;>District</span>(Overseas members only):<span class=&quot;text&quot;>#district#</span><br><br>

Unit/Lodge Number:<span class=&quot;text&quot;>#lodgeno#</span><br><br>

<span class=&quot;boldtext&quot;>Unit/Lodge Name</span>(Required for delgates and alternates representing Units & Lodges):<span class=&quot;text&quot;>#lodgename#</span><br><br>


<span class=&quot;boldtext&quot;>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=&quot;text&quot;>#committee#</span><br><br>


<span class=&quot;boldtext&quot;>Will you be a Unit/Lodge President when the convention takes place?</span><br><span class=&quot;text&quot;>#lodge_pres#</span><br><br>

Registration Type:<span class=&quot;text&quot;>#registration_type#</span><br><br>


Will you have guests?<span class=&quot;text&quot;>#registantStatus#</span><br><br>

Total Registrants: #total_registrants#<br><br>
<cfif registrantStatus IS 'Registrant_Guests' AND guestsallmeals IS 'yes'>
<cfset total_registrants = (#guestsno# +1)>
<cfelse>
<cfset total_registrants = '1'>
</cfif>


How many guests will you have?<span class=&quot;text&quot;>#guestsno#</span><br><br>


Do you want to register your guests for all sessions, events, and meals?<br>
<span class=&quot;text&quot;>#guestsallmeals#</span><br><br>

Guest 1 Full Name: <span class=&quot;text&quot;>#gfullname#</span><br><br>

Guests 1's city:<span class=&quot;text&quot;>#gcity#</span><br><br>

State:<span class=&quot;text&quot;>#gstate#</span><br><br>

Country:<span class=&quot;text&quot;>#gcountry#</span><br><br>
</td>
</tr></table>
<!--- Calculate Registration Fees if 'Guests' is not selected & registrant is on time --->



<form action=&quot;test.cfm&quot; method=&quot;post&quot;>
<input type=&quot;hidden&quot; name=&quot;mode&quot; value=&quot;edit&quot;>
<input type=&quot;submit&quot; value=&quot;Go Back & Edit&quot;>
</form>


<form action=&quot; method=&quot;post&quot;>
<tr><td class&quot;text&quot;>
<span class=&quot;text&quot;>
<b>The following fees are required for your registration:</b><br><br>
Registration Fees: <b>#DOLLARFORMAT(registrationAmount)#</b>
</span></td></tr>

<input type=&quot;hidden&quot; name=&quot;item_name&quot; value=&quot;Convention Registration&quot;>
<input type=&quot;hidden&quot; name=&quot;cmd&quot; value=&quot;_ext-enter&quot;>
<input type=&quot;hidden&quot; name=&quot;redirect_cmd&quot; value=&quot;_xclick&quot;>
<input type=&quot;hidden&quot; name=&quot;business&quot; value=&quot;website@bnaibrith.org&quot;>
<input type=&quot;hidden&quot; name=&quot;item_number&quot; value=&quot;#total_registrants#&quot;>
<input type=&quot;hidden&quot; name=&quot;first_name&quot; value=&quot;#fname#&quot;>
<input type=&quot;hidden&quot; name=&quot;amount&quot; value=&quot;#registrationAmount#&quot;>
<input type=&quot;hidden&quot; name=&quot;last_name&quot; value=&quot;#lname#&quot;>
<input type=&quot;hidden&quot; name=&quot;address1&quot; value=&quot;#stno#&quot;>
<input type=&quot;hidden&quot; name=&quot;address2&quot; value=&quot;#stno2#&quot;>
<input type=&quot;hidden&quot; name=&quot;city&quot; value=&quot;#city#&quot;>
<input type=&quot;hidden&quot; name=&quot;state&quot; value=&quot;#state#&quot;>
<input type=&quot;hidden&quot; name=&quot;zip&quot; value=&quot;#zip#&quot;>
<input type=&quot;hidden&quot; name=&quot;no_note&quot; value=&quot;1&quot;>
<input type=&quot;hidden&quot; name=&quot;no_shipping&quot; value=&quot;0&quot;>
<input type=&quot;hidden&quot; name=&quot;currency_code&quot; value=&quot;USD&quot;>
<input type=&quot;hidden&quot; name=&quot;tax&quot; value=&quot;0&quot;>
<input type=&quot;hidden&quot; name=&quot;return&quot; value=&quot; <input type=&quot;hidden&quot; name=&quot;notify_url&quot; value=&quot; <input type=&quot;submit&quot; value=&quot;Confirm&quot;>
</form>

</cfoutput>
 
Well at first glance I noticed that this input tag in your form:
<input type=&quot;hidden&quot; name=&quot;amount&quot; value=&quot;#registrationAmount#&quot;>

Is probably where your problem lies. Didn't you say your variable was named #registrantAmount# ? Apparantly its registrationAmount ... also your input name is &quot;amount&quot; where it probably should be registrationAmount.

Look at that and tell me if you think of anything. Hope we can help ya.
 
Thank you for your help!

I have been able to get past this and my only issue now is the edit function. If the user needs to make changes, they get an error message that (if I use sessions), the sessions are not defined or (without sessions), the fields don't exist.
 
Are you enabline sessions in your application.cfm file? A look at the error message would help.



Hope This Helps!

Ecobb

&quot;My work is a game, a very serious game.&quot; - M.C. Escher
 
can you really test dates successfully this way? --

<cfif registration_date LT 05/28/04>

seems to me that's not a valid CF date string, and is likely to be evaluated as 5 divided by 28 divided by 4


rudy
SQL Consulting
 
Thanks so much. I have a date function, in which dates are automatically inserted and placed in a particular format. However, is there another way to define dates?

Also, I have a main application.cfm page in which session variables are enabled. Is there another way to do this? Should I place another application.cfm page within the folder for this form?

Please advise.

Thanks so much!!

 
is there another way? as far as i know, there is only one way, a quoted string

the stuff inside the string can have several formats, though

e.g.
'February 18, 2004'
'Feb 18, 2004'
'02/18/04'
'2004-02-18'


rudy
SQL Consulting
 
okay.

thank you so much?

The problem is still the user being able to revise his/her entries?



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top