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); }
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); }
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); }
public Address Get(Guid userGuid) { var shippingAddress = _cartSessionManager.GetSessionValue <Address>(CartManager.CurrentShippingAddressKey, userGuid); if (shippingAddress != null) { shippingAddress.User = _getCurrentUser.Get(); } return(shippingAddress); }
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)); }
private bool GetTermsAndConditionsAccepted(Guid userGuid) { return(_cartSessionManager.GetSessionValue <bool>(CartManager.TermsAndConditionsAcceptedKey, userGuid)); }
public string GetSecurityKey(Guid userGuid) { var response = _cartSessionManager.GetSessionValue <TransactionRegistrationResponse>(SagePayEnrolledResponseKey, userGuid); return(response != null ? response.SecurityKey : null); }
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)); }
public PaypointPaymentDetailsModel GetModel() { return(_cartSessionManager.GetSessionValue <PaypointPaymentDetailsModel>(PaypointPaymentModelKey, _getUserGuid.UserGuid, encrypted: true)); }