Пример #1
0
        public bool CanMakePayment(MakePaymentRequest request)
        {
            var validator = RequestValidatorFactory.GetValidator(request);

            return(IsAllowedPaymentScheme(request) &&
                   validator.IsValid(this, request));
        }
Пример #2
0
        private bool IsAllowedPaymentScheme(MakePaymentRequest request)
        {
            var paymentSchemeMapping = new Dictionary <PaymentScheme, AllowedPaymentSchemes>
            {
                { PaymentScheme.Bacs, AllowedPaymentSchemes.Bacs },
                { PaymentScheme.Chaps, AllowedPaymentSchemes.Chaps },
                { PaymentScheme.FasterPayments, AllowedPaymentSchemes.FasterPayments }
            };

            return(AllowedPaymentSchemes.HasFlag(paymentSchemeMapping[request.PaymentScheme]));
        }
Пример #3
0
 public void MakePayment(MakePaymentRequest request)
 {
     Balance -= request.Amount;
 }