예제 #1
0
        internal IHasBalances GetProduct(string debitProductType, string debitProduct, out TransactionResult transactionResult, string language)
        {
            IHasBalances product = null;

            transactionResult = new TransactionResult(false, "");

            switch (debitProductType)
            {
            case "isAccount":
                product = accountServices.GetAccountById(debitProduct, out transactionResult, language);
                break;

            case "isCreditCard":
                product = cardServices.GetCreditCardById(debitProduct, out transactionResult, language);
                break;

            case "isPrepaidCard":
                product = cardServices.GetPrePaidCardById(debitProduct, out transactionResult, language);
                break;

            case "isLoan":
                product = loanServices.GetLoanById(debitProduct, out transactionResult, language);
                break;
            }

            return(product);
        }
        public Loan GetLoanById(string id)
        {
            var transactionResult = new TransactionResult(false, "");
            var loan = loanServices.GetLoanById(id, out transactionResult, "greek");

            if (transactionResult.HasError)
            {
                ReturnErrorResponse(transactionResult.Message);
            }
            return(loan);
        }