Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsEventsEventsFee & Total Charges not showing rightFee & Total Charges not showing right
Previous
 
Next
New Post
9/6/2006 2:22 PM
 

I've got several events set for enrollment that have a fee that is beign paid through PayPal. I put the fee in as $10.00 but the total charges always show up as 0.00. Where is this set? The Total is what is sent to PayPal which then wants to charge $0.00 even though the fee is suppose to be $10.00.

Any help would be appreciated.

I've included a partial screen shot below.

Event Name: test
Description:
Fee: $10.00   USD
Total Charges: 0.00   USD
 
New Post
9/6/2006 3:37 PM
 

OK here is the cause of the problem:

Code file: EventPPEnroll.ascx.vb

Line numbers: 96-105

Line 96 takes the Event fee formats it as a currency string and places it in the label for the fee.
   lblFee.Text = String.Format("{0:c}", EventEvent.EnrollFee)

Line 104 then takes the string from the event fee label and runs it through the VB function "Val"
   dblTotal = Val(lblFee.Text)
This function (Val) parses the string looking for a valid number. The VB documentation states that it stops parsing at the first non-numeric character. In this case it will stop at the leading "$" (assuming USD) thereby the returned value will be 0.

Line 105 then formats as currency and assigns the value to the Total Label.
   lblTotal.Text = Format(dblTotal, "#,##0.00")
The total value becomes 0 because the Val function was mis-used. This is then the value that is passed to PayPal.

To correct this I simply changed the formatting on line 96 to show a simple two place decimal. 
   lblFee.Text = String.Format("{0:#.00}", EventEvent.EnrollFee)

Because there is a currency designator being put after the event amount there doesn't seem to be a reason to format the enrollment fee as currency.

Not sure if this is the best solution but is the simplest and seems to work well in my environment.

FYI.. I also made changes to pick up the PayPal URL from the web.config rather than have it hardcoded in the module. This way I can change the path to use PayPal's sandbox and actually run thorough tests on my sites. My "fix" for this is quick and dirty I would recommend taking this much farther by putting it in a DNN table someplace so that when PayPal changes their settings we don't have to wait for an upgraded module. Actually if done right this module could be used with a variety of payment processors.

 
New Post
9/29/2006 12:31 PM
 

Question? How come this has not been fixed?

How can I setup a working environment in VS2005 to modify the Events Module source, so I can accomplish the above? I can create new modules, but I would like to modify it so that I can get this workign ASAP.

Thanks in Advanced for any help.

 

BadMark
http://badmark.com

 
New Post
9/29/2006 1:41 PM
 

I'm not sure about VS2005 - Haven't spent enough time in it because all my hosts are still at  the 1.1 framework.

In VS2003 (and I suppose that it is similar in vs2005) I simply open the Events project, make sure the references are set, point the dll output to the bin, change code and build. I don't rebuild all of DNN each time.. just the module I'm working with.

John

 

 
New Post
9/29/2006 2:12 PM
 

VS 2003 did the trick, I was just to lazy to have to install that as well as VS2005. But I've got it working, when I get a chance I'll post a link to the module dll on my blog.

Mark
http://badmark.com

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsEventsEventsFee & Total Charges not showing rightFee & Total Charges not showing right


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out