Exemplo n.º 1
0
        public void AddGiftCard(string code)
        {
            var userGuid = _getUserGuid.UserGuid;
            var codes    = _cartSessionManager.GetSessionValue(CurrentAppliedGiftCards, userGuid, new List <string>());

            if (!codes.Contains(code))
            {
                codes.Add(code);
            }
            _cartSessionManager.SetSessionValue(CurrentAppliedGiftCards, userGuid, codes);
        }
Exemplo n.º 2
0
        private Address GetBillingAddress(CartModel cart, Guid userGuid)
        {
            Address billingAddress = _billingAddressSameAsShippingAddress.Get(cart, userGuid) && cart.RequiresShipping
                ? _getShippingAddress.Get(userGuid)
                : _cartSessionManager.GetSessionValue <Address>(CartManager.CurrentBillingAddressKey, userGuid);

            if (billingAddress != null)
            {
                billingAddress.User = _getCurrentUser.Get();
            }
            return(billingAddress);
        }
Exemplo n.º 3
0
 public CartModel Assign(CartModel cart, Guid userGuid)
 {
     cart.ShippingAddress = _getShippingAddress.Get(userGuid);
     if (cart.RequiresShipping)
     {
         cart.PotentiallyAvailableShippingMethods =
             _shippingMethodUIService.GetEnabledMethods().FindAll(method => method.CanPotentiallyBeUsed(cart));
         cart.RequestedShippingDate =
             _cartSessionManager.GetSessionValue <DateTime?>(CartManager.CurrentShippingDateKey, userGuid);
         cart.ShippingMethod = GetShippingMethod(cart, userGuid);
     }
     return(cart);
 }
        public CartModel Assign(CartModel cart, Guid userGuid)
        {
            cart.UseRewardPoints          = _cartSessionManager.GetSessionValue <bool>(UseRewardPoints, userGuid);
            cart.AvailablePoints          = _getUserRewardPointsBalance.GetBalance(cart.User);
            cart.AvailablePointsValue     = _getUserRewardPointsBalance.GetBalanceValue(cart.User);
            cart.RewardPointsExchangeRate = _getUserRewardPointsBalance.GetExchangeRate();

            return(cart);
        }
Exemplo n.º 5
0
        public Address Get(Guid userGuid)
        {
            var shippingAddress = _cartSessionManager.GetSessionValue <Address>(CartManager.CurrentShippingAddressKey, userGuid);

            if (shippingAddress != null)
            {
                shippingAddress.User = _getCurrentUser.Get();
            }
            return(shippingAddress);
        }
Exemplo n.º 6
0
        public CartModel Assign(CartModel cart, Guid userGuid)
        {
            List <string> codes = _cartSessionManager.GetSessionValue(CartManager.CurrentAppliedGiftCards, userGuid,
                                                                      new List <string>());

            if (codes.Any())
            {
                var giftCards = _session.QueryOver <GiftCard>().Where(card => card.Code.IsIn(codes)).Cacheable().List();

                cart.AppliedGiftCards.AddRange(giftCards.Where(card => card.IsValidToUse()));
            }
            return(cart);
        }
 public decimal GetOrderAmount()
 {
     return(_cartSessionManager.GetSessionValue <decimal>(CurrentPaypointOrderAmount, _getUserGuid.UserGuid));
 }
Exemplo n.º 8
0
 private bool GetTermsAndConditionsAccepted(Guid userGuid)
 {
     return(_cartSessionManager.GetSessionValue <bool>(CartManager.TermsAndConditionsAcceptedKey, userGuid));
 }
Exemplo n.º 9
0
        public string GetSecurityKey(Guid userGuid)
        {
            var response = _cartSessionManager.GetSessionValue <TransactionRegistrationResponse>(SagePayEnrolledResponseKey, userGuid);

            return(response != null ? response.SecurityKey : null);
        }
Exemplo n.º 10
0
 public HashSet <string> Get(Guid?guid = null)
 {
     return(_cartSessionManager.GetSessionValue(CurrentDiscountCodesKey, guid ?? _getUserGuid.UserGuid, new HashSet <string>()));
 }
 private bool GetSessionValue(Guid userGuid)
 {
     return(_cartSessionManager.GetSessionValue(CartManager.CurrentBillingAddressSameAsShippingAddressKey,
                                                userGuid, true));
 }
Exemplo n.º 12
0
 public PaypointPaymentDetailsModel GetModel()
 {
     return(_cartSessionManager.GetSessionValue <PaypointPaymentDetailsModel>(PaypointPaymentModelKey, _getUserGuid.UserGuid,
                                                                              encrypted: true));
 }