Example #1
0
        private void HandleAuthorizationAmountNotification(AuthorizationAmountNotification notification)
        {
            NotificationSerialNumber = notification.serialnumber;

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

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

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

                    return;
                }
            }

            // if no provider found just log it
            SiteSettings siteSettings = CacheHelper.GetCurrentSiteSettings();

            GoogleCheckoutLog gLog = new GoogleCheckoutLog();

            gLog.SiteGuid         = siteSettings.SiteGuid;
            gLog.NotificationType = "AuthorizationAmountNotification";
            gLog.RawResponse      = RequestXml;
            gLog.SerialNumber     = notification.serialnumber;
            gLog.OrderNumber      = notification.googleordernumber;
            gLog.GTimestamp       = notification.timestamp;
            gLog.AuthAmt          = notification.authorizationamount.Value;
            gLog.AuthExpDate      = notification.authorizationexpirationdate;
            gLog.CvnResponse      = notification.cvnresponse;
            gLog.AvsResponse      = notification.avsresponse;

            gLog.Save();
        }