3
Answers

i want to know about paypall system and how to implement in my project ? can any body help me ?

Photo of sukh DHALIWAL

sukh DHALIWAL

12y
1.1k
1
i m implementing a project which needs the paypal module and kindly suggest me some source code . thanks and regards ?

Answers (3)

0
Photo of Kunal Vaishya
NA 4.1k 266.1k 12y
You need to setup paypal to your site. As per them, it's very easy. See here
https://www.paypal.com/cgi-bin/webscr?cmd=_wp-standard-integration-outside

Here mentioned many variation of accounts to be created.
0
Photo of Kunal Vaishya
NA 4.1k 266.1k 12y
you can use .NET SDK for Payflow Pro classes, your application sends a transaction request to a Payflow Pro host, where Payflow Pro server processes the request and then sends back a transaction response to your application to notify you of the transaction status. In the request and response cycle, a credit card transaction is accomplished and funds are moved in or out of your bank account that is linked to your Payflow Pro payment gateway account.

  • For testing : pilot-payflowpro.paypal.com
  • For production: payflowpro.paypal.com

  • Transaction Request

    TRXTYPE=S&TENDER=C&ACCT=5105105105105100&EXPDATE=1209&CVV2=123&AMT=99.00
    &FIRSTNAME=John&LASTNAME=Smith&STREET=123 Main St.&CITY=SanHose
    &STATE=CA&ZIP=12345&COMMENT1=Reservation&USER=MyUser&PWD=MyPassword
    &VENDOR=MyVendor&PARTNER=MyPartner


    Transaction Response

    RESULT=0&PNREF=EFHP0D426A53&RESPMSG=APPROVED&AUTHCODE=25TEST&
    AVSADDR=Y&AVSZIP=N&CVV2MATCH=Y


     protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                string PayPalRequest = "TRXTYPE=S" //S - sale transaction
                     + "&TENDER=C" //C - Credit card
                     + "&ACCT=" + txtCardNumber.Text //card number
                     + "&EXPDATE=" + ddlMonth.SelectedValue +
    ddlYear.SelectedValue.Substring(2, 2)
                     + "&CVV2=" + txtCvv.Text   //card validation value (card security code)
                     + "&AMT=" + txtAmount.Text
                     + "&COMMENT1=My Product Sale"
                     + "&USER=" + ConfigurationManager.AppSettings["USER"]
                     + "&VENDOR=" + ConfigurationManager.AppSettings["VENDOR"]
                     + "&PARTNER=" + ConfigurationManager.AppSettings["PARTNER"]
                     + "&PWD=" + ConfigurationManager.AppSettings["PWD"];

                // Create an instance of PayflowNETAPI.
                PayflowNETAPI PayflowNETAPI = new PayflowNETAPI();

                // RequestId is a unique string that is required for each & every transaction.
                // The merchant can use her/his own algorithm to generate
                // this unique request id or use the SDK provided API to generate this
                // as shown below (PayflowUtility.RequestId).
                string PayPalResponse = PayflowNETAPI.SubmitTransaction
    (PayPalRequest, PayflowUtility.RequestId);
               
                //place data from PayPal into a namevaluecollection
                NameValueCollection RequestCollection =
    GetPayPalCollection(PayflowNETAPI.TransactionRequest);
                NameValueCollection ResponseCollection = GetPayPalCollection(PayPalResponse);

                //show request
                lblResult.Text = "<span class=\"heading\">
    PayPal Payflow Pro transaction request</span><br />"
    ;
                lblResult.Text += ShowPayPalInfo(RequestCollection);

                //show response
                lblResult.Text += "<br /><br /><span class=\"heading\">
    PayPal Payflow Pro transaction response</span><br />"
    ;
                lblResult.Text += ShowPayPalInfo(ResponseCollection);
                   
                //show transaction errors if any
                string TransErrors = PayflowNETAPI.TransactionContext.ToString();
                if (TransErrors != null && TransErrors.Length > 0)
                {
                    lblResult.Text += "<br /><br /><span class=\"bold-text\">
    Transaction Errors:</span> "
    + TransErrors;
                }

                //show transaction status
                lblResult.Text += "<br /><br /><span class=\"bold-text\">
    Status:</span> "
    + PayflowUtility.GetStatus(PayPalResponse);
            }
            catch (Exception ex)
            {
                lblError.Text = ex.Message.ToString();
            }
        }

        private NameValueCollection GetPayPalCollection(string payPalInfo)
        {
            //place the responses into collection
            NameValueCollection PayPalCollection =
    new System.Collections.Specialized.NameValueCollection();
            string[] ArrayReponses = payPalInfo.Split('&');

            for (int i = 0; i < ArrayReponses.Length; i++)
            {
                string[] Temp = ArrayReponses[i].Split('=');
                PayPalCollection.Add(Temp[0], Temp[1]);
            }
            return PayPalCollection;
        }
        private string ShowPayPalInfo(NameValueCollection collection)
        {
            string PayPalInfo = "";
            foreach (string key in collection.AllKeys)
            {
                PayPalInfo += "<br /><span class=\"bold-text\">" +
    key + ":</span> " + collection[key];
            }
            return PayPalInfo;
        }
    }

    0
    Photo of Satyapriya Nayak
    NA 53k 8m 12y
    Hi Sukh,

    Please refer the below links

    http://www.codeproject.com/KB/aspnet/paypal_c_aspnet.aspx

    http://www.codeproject.com/KB/aspnet/UsePayPalPaymentInASPNET.aspx

    http://www.codeproject.com/Articles/152280/Online-Credit-Card-Transaction-in-ASP-NET-Using-Pa

    http://www.dotnetfunda.com/articles/article928-online-payments-using-paypal-integration-with-aspnet.aspx


    Thanks