Esempio n. 1
0
        private async void SendPaymentConfirmationEmail(int userID, int paymentID)
        {
            var email     = _accountAccessor.FindUser(userID).Payload.Email;
            var items     = _paymentAccessor.GetDonationItems(paymentID);
            var itemNames = _donateAccessor.GetItemNames(items);

            var details = LoadPaymentDetails(paymentID).Payload;
            await System.Threading.Tasks.Task.Run(() => _emailService.SendPaymentConfirmationEmail(email, items, itemNames, details));
        }
Esempio n. 2
0
        public Result <UserSession> CreateAccessToken(int userID)
        {
            if (_accountAccessor.FindUser(userID) == null)
            {
                return(new Result <UserSession>(false, "Invalid UserID received."));
            }

            var accessToken = _encryptionService.CreateHash(Encoding.UTF8.GetBytes(DateTime.Now.ToString() + userID), _configuration["HashCode"]);
            var expiresOn   = DateTime.Now.AddDays(14);

            return(_accountAccessor.CreateAccessToken(userID, accessToken, expiresOn));
        }
Esempio n. 3
0
 private async void SendDropOffDonationConfirmationEmail(int userID, List <DonationItem> items, string deliveryDate)
 {
     var email     = _accountAccessor.FindUser(userID).Payload.Email;
     var itemNames = _donateAccessor.GetItemNames(items);
     await System.Threading.Tasks.Task.Run(() => _emailService.SendDropOffDonationConfirmationEmail(email, items, itemNames, deliveryDate));
 }
Esempio n. 4
0
 public Result <User> GetUser(int userID)
 {
     return(_accountAccessor.FindUser(userID));
 }