Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. PayPal Instant Payment Notification(IPN) Issue..

PayPal Instant Payment Notification(IPN) Issue..

Scheduled Pinned Locked Moved ASP.NET
csharpcomsysadminhelpannouncement
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NetMan2012
    wrote on last edited by
    #1

    Hi i m using paypal IPN for payment notifications. I am using the same code provided by Paypal however i m having issues. Here is the code string strSandbox = "https://www.sandbox.paypal.com/cgi-bin/webscr"; string strLive = "https://www.paypal.com/cgi-bin/webscr"; HttpWebRequest req = (HttpWebRequest)WebRequest.Create(strSandbox); //Set values for the request back req.Method = "POST"; req.ContentType = "application/x-www-form-urlencoded"; byte[] param = Request.BinaryRead(HttpContext.Current.Request.ContentLength); string strRequest = Encoding.ASCII.GetString(param); Dictionary nvs = new Dictionary(); string[] items = strRequest.Split("&".ToCharArray()); foreach (string item in items) { string[] parts = item.Split("=".ToCharArray()); nvs.Add(parts[0], HttpUtility.UrlDecode(parts[1])); } strRequest += "&cmd=_notify-validate"; req.ContentLength = strRequest.Length; //for proxy //Hook up 1&1 proxy server //WebProxy proxy = new WebProxy("ntproxyus.lxa.perfora.net:3128",false); //req.Proxy = proxy; //Send transaction detail with the flag back to PayPal StreamWriter streamOut = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII); streamOut.Write(strRequest); streamOut.Close(); //DataLayer dl3 = new DataLayer(); //dl3.executeQuery("Update petOwner set orderStatus = 'Afterproxy(Invalid Card)' where orderId = '" + Request.Form["item_name"] + "'"); //Get validation status from PayPal StreamReader streamIn = new StreamReader(req.GetResponse().GetResponseStream()); string strResponse = streamIn.ReadToEnd(); streamIn.Close(); //DataLayer dl4 = new DataLayer(); //dl4.executeQuery("Update petOwner set orderStatus = 'Afterproxy2(Invalid Card)' where orderId = '" + Request.Form["item_name"] + "'"); if (strResponse == "VERIFIED") { //check the payment_status is Completed if (nvs["payment_status"] == "Completed") { //check that txn_id has not been previously processed //check that receiver_email is your Primary PayPal email

    Richard Andrew x64R L 2 Replies Last reply
    0
    • N NetMan2012

      Hi i m using paypal IPN for payment notifications. I am using the same code provided by Paypal however i m having issues. Here is the code string strSandbox = "https://www.sandbox.paypal.com/cgi-bin/webscr"; string strLive = "https://www.paypal.com/cgi-bin/webscr"; HttpWebRequest req = (HttpWebRequest)WebRequest.Create(strSandbox); //Set values for the request back req.Method = "POST"; req.ContentType = "application/x-www-form-urlencoded"; byte[] param = Request.BinaryRead(HttpContext.Current.Request.ContentLength); string strRequest = Encoding.ASCII.GetString(param); Dictionary nvs = new Dictionary(); string[] items = strRequest.Split("&".ToCharArray()); foreach (string item in items) { string[] parts = item.Split("=".ToCharArray()); nvs.Add(parts[0], HttpUtility.UrlDecode(parts[1])); } strRequest += "&cmd=_notify-validate"; req.ContentLength = strRequest.Length; //for proxy //Hook up 1&1 proxy server //WebProxy proxy = new WebProxy("ntproxyus.lxa.perfora.net:3128",false); //req.Proxy = proxy; //Send transaction detail with the flag back to PayPal StreamWriter streamOut = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII); streamOut.Write(strRequest); streamOut.Close(); //DataLayer dl3 = new DataLayer(); //dl3.executeQuery("Update petOwner set orderStatus = 'Afterproxy(Invalid Card)' where orderId = '" + Request.Form["item_name"] + "'"); //Get validation status from PayPal StreamReader streamIn = new StreamReader(req.GetResponse().GetResponseStream()); string strResponse = streamIn.ReadToEnd(); streamIn.Close(); //DataLayer dl4 = new DataLayer(); //dl4.executeQuery("Update petOwner set orderStatus = 'Afterproxy2(Invalid Card)' where orderId = '" + Request.Form["item_name"] + "'"); if (strResponse == "VERIFIED") { //check the payment_status is Completed if (nvs["payment_status"] == "Completed") { //check that txn_id has not been previously processed //check that receiver_email is your Primary PayPal email

      Richard Andrew x64R Offline
      Richard Andrew x64R Offline
      Richard Andrew x64
      wrote on last edited by
      #2

      Please put your code in <pre> tags so that it's readable. (Use the "code" formatting.)

      The difficult we do right away... ...the impossible takes slightly longer.

      1 Reply Last reply
      0
      • N NetMan2012

        Hi i m using paypal IPN for payment notifications. I am using the same code provided by Paypal however i m having issues. Here is the code string strSandbox = "https://www.sandbox.paypal.com/cgi-bin/webscr"; string strLive = "https://www.paypal.com/cgi-bin/webscr"; HttpWebRequest req = (HttpWebRequest)WebRequest.Create(strSandbox); //Set values for the request back req.Method = "POST"; req.ContentType = "application/x-www-form-urlencoded"; byte[] param = Request.BinaryRead(HttpContext.Current.Request.ContentLength); string strRequest = Encoding.ASCII.GetString(param); Dictionary nvs = new Dictionary(); string[] items = strRequest.Split("&".ToCharArray()); foreach (string item in items) { string[] parts = item.Split("=".ToCharArray()); nvs.Add(parts[0], HttpUtility.UrlDecode(parts[1])); } strRequest += "&cmd=_notify-validate"; req.ContentLength = strRequest.Length; //for proxy //Hook up 1&1 proxy server //WebProxy proxy = new WebProxy("ntproxyus.lxa.perfora.net:3128",false); //req.Proxy = proxy; //Send transaction detail with the flag back to PayPal StreamWriter streamOut = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII); streamOut.Write(strRequest); streamOut.Close(); //DataLayer dl3 = new DataLayer(); //dl3.executeQuery("Update petOwner set orderStatus = 'Afterproxy(Invalid Card)' where orderId = '" + Request.Form["item_name"] + "'"); //Get validation status from PayPal StreamReader streamIn = new StreamReader(req.GetResponse().GetResponseStream()); string strResponse = streamIn.ReadToEnd(); streamIn.Close(); //DataLayer dl4 = new DataLayer(); //dl4.executeQuery("Update petOwner set orderStatus = 'Afterproxy2(Invalid Card)' where orderId = '" + Request.Form["item_name"] + "'"); if (strResponse == "VERIFIED") { //check the payment_status is Completed if (nvs["payment_status"] == "Completed") { //check that txn_id has not been previously processed //check that receiver_email is your Primary PayPal email

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Please refer this link: https://cms.paypal.com/cgi-bin/marketingweb?cmd=_render-content&content_ID=developer/library_code_ipn_code_samples[^] http://www.phpwebcommerce.com/shop-checkout-process/handling-paypal-ipn.php[^]

        Maulik Dusara Sr. Sofware Engineer

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups