Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 12th, 2008, 06:44 AM
Authorized User
 
Join Date: Feb 2007
Location: , , .
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default PayPal Integration

The code below is used to register some details of a user to a database for members. How do I have Paypal send a confirmation back to the database in a field that says PAID/UNPAID so that I can allow/dissallow users to log in. I already have a paypal account and web payments standard configured. I also tried to play around with IPN and PDT but I couldnt make sense of it. Any help, code samples etc would be greatly appreciated

Code:
Imports System.Data
Imports System.Data.OleDb
Partial Public Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        MultiView1.SetActiveView(menu)

    End Sub
    Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click

        If txtname.Text = "" Or txtsurname.Text = "" Or txtusername.Text = "" Or txtpassword.Text = "" Or txtconfpassword.Text = "" Or txtchname.Text = "" Or txtchSurname.Text = "" Or txtchDOB.Text = "" Then

            'all fields are mandatory
            Label38.Text = "Please enter the information in ALL fields. All the fields are mandatory."
            Label38.Visible = True
            MultiView1.SetActiveView(registration)
        Else

            If txtpassword.Text = txtconfpassword.Text Then

                Label38.Visible = False
                savepersonal()
                savecred()
                MultiView1.SetActiveView(registration)

            Else

                'passwords do not match
                Label38.Text = "Your passwords do not match please enter your password again."
                Label38.Visible = True

            End If


        End If


    End Sub

    Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
        MultiView1.SetActiveView(registration)
    End Sub

    Protected Sub ImageButton4_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton4.Click
        MultiView1.SetActiveView(menu)
    End Sub

    Protected Sub btnReset_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnReset.Click
        txtname.Text = ""
        txtsurname.Text = ""
        txtadd1.Text = ""
        txtadd2.Text = ""
        txttown.Text = ""
        txtprovince.Text = ""
        txtpostcode.Text = ""
        txtcountry.Text = ""
        txttel.Text = ""
        txtmobile.Text = ""
        txtemail.Text = ""
        txtusername.Text = ""
        txtpassword.Text = ""
        txtconfpassword.Text = ""
        txtchname.Text = ""
        txtchSurname.Text = ""
        txtchDOB.Text = "dd/mm/yyyy"

        MultiView1.SetActiveView(registration)
    End Sub



    Function savepersonal() As Integer
        Dim conn As New ADODB.Connection
        Dim cmd As New ADODB.Command
        Dim sConnString As String

        Dim personalid As String
        personalid = txtname.Text & txttel.Text

        sConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
     Server.MapPath("db2.mdb")
        'open the connection
        conn.Open(sConnString)
        cmd.ActiveConnection = conn



        cmd.CommandText = "INSERT INTO details (name,surname,add1,add2,town,province,postcode,country,tel,mobile,email,chname,chsurname,chDOB,personalid,relationship)" & _
           "VALUES " & _
            "('" & txtname.Text & "'," & _
            "'" & txtsurname.Text & "'," & _
            "'" & txtadd1.Text & "'," & _
            "'" & txtadd2.Text & "'," & _
            "'" & txttown.Text & "'," & _
            "'" & txtprovince.Text & "'," & _
            "'" & txtpostcode.Text & "'," & _
            "'" & txtcountry.Text & "'," & _
            "'" & txttel.Text & "'," & _
            "'" & txtmobile.Text & "'," & _
            "'" & txtemail.Text & "'," & _
            "'" & txtchname.Text & "'," & _
            "'" & txtchSurname.Text & "'," & _
            "'" & txtchDOB.Text & "'," & _
            "'" & personalid & "'," & _
            "'" & drpRelationship.Text & "')"

        cmd.Execute()

        cmd = Nothing
        conn.Close()
        conn = Nothing

    End Function
    Function savecred() As Integer
        Dim conn As New ADODB.Connection
        Dim cmd As New ADODB.Command
        Dim sConnString As String

        Dim personalid As String
        personalid = txtname.Text & txttel.Text

        sConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
        Server.MapPath("db2.mdb")
        'open the connection
        conn.Open(sConnString)
        cmd.ActiveConnection = conn


        cmd.CommandText = "INSERT INTO login (usern,pwd,email,personalid)" & _
           "VALUES " & _
            "('" & txtusername.Text & "'," & _
            "'" & txtpassword.Text & "'," & _
            "'" & txtemail.Text & "'," & _
            "'" & personalid & "')"

        cmd.Execute()

        cmd = Nothing
        conn.Close()
        conn = Nothing
    End Function
    Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click

        If txtFRname.Text = "" Or txtFRsname.Text = "" Or txtFRdob.Text = "" Then

            Label39.Visible = True
            MultiView1.SetActiveView(child)

        Else

            Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data source =" & Server.MapPath("db2.mdb")
            Dim myConnection As OleDbConnection = New OleDbConnection
            myConnection.ConnectionString = connString
            ' create a data adapter

            Dim da As OleDbDataAdapter = New OleDbDataAdapter("SELECT name,surname,add1,add2,town,province,postcode,country,tel,mobile,email FROM details WHERE (chname LIKE '%" & txtFRname.Text & "%') AND (chsurname LIKE '%" & txtFRsname.Text & "%') AND (chDOB = '" & txtFRdob.Text & "')", myConnection)

            ' create a new dataset

            Dim ds As DataSet = New DataSet
            ' fill dataset

            da.Fill(ds, "details")
            ' Attach DataSet to DataGrid

            GridView1.DataSource = ds
            GridView1.DataBind()

            MultiView1.SetActiveView(child)


        End If

    End Sub

    Protected Sub ImageButton6_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton6.Click
        MultiView1.SetActiveView(menu)
    End Sub

    Protected Sub ImageButton3_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton3.Click
        MultiView1.SetActiveView(child)
    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Server.Transfer("registration confirmation.htm")
    End Sub
End Class
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
paypal and asp ocabrera70 Classic ASP Professional 3 September 25th, 2014 07:30 AM
Paypal Return Variables itHighway Classic ASP Basics 0 September 1st, 2008 07:39 AM
Paypal Pro Integration in Classic ASP ch.ranjita Classic ASP Professional 0 November 27th, 2007 12:54 AM
PayPal - IPN Shabequl PHP How-To 1 September 26th, 2007 06:15 PM
paypal ? anshul Pro PHP 1 November 24th, 2004 01:19 AM



All times are GMT -4. The time now is 03:43 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.