Exemplo n.º 1
0
        public void CheckAllExpiredCarts()
        {
            var expiredCartDetails = _receiptRepository.CheckAllExpiredCarts();

            if (expiredCartDetails != null)
            {
                foreach (var item in expiredCartDetails)
                {
                    var message = string.Empty;
                    try
                    {
                        if (DateTime.Now.Subtract(item.CartGeneratedDate).TotalMinutes > CommonConstants.CartExpireTime)
                        {
                            message = Payment(item.UserId.ToString(), item.StoreId.ToString(), item.Id.ToString());
                        }
                    }
                    catch (Exception ex)
                    {
                        _log.Error(string.Format("Error while perform payment for Cart id: {0}. Error is: {1}", item.Id, ex));
                    }
                }
            }
        }