Problem with passing PayPal Amount Field
Last Post 02-16-2009 03:22 PM by Candace. 4 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
vr1001 vr1001User is Offline
river guide
river guide
Posts:115
Avatar

--
01-24-2009 04:47 PM

    Hi,

    I am facing problems with passing "Amount" to PayPal page.

    The problem seems to be with the field type being passed to PayPal.

    Here are the fields in my Form:
    ===============================

    Name     Age Group     Fee
    [Name1] [AgeGroup1] [Amount1]
    [Name2] [AgeGroup2] [Amount2]

    ==============================
    Total Amount       [TotalAmount]

    ====================================
    Details of the Fields
    ====================================

    Top Row:>> All  Labels
    Row 1 - 2: Data items
    Name1, Name2, Name3:>> Text (single line)
    Age Group1, 2 : Drop Down List with Text and Values as listed below:

    AgeGroup1_Text     >> AgeGroup1_value
    Adult         >> 10.00
    Child         >> 5.00

    Amount1, Amount2:>> Text (single line)
    TotalAmount: >> Text (single line)

    I added the following Client Side event for AgeGroup1 drop down list:
    $(Amount1)=$(AgeGroup1)
    $(TotalAmount) = toTwoDecimals(parseInt($(AgeGroup1)) + parseInt($(AgeGroup2)))


    I added the following Client Side event for AgeGroup2 drop down list:
    $(Amount2)=$(AgeGroup2)
    $(TotalAmount) = toTwoDecimals(parseInt($(AgeGroup1)) + parseInt($(AgeGroup2)))

    whenever, I change value of the drop down list AgeGroup1, I am getting the corresponding dollar amount displayed in Amount1 field. Additionally, it is getting 'displayed in TotalAmount field (actually addition of current selections of AgeGroup1 or AgeGroup2)

    So far, so good on the Form. The problem comes only after I SUBMIT the Form.
    Let me also give my PayPal settings:
    ============ PayPal Settings============
    PayPal, Production version (not test version)
    PayPal String:

    &item_name=Name:$(Name1)*Age-Group:$(AgeGroup1_Text)&currency_code=USD&amount=$(AgeGroup1)

    PayPal Result:
    Name:John Doe*Age-Group:Adult   USD 10.00   >>> This is Good!

    But I really want to pass the Total Amount. And I get error when I pass any of the following:

    &item_name=Name:$(Name1)*Age-Group:$(AgeGroup1_Text)&currency_code=USD&amount=$(Amount1)

    &item_name=Name:$(Name1)*Age-Group:$(AgeGroup1_Text)&currency_code=USD&amount=$(Amount2)

    &item_name=Name:$(Name1)*Age-Group:$(AgeGroup1_Text)&currency_code=USD&amount=$(TotalAmount)




    My Conclusion:
    ==============
    when I use any numeric field (inherently defined as numeric in the form), the results are good.
    For example, when I passed the "value" of the drop down option, $(AgeGroup1), it works.
    Whereas, when I passed the Amount fields, it gives error stating that amount is not specified.
    Just for testing purpose, I passed $(PortalID) as the amount; and it is accepted as valid

    Here is my question.
    ===================
    How to pass a value from a text field (single line Text) as the PayPal 'amount' in the PayPal string?

    Any help is greatly appreciated!

    CandaceUser is Offline
    river guide
    river guide
    Posts:2431
    Avatar

    --
    01-27-2009 09:26 AM

    Hi.  What is the exact error message you get when you use this:

    &item_name=Name:$(Name1)*Age-Group:$(AgeGroup1_Text)&currency_code=USD&amount=$(TotalAmount)

    Also, are you using the same $(TotalAmount) for both Age Group 1 and Age Group 2?  You might need a field for grand total and pass this to paypal.

    Candace

     

    vr1001 vr1001User is Offline
    river guide
    river guide
    Posts:115
    Avatar

    --
    01-31-2009 05:44 PM

    The error I get is" Please provide an amount and click Update Totals."
    The Pay Pal page shows "Unit Price" blank (asking the user to enter some value); Quantity is 1; and Amount is shown as 0.00

    Here is what I am doing:
    1. I have 3 separate amount fields: Amount1, Amount2, and TotalAmount.
    2. These three are single line text fields
    3. AgeGroup1, and AgeGroup2 are drop down lists; each list has about 4 options; each option has Text, and associated value. These are set in Host>>Lists (database SQL driven drop down lists)
    4. In my case, For Option, Adult, the value is 10.00
    5. In Dynamic Forms terms, if the user selects "Adult" option, the internal variables have values like this: $(AgeGroup1_Text)=Adult; $(AgeGroup1)=10.00
    6. I move this value to the single line text field, Amount1. I see the actual value selected moved properly. If 'Adult' is selected,
    $(AgeGroup1_Text)=Adult; $(AgeGroup1)=10.00; $(Amount1)=10.00
    I am using this function: $(Amount1)=$(AgeGroup1)

    $(TotalAmount) = toTwoDecimals(parseInt($(AgeGroup1)) + parseInt($(AgeGroup2)))

    When I use the following variables as the PayPal amount, I get the error" Please provide an amount and click Update Totals."

    &amount=$(Amount1)
    &amount=$(Amount2)
    &amount=$(TotalAmount)

    So, when I pass any single line Text field, I defined on the form, I get the error.

    When I use the following variables as the PayPal amount, I DON'T get any error:
    &amount=$(AgeGroup1)
    &amount=$(AgeGroup2)

    So, when I pass any 'internally defined field', I don't get the error.
    Just to confirm my statement, I used other DNN standard numeric fields, as follows and I didn't get any error.
    &amount=$(PortalID)
    &amount=$(ModuleID), etc.

    It appears, somehow, I need to make sure the variable I pass as the amount field, should be 'declared' as a numeric field??

    Any help is greatly appreciated.
    vr1001 vr1001User is Offline
    river guide
    river guide
    Posts:115
    Avatar

    --
    02-16-2009 01:52 PM

    Hi Chad,

     

    Would you please help me with this?

     

    Regards,

    VR

    CandaceUser is Offline
    river guide
    river guide
    Posts:2431
    Avatar

    --
    02-16-2009 03:22 PM
    Sorry that we somehow overlooked this, VR. Are you able to give us temporary edit rights to your site? Can you give us a login and password (preferably host) so we can review this for you? Thanks!

    Candace


    ---
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi