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

  • Home
  • SEARCH
  • 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 6006873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:36:07+00:00 2026-05-23T01:36:07+00:00

I’m trying to implement a payment processor. In order to validate that the response

  • 0

I’m trying to implement a payment processor. In order to validate that the response is legitimate, I have to take the query string and append a validation key, then perform an MD5 hash and match my hashed values to theirs.

The payment processor is generating their hash based on a querystring like the following:

trnId=10000041
&messageText=Duplicate+Transaction+%2D+This+transaction+has+already+been+approved
&trnAmount=11.20
&trnDate=6%2F8%2F2011+12%3A32%3A20+PM
&trnEmailAddress=john%2Edoe%40gmail%2Ecom
&avsMessage=Address+Verification+not+performed+for+this+transaction%2E
&ref1=aab02ccd%2D7d17%2D4d09%2Da30c%2Dad6324fe33f1

Now if I were to call QueryString["messageText"] I would get "Duplicate Transaction - This transaction has already been approved". I can’t use that, as I need the + and %2D

So to generate my string I do something like this:

NameValueCollection queryString = new NameValueCollection(QueryString);
queryString.Remove("hashValue");

List<string> parameters = new List<string>();
foreach(string qs in queryString.Keys)
   parameters.Add(qs + "=" + HttpUtility.UrlEncode(QueryString[qs]));

string value = string.Join("&", parameters.ToArray());

My resulting string:

trnId=10000041
&messageText=Duplicate+Transaction+-+This+transaction+has+already+been+approved
&trnAmount=11.20
&trnDate=6%2f8%2f2011+1%3a05%3a09+PM
&trnEmailAddress=john.doe%40gmail.com
&avsMessage=Address+Verification+not+performed+for+this+transaction.
&ref1=aab02ccd-7d17-4d09-a30c-ad6324fe33f1

That is a little closer, but with 2 issues, the dashes and periods are not encoded, and the encoding generated lowercase instead of upper case. %2f instead of %2F.

Is there any way to fix this without doing a string.replace? A different method I could call that would provide the results I want?

  • 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-23T01:36:08+00:00Added an answer on May 23, 2026 at 1:36 am

    Use QueryString.ToString() to get the full query string as one big encoded string, including all &, +, etc. If that is still different from what you expect, you can go one level deeper and grab Request.RawUrl.Split('?')[1] .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.