Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4590754
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:17:50+00:00 2026-05-21T22:17:50+00:00

I had test application integrated with Paypal express checkout and it was running fine.

  • 0

I had test application integrated with Paypal express checkout and it was running fine. But now there seems some issue. After successful payment on paypal when my IPN handler check for response paypal returns response as html page instead of “VERIFIED” OR “INVALID” and because of this I’m not able to verify the payment.
Is there any change in Paypal recently for express checkout? Below is complete code

<form id="Paypal" name="Paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr"
    method="post">
    @Html.Hidden("cmd", "_xclick")
    @Html.Hidden("business", "myemail@test.com")
    @Html.Hidden("item_name", "Payment for course registration")
    @Html.Hidden("amount", 100 )
    @Html.Hidden("no_shipping", "1")
    @Html.Hidden("return", "http://localhost:49319/cart/IPN")
    @Html.Hidden("rm", "2")
    @Html.Hidden("notify_url", "http://localhost:49319/cart/IPN")
    @Html.Hidden("cancel_return", "http://localhost:49319/cart/PaymentFailure")
    @Html.Hidden("currency_code", "CAD")
    @Html.Hidden("tax_cart", "1")
    @Html.Hidden("custom", "12")
    <div class="checkout-button">
        <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif"
            align="left" style="margin-right: 7px;" />
    </div>
    </form>

IPN handler code:

 string paypalUrl = useSandbox ? "https://www.sandbox.paypal.com/cgi-bin/webscr"
            : "https://www.paypal.com/cgi-bin/webscr";


        HttpWebRequest req = (HttpWebRequest)WebRequest.Create(paypalUrl);

        // Set values for the request back
        req.Method = "POST";
        req.ContentType = "application/x-www-form-urlencoded";

        byte[] param = Request.BinaryRead(Request.ContentLength);
        string strRequest = Encoding.ASCII.GetString(param);

        StringBuilder sb = new StringBuilder();
        sb.Append(strRequest);

        foreach (string key in formVals.Keys)
        {
            sb.AppendFormat("&{0}={1}", key, formVals[key]);
        }
        strRequest += sb.ToString();
        req.ContentLength = strRequest.Length;

        //for proxy
        //WebProxy proxy = new WebProxy(new Uri("http://urlort#");
        //req.Proxy = proxy;
        //Send the request to PayPal and get the response
        string response = "";
        using (StreamWriter streamOut = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII))
        {

            streamOut.Write(strRequest);
            streamOut.Close();
            using (StreamReader streamIn = new StreamReader(req.GetResponse().GetResponseStream()))
            {
                response = streamIn.ReadToEnd();
            }
        }

        return response;

Edit:
Here is request string sent to Paypal

CONTEXT=wtgSziM4C5x0SI-9CmKcv2vkSeTLK5P_g6HqzC__YTYkcqziFNcB84p79Ja&myAllTextSubmitID=&cmd=_flow&transaction_subject=12&txn_type=web_accept&payment_date=01%3A59%3A21+May+02%2C+2011+PDT&last_name=User&residence_country=CA&pending_reason=paymentreview&item_name=Payment+for+course+registration&payment_gross=&mc_currency=CAD&business=pramod_1298956597_biz%40sumerusolutions.com&payment_type=instant&protection_eligibility=Ineligible&payer_status=verified&verify_sign=Ag7LtkvrF1u9.1ScLJwRM4btR1G1A16qsCs-xUl6EpI1rE1UWpodXJsc&txn_id=15Y20623GD922445F&payer_email=pramod_1298961722_per%40sumerusolutions.com&tax=0.00&test_ipn=1&first_name=Test&receiver_email=pramod_1298956597_biz%40sumerusolutions.com&quantity=1&payer_id=Z2MRT3Q9L6E28&receiver_id=RT3M59WESZHEE&item_number=&payment_status=Pending&handling_amount=0.00&shipping=0.00&mc_gross=850.00&custom=12&charset=windows-1252&notify_version=3.1&merchant_return_link=click+here&form_charset=UTF-8CONTEXT=wtgSziM4C5x0SI-9CmKcv2vkSeTLK5P_g6HqzC__YTYkcqziFNcB84p79Ja&myAllTextSubmitID=&cmd=_flow&transaction_subject=12&txn_type=web_accept&payment_date=01%3A59%3A21+May+02%2C+2011+PDT&last_name=User&residence_country=CA&pending_reason=paymentreview&item_name=Payment+for+course+registration&payment_gross=&mc_currency=CAD&business=pramod_1298956597_biz%40sumerusolutions.com&payment_type=instant&protection_eligibility=Ineligible&payer_status=verified&verify_sign=Ag7LtkvrF1u9.1ScLJwRM4btR1G1A16qsCs-xUl6EpI1rE1UWpodXJsc&txn_id=15Y20623GD922445F&payer_email=pramod_1298961722_per%40sumerusolutions.com&tax=0.00&test_ipn=1&first_name=Test&receiver_email=pramod_1298956597_biz%40sumerusolutions.com&quantity=1&payer_id=Z2MRT3Q9L6E28&receiver_id=RT3M59WESZHEE&item_number=&payment_status=Pending&handling_amount=0.00&shipping=0.00&mc_gross=850.00&custom=12&charset=windows-1252&notify_version=3.1&merchant_return_link=click+here&form_charset=UTF-8&cmd=_notify-validate

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T22:17:51+00:00Added an answer on May 21, 2026 at 10:17 pm

    Ok. After lot of trial and error and posting this issue in paypal forum I got my payment gateway working. Though I’m not really happy with the solution.The solution is use PDT and don’t use IPN. The response I got from paypal support was
    “The Problem is that IPN is an additional Notification system and there is a little delay in it. So it is not 100% the perfect solution for an autoreturn Page.”

    Paypal suggested me to use PDT and it’s working now. I’ll put the steps here so that it may help someone who is also facing such issue:

    1. Activate the “AutoReturn” and PDT feature in your PayPal Account. Steps:
      Login to your PayPal account
      click on Profile
      click on Website Payment Preferences
      set Auto Return to On
      enter a valid URL in the Return URL text box
      set Payment Data Transfer to on. Note down the PDT token displayed.
      scroll to the bottom of the page and click “Save”

    2. Pass below parameters to paypal cmd, business, item_name, amount, return, currency_code, custom.

    3. Change IPN handler code with PDT code, PDT code in my case is as below-

      string authToken, txToken, query;
      string strResponse;

          authToken = ConfigurationManager.AppSettings["PDTToken"];
      
          //read in txn token from querystring
          txToken = Request.QueryString.Get("tx");
      
      
          query = string.Format("cmd=_notify-synch&tx={0}&at={1}", txToken, authToken);
      
          // Create the request back
          string url = ConfigurationManager.AppSettings["PayPalUrl"];
          HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
      
          // Set values for the request back
          req.Method = "POST";
          req.ContentType = "application/x-www-form-urlencoded";
          req.ContentLength = query.Length;
      
          // Write the request back IPN strings
          StreamWriter stOut = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII);
          stOut.Write(query);
          stOut.Close();
      
          // Do the request to PayPal and get the response
          StreamReader stIn = new StreamReader(req.GetResponse().GetResponseStream());
          strResponse = stIn.ReadToEnd();
          stIn.Close();            
      
          // If response was SUCCESS, parse response string and output details
          if (strResponse.StartsWith("SUCCESS"))
          {
      
          }
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.