locked
Adding Paypal to Website RRS feed

  • Question

  • User-814982097 posted

    Hi,

    I've been reading some tutorial about adding Paypal to my website, but this doesn't work. When i click on the button, nothing happens.

    Here is the tutorial I read (and copied/pasted) : http://www.codeproject.com/Articles/42894/Introduction-to-PayPal-for-C-ASP-NET-developers.

    Here is my code, basically there is just 8 RadioButtons (7 for given donation amounts, the last one is for the amount of your choice) and the button to go to Paypal.

    _________________________________________________________________________________________________________

    ASP.NET Code :

    <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Donate.aspx.cs" Inherits="Symbiome.Donate" %>
    
    <asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    
    <br />
    Donation amount: € (EUR)
    <br />
    <br />
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    
    
    <asp:RadioButton ID="RadioButton1" Text="10" runat="server" 
    oncheckedchanged="RadioButton1_CheckedChanged1">
    </asp:RadioButton>
    <ajaxToolkit:MutuallyExclusiveCheckBoxExtender ID="RadioButton1_MutuallyExclusiveCheckBoxExtender"
    runat="server" Enabled="True" Key="AmountList" TargetControlID="RadioButton1">
    </ajaxToolkit:MutuallyExclusiveCheckBoxExtender>
    
    
    <asp:RadioButton ID="RadioButton2" Text="20" runat="server" 
    oncheckedchanged="RadioButton2_CheckedChanged">
    </asp:RadioButton>
    <ajaxToolkit:MutuallyExclusiveCheckBoxExtender ID="RadioButton2_MutuallyExclusiveCheckBoxExtender"
    runat="server" Enabled="True" Key="AmountList" TargetControlID="RadioButton2">
    </ajaxToolkit:MutuallyExclusiveCheckBoxExtender>
    
    
    <asp:RadioButton ID="RadioButton3" Text="30" runat="server" 
    oncheckedchanged="RadioButton3_CheckedChanged">
    </asp:RadioButton>
    <ajaxToolkit:MutuallyExclusiveCheckBoxExtender ID="RadioButton3_MutuallyExclusiveCheckBoxExtender"
    runat="server" Enabled="True" Key="AmountList" TargetControlID="RadioButton3">
    </ajaxToolkit:MutuallyExclusiveCheckBoxExtender>
    
    
    <asp:RadioButton ID="RadioButton4" Text="50" runat="server" 
    oncheckedchanged="RadioButton4_CheckedChanged">
    </asp:RadioButton>
    <ajaxToolkit:MutuallyExclusiveCheckBoxExtender ID="RadioButton4_MutuallyExclusiveCheckBoxExtender"
    runat="server" Enabled="True" Key="AmountList" TargetControlID="RadioButton4">
    </ajaxToolkit:MutuallyExclusiveCheckBoxExtender>
    <br />
    
    
    <asp:RadioButton ID="RadioButton5" Text="70" runat="server" 
    oncheckedchanged="RadioButton5_CheckedChanged">
    </asp:RadioButton>
    <ajaxToolkit:MutuallyExclusiveCheckBoxExtender ID="RadioButton5_MutuallyExclusiveCheckBoxExtender"
    runat="server" Enabled="True" Key="AmountList" TargetControlID="RadioButton5">
    </ajaxToolkit:MutuallyExclusiveCheckBoxExtender>
    
    
    <asp:RadioButton ID="RadioButton6" Text="100" runat="server" 
    oncheckedchanged="RadioButton6_CheckedChanged">
    </asp:RadioButton>
    <ajaxToolkit:MutuallyExclusiveCheckBoxExtender ID="RadioButton6_MutuallyExclusiveCheckBoxExtender"
    runat="server" Enabled="True" Key="AmountList" TargetControlID="RadioButton6">
    </ajaxToolkit:MutuallyExclusiveCheckBoxExtender>
    
    
    <asp:RadioButton ID="RadioButton7" Text="150" runat="server" 
    oncheckedchanged="RadioButton7_CheckedChanged">
    </asp:RadioButton>
    <ajaxToolkit:MutuallyExclusiveCheckBoxExtender ID="RadioButton7_MutuallyExclusiveCheckBoxExtender"
    runat="server" Enabled="True" Key="AmountList" TargetControlID="RadioButton7">
    </ajaxToolkit:MutuallyExclusiveCheckBoxExtender>
    
    
    <asp:RadioButton ID="RadioButton8" Text="Other :" runat="server" 
    oncheckedchanged="RadioButton8_CheckedChanged">
    </asp:RadioButton>
    <ajaxToolkit:MutuallyExclusiveCheckBoxExtender ID="RadioButton8_MutuallyExclusiveCheckBoxExtender"
    runat="server" Enabled="True" Key="AmountList" TargetControlID="RadioButton8">
    </ajaxToolkit:MutuallyExclusiveCheckBoxExtender>
    
    
    <asp:TextBox ID="PaymentTextBox" runat="server" TextMode="MultiLine" Height="16px" Width="30px"></asp:TextBox>
    <br />
    <br />
    
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    
    <input type="hidden" name="_donations" value="_xclick" />
    <input type="hidden" name="business" value="anveena@live.fr" />
    
    <input type="hidden" name="item_name" value="My painting" />
    <input type="hidden" name="amount" value="valueForPayment" />
    <input type="submit" value="Donate via Paypal" />
    </form>
    </asp:Content>



    _________________________________________________________________________________________________________

    C# Code :

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    namespace Symbiome
    {
    public partial class Donate : System.Web.UI.Page
    {
    double valueForPayment = 0;
    
    protected void Page_Load(object sender, EventArgs e)
    {
    
    }
    
    protected void RadioButton1_CheckedChanged1(object sender, EventArgs e)
    {
    valueForPayment = 10;
    }
    
    protected void RadioButton2_CheckedChanged(object sender, EventArgs e)
    {
    valueForPayment = 20;
    }
    
    protected void RadioButton3_CheckedChanged(object sender, EventArgs e)
    {
    valueForPayment = 30;
    }
    
    protected void RadioButton4_CheckedChanged(object sender, EventArgs e)
    {
    valueForPayment = 50;
    }
    
    protected void RadioButton5_CheckedChanged(object sender, EventArgs e)
    {
    valueForPayment = 70;
    }
    
    protected void RadioButton6_CheckedChanged(object sender, EventArgs e)
    {
    valueForPayment = 100;
    }
    
    protected void RadioButton7_CheckedChanged(object sender, EventArgs e)
    {
    valueForPayment = 150;
    }
    
    protected void RadioButton8_CheckedChanged(object sender, EventArgs e)
    {
    valueForPayment = Convert.ToDouble(PaymentTextBox.Text);
    }
    }
    }



    _________________________________________________________________________________________________________

    What's missing ? Thanks...

    Tuesday, June 12, 2012 2:10 PM

All replies

  • User-434868552 posted

    @ UserName33

    welcome to forums.asp.net

    suggestion:  try PayPal's technical support ... they're the experts AFAIK

    g.

    Tuesday, June 12, 2012 2:13 PM