Exemple #1
0
 public UserPayPalToken(string tokenId, decimal amount, StudyRoom studyRoom)
 {
     //User = user;
     TokenId   = tokenId ?? throw new ArgumentNullException(nameof(tokenId));
     Created   = DateTime.UtcNow;
     State     = UserTokenState.NotUsed;
     Amount    = amount;
     StudyRoom = studyRoom;
 }
        public StudyRoomSession(StudyRoom studyRoom, string sessionId)
        {
            StudyRoom = studyRoom;
            Created   = DateTime.UtcNow;
            SessionId = sessionId;

            UseUserToken();

            AddEvent(new StudyRoomSessionCreatedEvent(this));
        }
Exemple #3
0
        public virtual void AddToken(string userToken, decimal amount, StudyRoom studyRoom)
        {
            if (userToken == null)
            {
                throw new ArgumentNullException(nameof(userToken));
            }
            if (studyRoom == null)
            {
                throw new ArgumentNullException(nameof(studyRoom));
            }
            Country country = Country;

            if (country != Entities.Country.UnitedStates)
            {
                throw new ArgumentException("Only usa country can use paypal");
            }
            _userTokens.Add(new UserPayPalToken(userToken, amount, studyRoom));
            AddEvent(new StudentPaymentReceivedEvent(this));
        }
Exemple #4
0
 public StudyRoomUser(User user, StudyRoom room)
 {
     User = user;
     Room = room;
 }