public static void OnLoad1Step( IAccountDetails form,  EventArgs args)
 {
     // TODO: Complete business rule implementation
     //Added this Blank Codesnippet to be able to add the two include library references. i.e.
     //System.Diagnostics and System.Text.RegularExpressions.
     //Feel free to add any code here as needed.
 }
        public bool MakePayment(PaymentType paymentType, decimal amount, IAccountDetails accountDetails)
        {
            var server        = FakeServerProvider.CreateServer(paymentType, accountDetails);
            var paymentResult = server.CallServer((double)amount, accountDetails);

            return(paymentResult);
        }
示例#3
0
 public Dictionary <string, string> AccountDetails(IAccountDetails accountDetails)
 {
     return(new Dictionary <string, string>()
     {
         { "AuthenticationToken", AuthenticationToken }
     });
 }
        public TotalCostCalculatorTests()
        {
            _accountDetails = A.Fake <IAccountDetails>();

            A.CallTo(() => _accountDetails.GetAccountPriceBands(_customerAccount))
            .Returns(GetAccountPriceBands());

            _calculator = new TotalCostCalculator(_accountDetails);
        }
        public bool CallServer(double amount, IAccountDetails accountDetails)
        {
            var clientDetails = JObject.FromObject(accountDetails);

            clientDetails.Add("Amount", amount);
            var res = Process(clientDetails.ToString());

            return(res.Contains("Success"));
        }
        public bool CallServer(double amount, IAccountDetails accountDetails)
        {
            var clientDetails = accountDetails.AccountDetails(accountDetails);

            var res = MakePayment(clientDetails["CardHolder"], clientDetails["CardNumber"],
                                  clientDetails["Cvv"], (double)amount);

            return(!string.IsNullOrEmpty(res));
        }
        public bool CallServer(double amount, IAccountDetails accountDetails)
        {
            var clientDetails  = accountDetails.AccountDetails(accountDetails);
            var transactionKey = BeginTransaction("C6BE96CA-C7D4-4D36-9852-DF1B44046022");

            SubmitPayment(transactionKey, clientDetails["AuthenticationToken"], amount);
            var res = CommitTransaction(transactionKey);

            return(res.Success);
        }
示例#8
0
 public TransactionController(ITransactionRepository transactionRepository, IMapper mapper,
                              IObjectJsonConverter objectJsonConverter, ILogger <TransactionController> logger,
                              IAccountDetails accountDetails, ITransactionLogic transactionLogic)
 {
     _transactionRepository = transactionRepository;
     _mapper = mapper;
     _objectJsonConverter = objectJsonConverter;
     _logger           = logger;
     _accountDetails   = accountDetails;
     _transactionLogic = transactionLogic;
     //Setting it to default account Id 1, needs to be changed later to dynamically select accountId based on login
     _accountDetails.AccountId = 1;
 }
示例#9
0
        public static IFakeServer CreateServer(PaymentType paymentType, IAccountDetails account)
        {
            IFakeServer fakeServer = paymentType switch
            {
                PaymentType.BitCoin when account.CanHandle(paymentType) => new FakeBitCoinPaymentServer(),
                PaymentType.PayPal when account.CanHandle(paymentType) => new FakePayPalPaymentServer(),
                PaymentType.DebitCard when account.CanHandle(paymentType) => new FakeDirectDebitPaymentServer("ROTE-0001UK"),
                _ => throw new ArgumentOutOfRangeException(nameof(paymentType), paymentType, null)
            };

            return(fakeServer);
        }
    }
 public TotalCostCalculator(IAccountDetails accountDetails)
 {
     _accountDetails = accountDetails;
 }
示例#11
0
 public AccountController()
 {
     ad = new AccountDetails();
 }
示例#12
0
        public void SetUp()
        {
            mockAccountDetails = Substitute.For <IAccountDetails>();

            totalCostCalculator = new TotalCostCalculator(mockAccountDetails);
        }
示例#13
0
 public PurchaseOrderService(IGetCustomersOrder getCustomersOrder, IAccountDetails accountDetails, IGenerateShippingSlip generateShippingSlip)
 {
     _getCustomersOrder    = getCustomersOrder;
     _accountDetails       = accountDetails;
     _generateShippingSlip = generateShippingSlip;
 }
示例#14
0
 public Dictionary <string, string> AccountDetails(IAccountDetails accountDetails)
 {
     return(new()
     {
         { "CardHolder", CardHolder },
         { "CardNumber", CardNumber },
示例#15
0
 public AccountController(IAccountDetails accountDetails)
 {
     ad = accountDetails;
 }
示例#16
0
 public TotalCostCalculator(IAccountDetails accountDetails)
 {
     _accountDetails = accountDetails ?? throw new ArgumentNullException(nameof(accountDetails));
 }
 public Dictionary <string, string> AccountDetails(IAccountDetails accountDetails)
 {
     throw new System.NotImplementedException();
 }