protected void PostCartToGoogle(object sender, ImageClickEventArgs e)
        {
            if ((NopContext.Current.User == null) || (NopContext.Current.User.IsGuest && !CustomerManager.AnonymousCheckoutAllowed))
            {
                string loginURL = CommonHelper.GetLoginPageURL(true);
                Response.Redirect(loginURL);
            }

            //USD for US dollars, GBP for British pounds, SEK for Swedish krona, EUR for Euro etc
            GCheckoutButton1.Currency = CurrencyManager.PrimaryStoreCurrency.CurrencyCode;
            CheckoutShoppingCartRequest    Req = GCheckoutButton1.CreateRequest();
            GoogleCheckoutPaymentProcessor googleCheckoutPaymentProcessor = new GoogleCheckoutPaymentProcessor();

            NopSolutions.NopCommerce.BusinessLogic.Orders.ShoppingCart Cart = ShoppingCartManager.GetCurrentShoppingCart(ShoppingCartTypeEnum.ShoppingCart);
            GCheckoutResponse Resp = googleCheckoutPaymentProcessor.PostCartToGoogle(Req, Cart);

            if (Resp.IsGood)
            {
                Response.Redirect(Resp.RedirectUrl);
            }
            else
            {
                Response.Clear();
                Response.Write("Resp.RedirectUrl = " + Resp.RedirectUrl + "<br />");
                Response.Write("Resp.IsGood = " + Resp.IsGood + "<br />");
                Response.Write("Resp.ErrorMessage = " + Server.HtmlEncode(Resp.ErrorMessage) + "<br />");
                Response.Write("Resp.ResponseXml = " + Server.HtmlEncode(Resp.ResponseXml) + "<br />");
                Response.End();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string xmlData       = string.Empty;
            Stream RequestStream = Request.InputStream;

            using (StreamReader RequestStreamReader = new StreamReader(RequestStream))
                xmlData = RequestStreamReader.ReadToEnd();

            GoogleCheckoutPaymentProcessor googleCheckoutPaymentProcessor = new GoogleCheckoutPaymentProcessor();

            //authorize google callback request
            if (!googleCheckoutPaymentProcessor.VerifyMessageAuthentication(Request.Headers["Authorization"]))
            {
                Response.StatusCode        = 401;
                Response.StatusDescription = "Access Denied";
                Response.End();
            }

            if (this.SettingManager.GetSettingValueBoolean("PaymentMethod.GoogleCheckout.DebugModeEnabled"))
            {
                if (CommonHelper.QueryStringInt("nopCommerceTestNewOrder1") > 0)
                {
                    xmlData = File.ReadAllText(HttpContext.Current.Server.MapPath("google/sample-neworder.txt"));
                }
                if (CommonHelper.QueryStringInt("nopCommerceTestNewOrder2") > 0)
                {
                    xmlData = File.ReadAllText(HttpContext.Current.Server.MapPath("google/sample-neworder-noShipment.txt"));
                }
                else if (CommonHelper.QueryStringInt("nopCommerceTestOrderChange") > 0)
                {
                    xmlData = File.ReadAllText(HttpContext.Current.Server.MapPath("google/sample-orderchangestate.txt"));
                }
                else if (CommonHelper.QueryStringInt("nopCommerceTestRisk") > 0)
                {
                    xmlData = File.ReadAllText(HttpContext.Current.Server.MapPath("google/sample-risk.txt"));
                }
            }
            googleCheckoutPaymentProcessor.ProcessCallBackRequest(xmlData);

            //ack
            string NotificationAcknowledgment = googleCheckoutPaymentProcessor.GetNotificationAcknowledgmentText();

            Response.Clear();
            Response.Write(NotificationAcknowledgment);
            Response.Flush();
            Response.End();
        }