Exemple #1
0
        public List <WebPayPalNotification> getNotifications(int currentUserId)
        {
            this.me = getMe(currentUserId);

            if (me.type == "admin")
            {
                List <PayPalNotification>    notifications = db.PayPalNotifications.ToList();
                List <WebPayPalNotification> result        = new List <WebPayPalNotification>();

                using (PayPalAuthorizationRepo authorizationRepo = new PayPalAuthorizationRepo())
                {
                    foreach (PayPalNotification notification in notifications)
                    {
                        WebPayPalNotification webNotification = notification.convert();
                        webNotification.authorization = authorizationRepo.getAuthorization(this.me, notification.custom);
                        result.Add(webNotification);
                    }
                }

                return(result);
            }
            else
            {
                throw new PermissionDeniedException();
            }
        }
        public List<WebPayPalNotification> getNotifications(int currentUserId)
        {
            this.me = getMe(currentUserId);

            if (me.type == "admin")
            {
                List<PayPalNotification> notifications = db.PayPalNotifications.ToList();
                List<WebPayPalNotification> result = new List<WebPayPalNotification>();

                using (PayPalAuthorizationRepo authorizationRepo = new PayPalAuthorizationRepo())
                {
                    foreach (PayPalNotification notification in notifications)
                    {
                        WebPayPalNotification webNotification = notification.convert();
                        webNotification.authorization = authorizationRepo.getAuthorization(this.me, notification.custom);
                        result.Add(webNotification);
                    }
                }

                return result;
            }
            else
            {
                throw new PermissionDeniedException();
            }
        }
 public PayPalAuthorizationController()
 {
     this.repo = new PayPalAuthorizationRepo();
 }