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 8384531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:25:37+00:00 2026-06-09T17:25:37+00:00

Been working a lot with Google Checkout and the responses are always huge amount

  • 0

Been working a lot with Google Checkout and the responses are always huge amount of XML data. What i want is to parse out the node called merchant-private-data from this rubble.

It might not always be present and it might be on several positions (with the same value).

I tried a simple approach but that did not yield any results.

From the sandbox response:

<?xml version="1.0" encoding="UTF-8"?>
<authorization-amount-notification xmlns="http://checkout.google.com/schema/2" serial-number="123456789">
    <authorization-amount currency="USD">11.65</authorization-amount>
    <authorization-expiration-date>2012-08-21T12:30:16.000Z</authorization-expiration-date>
    <avs-response>Y</avs-response>
    <cvn-response>U</cvn-response>
    ...
    <order-summary>
        ...
        <shopping-cart>
        ...
            <merchant-private-data>
                <MERCHANT_DATA_HIDDEN>50c77071-aeea-40fe-962b-f4d51d1f9b0</MERCHANT_DATA_HIDDEN>
            </merchant-private-data>
        ...
        </shopping-cart>
        ...
    </order-summary>
</authorization-amount-notification>

Might be in more locations and might not always be in that location.

My idea was this, but it did not work (yields 0 results even though i can see the node in the xml):

XDocument input = XDocument.Parse(xmldata);
string privateData = null;
var privateDataNode = (from nodes in input.Descendants("merchant-private-data") select nodes).FirstOrDefault();
if (privateDataNode != null && privateDataNode.HasElements && privateDataNode.Element("MERCHANT_DATA_HIDDEN") != null)
       privateData = privateDataNode.Element("MERCHANT_DATA_HIDDEN").Value;
  • 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-06-09T17:25:38+00:00Added an answer on June 9, 2026 at 5:25 pm

    You’re missing namespace, try it like this:

            XDocument input = XDocument.Parse(xmldata);
            XNamespace ns = input.Root.Name.Namespace;
    
            string privateData = null;
            var privateDataNode = (from nodes in input.Descendants(ns + "merchant-private-data") select nodes).FirstOrDefault();
            if (privateDataNode != null && privateDataNode.HasElements && privateDataNode.Element(ns + "MERCHANT_DATA_HIDDEN") != null)
                privateData = privateDataNode.Element(ns + "MERCHANT_DATA_HIDDEN").Value;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been working a lot with asp.net web forms and one think that I
I've been working a lot lately with perl, still I dont really know how
I'm primarily a Ruby guy, but lately I've been working on a lot of
I've been working a lot with PHP. But recently I was assigned some work
Been working with a lot of TimeSpans recently, and have a need to get
I've been working on a site that has a lot of PHP/Smarty involved, I've
I've been working with node.js for a while on a chat app (I know,
Hopefully this is a quickie: I've been doing a lot of Java/Google Web Toolkit
I've been working a lot with C# recently, and I've noticed that most code
I've been working a lot with dates and various capacities for the past month.

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.