Example #1
0
        private void HandleOrderStateChangeNotification(OrderStateChangeNotification notification)
        {
            NotificationSerialNumber = notification.serialnumber;

            string providerName = GoogleCheckoutLog.GetProviderNameFromOrderNumber(notification.googleordernumber);

            if (providerName.Length > 0)
            {
                GCheckoutNotificationHandlerProvider provider
                    = GCheckoutNotificationManager.Providers[providerName];

                if (provider != null)
                {
                    provider.HandleOrderStateChangeNotification(RequestXml, notification);

                    return;
                }
            }


            // if no provider found just log it
            log.Info("No GCheckoutNotification Provider found for google order " + notification.googleordernumber + " so just logging it");

            Guid orderGuid = GoogleCheckoutLog.GetCartGuidFromOrderNumber(notification.googleordernumber);

            SiteSettings siteSettings = CacheHelper.GetCurrentSiteSettings();

            GoogleCheckoutLog gLog = new GoogleCheckoutLog();

            gLog.SiteGuid         = siteSettings.SiteGuid;
            gLog.RawResponse      = RequestXml;
            gLog.NotificationType = "OrderStateChangeNotification";
            gLog.SerialNumber     = notification.serialnumber;
            gLog.OrderNumber      = notification.googleordernumber;
            gLog.FinanceState     = notification.newfinancialorderstate.ToString();
            gLog.FullfillState    = notification.newfulfillmentorderstate.ToString();
            gLog.GTimestamp       = notification.timestamp;
            gLog.AvsResponse      = notification.reason;
            gLog.CartGuid         = orderGuid;

            gLog.Save();
        }