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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:49:58+00:00 2026-05-20T07:49:58+00:00

Are there any tutorials out there on how to get the responses back from

  • 0

Are there any tutorials out there on how to get the responses back from a Google Checkout transaction when using C# and the GCheckout API. All of the examples I could find were for previous versions of the API and not the current one (2.5). More specifically, I’d like to see an example reply of what Google will post back to me without and HTTPS connection. I know it’s minimal data, but I’d still like to see an example of it and see how others are parsing it.

  • 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-20T07:49:58+00:00Added an answer on May 20, 2026 at 7:49 am

    Google sends notification internally
    Create a notification page like this:

    <%@ Import Namespace="System.IO" %>
    <%@ Import Namespace="GCheckout" %>
    <%@ Import Namespace="GCheckout.AutoGen" %>
    <%@ Import Namespace="GCheckout.Util" %>
    <%@ Import Namespace="System.Data.SqlClient" %>
    <%@ Import Namespace="System.Text" %>
    
    <script runat="server" language="c#">
    
    string serialnum = string.Empty;
    void Page_Load(Object sender, EventArgs e)
    {
        // Extract the XML from the request.
        Stream RequestStream = Request.InputStream;
        StreamReader RequestStreamReader = new StreamReader(RequestStream);
        string RequestXml = RequestStreamReader.ReadToEnd();
        RequestStream.Close();
        // Act on the XML.
        switch (EncodeHelper.GetTopElement(RequestXml))
        {
            case "new-order-notification":
                NewOrderNotification N1 = (NewOrderNotification)EncodeHelper.Deserialize(RequestXml, typeof(NewOrderNotification));
                
                    string OrderNumber1 = N1.googleordernumber;
                    string ShipToName = N1.buyershippingaddress.contactname;
                    string ShipToAddress1 = N1.buyershippingaddress.address1;
                    string ShipToAddress2 = N1.buyershippingaddress.address2;
                    string ShipToCity = N1.buyershippingaddress.city;
                    string ShipToState = N1.buyershippingaddress.region;
                    string ShipToZip = N1.buyershippingaddress.postalcode;
                    System.Xml.XmlNode[] arr = N1.shoppingcart.merchantprivatedata.Any;
                    String PData = String.Empty;
                    try
                    {
                        PData = arr[0].InnerText;
                    }
                    catch { PData = "Error"; }
                    decimal TotalPrice = 0.0M;
                    foreach (Item ThisItem in N1.shoppingcart.items)
                    {
                        string Name = ThisItem.itemname;
                        int Quantity = ThisItem.quantity;
                        decimal Price = ThisItem.unitprice.Value;
                        TotalPrice += Price * Quantity;
                    }
                    serialnum = N1.serialnumber;
                    string Message = "Order No : " + OrderNumber1 + " Total Price = $" + TotalPrice + "\r\nP. Data:" + PData;
               
                 LogTransaction(OrderNumber1, serialnum, Message, PData);
                SendGoogleAcknowledgement();
                break;
            case "risk-information-notification":
                RiskInformationNotification N2 = (RiskInformationNotification)EncodeHelper.Deserialize(RequestXml, typeof(RiskInformationNotification));
                // This notification tells us that Google has authorized the order and it has passed the fraud check.
                // Use the data below to determine if you want to accept the order, then start processing it.
                string OrderNumber2 = N2.googleordernumber;
                string AVS = N2.riskinformation.avsresponse;
                string CVN = N2.riskinformation.cvnresponse;
                bool SellerProtection = N2.riskinformation.eligibleforprotection;
                serialnum = N2.serialnumber;
                break;
            case "order-state-change-notification":
                OrderStateChangeNotification N3 = (OrderStateChangeNotification)EncodeHelper.Deserialize(RequestXml, typeof(OrderStateChangeNotification));
                // The order has changed either financial or fulfillment state in Google's system.
                string OrderNumber3 = N3.googleordernumber;
                string NewFinanceState = N3.newfinancialorderstate.ToString();
                string NewFulfillmentState = N3.newfulfillmentorderstate.ToString();
                string PrevFinanceState = N3.previousfinancialorderstate.ToString();
                string PrevFulfillmentState = N3.previousfulfillmentorderstate.ToString();
                serialnum = N3.serialnumber;
                break;
            case "charge-amount-notification":
                ChargeAmountNotification N4 = (ChargeAmountNotification)EncodeHelper.Deserialize(RequestXml, typeof(ChargeAmountNotification));
                // Google has successfully charged the customer's credit card.
                string OrderNumber4 = N4.googleordernumber;
                decimal ChargedAmount = N4.latestchargeamount.Value;
                serialnum = N4.serialnumber;
                break;
            case "refund-amount-notification":
                RefundAmountNotification N5 = (RefundAmountNotification)EncodeHelper.Deserialize(RequestXml, typeof(RefundAmountNotification));
                // Google has successfully refunded the customer's credit card.
                string OrderNumber5 = N5.googleordernumber;
                decimal RefundedAmount = N5.latestrefundamount.Value;
                serialnum = N5.serialnumber;
                break;
            case "chargeback-amount-notification":
                ChargebackAmountNotification N6 = (ChargebackAmountNotification)EncodeHelper.Deserialize(RequestXml, typeof(ChargebackAmountNotification));
                // A customer initiated a chargeback with his credit card company to get her money back.
                string OrderNumber6 = N6.googleordernumber;
                decimal ChargebackAmount = N6.latestchargebackamount.Value;
                serialnum = N6.serialnumber;
                break;
            default:
                break;
        }
    }
    
    private void SendGoogleAcknowledgement()
    {
        StringBuilder responseXml = new StringBuilder();
        responseXml.Append("<?xml version='1.0' encoding='UTF-8'?>");
        responseXml.Append("<notifiation-acknowledgment xmlns='http://checkout.google.com/schema/2' />");
        HttpResponse response =
        System.Web.HttpContext.Current.Response;
        response.StatusCode = 200;
        response.ContentType = "text/xml";
        response.Write(responseXml.ToString());
        response.End();
        
    }
    
    protected virtual void LogTransaction(string OrderNo, string SerialNo, string Message, String PData)
    {
        try
        {
            //Insert record in database
            string sql = "Update GoogleOrder Set GoogleOrderNumber = @GoogleOrderNumber WHERE PrivateData = @PData";
            using (SqlConnection Conn = new SqlConnection(ConfigurationManager.ConnectionStrings["inCommandConnectionString"].ConnectionString))
            {
                Conn.Open();
                SqlCommand Cmd = new SqlCommand(sql, Conn);
                Cmd.Parameters.AddWithValue("@GoogleOrderNumber", OrderNo);
                Cmd.Parameters.AddWithValue("@PData", PData);
                Cmd.ExecuteNonQuery();
                Conn.Close();
    
            }
        }
        catch (Exception ex)
        {
            LogError("Error to Save The order No" + OrderNo);
        }
        //Insert record in text file 
        LogError(Message);
    }
    private void LogError(String Message)
    {
        String LogFile = ConfigurationManager.AppSettings.Get("LinkPointLogFile");
        if (LogFile != "")
        {
            byte[] binLogString = Encoding.Default.GetBytes(Message);
    
            try
            {
                FileStream loFile = new FileStream(LogFile, FileMode.OpenOrCreate, FileAccess.Write, FileShare.Write);
                loFile.Seek(0, SeekOrigin.End);
                loFile.Write(binLogString, 0, binLogString.Length);
                loFile.Close();
            }
            catch { ; }
        }
    }
    

    On Google checkout setting page set the notification page name and path and you will get the response on that page.
    To test whether notification page is working or not, try to log the transaction into a txt file and once every thing is working smooth you can remove that code.

    In this example PData is a number I send to the google checkout to and get back the same number in notification, I used this to match the transaction with a particular order.

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

Sidebar

Related Questions

Are there any tutorials or guides out there that anyone knows of that will
Are there any decent tutorials for setting up F# in Visual Studio 2005? Everything
Are there any documents/tutorials on how to clip or cut a large image so
are there any good tutorials online for learning about the c# 2.0 language feature
Does anyone know of any good tutorials on ADO.NET Entity Framework? There are a
Is there any way to check whether a file is locked without using a
Is there any way to capture the MouseDown even from the .NET 2.0 TextBox
hey, i know there's lots of tutorials out there but none seem to be
Is there any good article, tutorial or similar references on interpreting the Execution Plan
Is there any free or commercial component written in .NET (no COM interop) that

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.