Esempio n. 1
0
        public bool CanMakePayment(MakePaymentRequest request)
        {
            var validator = RequestValidatorFactory.GetValidator(request);

            return(IsAllowedPaymentScheme(request) &&
                   validator.IsValid(this, request));
        }
Esempio n. 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]));
        }
Esempio n. 3
0
 public void MakePayment(MakePaymentRequest request)
 {
     Balance -= request.Amount;
 }