locked
paypal integration issue in website RRS feed

  • Question

  • User-119345712 posted

    i developed a website in asp.net 3.5 + sqsl server 2008, and need user to pay via PayPal , so what is the proceudure to integrate it and hwo i would keep the record that who paid or who didn't ?

    what else is necessary, i am totally unaware 

    Friday, November 16, 2012 4:23 PM

Answers

All replies

  • Friday, November 16, 2012 4:25 PM
  • User-2124491265 posted

    First register an sandbox account(trail account) in paypal website

    then you will get credentials of paypal api use the same credentials in your code.

    here is the code

     //API Credentials (3-token)
            string strUsername = "username";//Here is Username
            string strPassword = "password";//Password
            string strSignature = "";//Here Api Signature of paypal
            string strCredentials = "USER=" + strUsername + "&PWD=" + strPassword + "&SIGNATURE=" + strSignature;
    
    
            string strNVPSandboxServer = "https://api-3t.sandbox.paypal.com/nvp";// Demo Server Marchent Account to be buy Name: Christian Vivaha;
            //string strNVPLiveServer = "https://api-3t.paypal.com/nvp";//Live server 
            string strAPIVersion = "2.3";
    
    
            string strNVP = strCredentials + "&METHOD=DoDirectPayment&CREDITCARDTYPE=VISA&ACCT="+card_no_txt.Text+"&EXPDATE=092017&CVV2="+cvv_txt.Text+"&AMT="+amount_txt.Text+"&FIRSTNAME=Christian&LASTNAME=Vivaha&IPADDRESS=255.55.167.002&COUNTRYCODE=US&PAYMENTACTION=sale&VERSION=" + strAPIVersion;
            //Create web request and web response objects, make sure you using the correct server (sandbox/live)
            HttpWebRequest wrWebRequest = (HttpWebRequest)WebRequest.Create(strNVPSandboxServer);
    
    
            //Set WebRequest Properties
            wrWebRequest.Method = "POST";
    
    
            // write the form values into the request message
            StreamWriter requestWriter = new StreamWriter(wrWebRequest.GetRequestStream());
            requestWriter.Write(strNVP);
            requestWriter.Close();
    
    
            // Get the response.
            HttpWebResponse hwrWebResponse = (HttpWebResponse)wrWebRequest.GetResponse();
            StreamReader responseReader = new StreamReader(wrWebRequest.GetResponse().GetResponseStream());
    
    
            // and read the response
            string responseData = responseReader.ReadToEnd();
            responseReader.Close();
            string[] data = Server.UrlDecode(responseData).Split('&', '=');
           
                if (data[5] == "Failure")
                {
                    ACK.Text = data[5];
                    status.Text = data[15];
                    amt.Text = data[19];
                    transidtr.Visible = false;
                }
                else if (data[5] == "Success")
                {
                    ACK.Text = data[5];
                    amt.Text = data[19];
                    transdis.Visible = false;
                    transid.Text = data[19];
                    status.Text = data[15];
                }
    Thank you       
    



    Saturday, November 17, 2012 2:31 AM
  • User482643855 posted

    http://www.codeproject.com/Tips/474197/PayPal-Gateway-Integration-in-ASP-NET

    Saturday, November 17, 2012 11:44 AM
  • User482643855 posted

    http://indiandotnet.wordpress.com/2009/04/14/simplest-paypal-integration-with-aspnet-in-5-steps/

    Saturday, November 17, 2012 11:44 AM
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, November 17, 2012 12:15 PM