예제 #1
0
        public async Task SendPayment(PaymentSystemType paymentSystemType, double value)
        {
            var fileLogger = new FileSystemLogger(@"C:\MisterPaymentLogger.txt");

            switch (paymentSystemType)
            {
            case PaymentSystemType.Microsoft:

                var microsoftPaymentSystem = new MicrosoftPaymentSystem(fileLogger);

                var microsoftAccount = new MicrosoftAccountModel
                {
                    Login    = "******",
                    Password = "******",
                    Value    = 666,
                };

                await microsoftPaymentSystem.SendPayment(microsoftAccount);

                break;

            case PaymentSystemType.Google:

                var googlePaymentSystem = new GooglePaymentSystem(fileLogger);

                var googleAccount = new GoogleAccountModel
                {
                    ApiKey = "my api key",
                    Value  = value,
                };

                await googlePaymentSystem.SendPayment(googleAccount);

                break;

            case PaymentSystemType.Facebook:

                var facebookPaymentSystem = new FacebookPaymentSystem(fileLogger);

                var facebookAccount = new FacebookAccountModel
                {
                    Ip       = "127.0.0.1",
                    Port     = 666,
                    Password = "******",
                    Value    = value,
                };

                await facebookPaymentSystem.SendPayment(facebookAccount);

                break;

            default: break;
            }
        }
예제 #2
0
        public Withdrawal(Guid id, Guid userMultiAccountId, decimal amount, PaymentSystemType paymentSystemType, string withdrawalFor)
        {
            ValidateDomain(id, userMultiAccountId, amount, withdrawalFor);

            Id = id;
            UserMultiAccountId = userMultiAccountId;
            Amount             = amount;
            PaymentSystemType  = paymentSystemType;
            WithdrawalFor      = withdrawalFor;
            WithdrawalId       = null;
            WithdrawnAt        = null;
            CreatedAt          = DateTimeOffset.Now;
        }
예제 #3
0
        public static Card CreateCard(User owner, decimal balance, CurrencyType currency = CurrencyType.Byn, PaymentSystemType cardtype = PaymentSystemType.MasterCard)
        {
            var card = new Card();

            card.ExpirationDate = DateTime.Now.AddDays(365);
            card.Balance        = balance;
            card.Currency       = currency;
            card.Owner          = owner;
            card.CardType       = cardtype;
            card.IsActive       = true;

            return(card);
        }