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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 11
0
 public AccountController()
 {
     ad = new AccountDetails();
 }
Exemplo n.º 12
0
        public void SetUp()
        {
            mockAccountDetails = Substitute.For <IAccountDetails>();

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