Ejemplo n.º 1
0
        public ActionResult UpdateWithdrawalRequest(TransactionQueryBO transactionQuery)
        {
            try
            {
                // GET SESSIONS
                SessionController sessionController = new SessionController();
                TblUserAuth       userAuth          = sessionController.GetSession(HttpContext.Session);

                UserResponseBO        _apiResponse          = new UserResponseBO();
                TransactionAppService transactionAppService = new TransactionAppService();
                transactionAppService.UpdateWithdrawalRequest(transactionQuery);

                _apiResponse.HttpStatusCode = "200";
                _apiResponse.Message        = "Transaction successful";
                _apiResponse.Status         = "Success";

                return(Ok(_apiResponse));
            }
            catch (Exception ex)
            {
                ApiResponseBO _apiResponse = new ApiResponseBO();
                _apiResponse.HttpStatusCode = "400";
                _apiResponse.Message        = ex.Message;
                _apiResponse.Status         = "Error";

                return(BadRequest(_apiResponse));
            }
        }
Ejemplo n.º 2
0
        public ActionResult BackupFunds()
        {
            try
            {
                // GET SESSIONS
                SessionController sessionController = new SessionController();
                TblUserAuth       userAuth          = sessionController.GetSession(HttpContext.Session);

                UserResponseBO _apiResponse = new UserResponseBO();

                _apiResponse.HttpStatusCode = "200";
                _apiResponse.Message        = "Transaction successful";
                _apiResponse.Status         = "Success";

                return(Ok(_apiResponse));
            }
            catch (Exception ex)
            {
                ApiResponseBO _apiResponse = new ApiResponseBO();
                _apiResponse.HttpStatusCode = "400";
                _apiResponse.Message        = ex.Message;
                _apiResponse.Status         = "Error";

                return(BadRequest(_apiResponse));
            }
        }
Ejemplo n.º 3
0
        public ActionResult Receive([FromBody] WalletRecieveBO walletRecieve)
        {
            try
            {
                // GET SESSIONS
                SessionController sessionController = new SessionController();
                TblUserAuth       userAuth          = sessionController.GetSession(HttpContext.Session);

                UserAppService userAppService = new UserAppService();
                TblUserInfo    userInfo       = userAppService.Get(userAuth);

                WalletRecieveBO wallet = new WalletRecieveBO();
                wallet.AddressString = "Cardano wallet address";
                wallet.CallbackUrl   = "Your callback url";

                return(Ok(wallet));
            }
            catch (Exception ex)
            {
                ApiResponseBO _apiResponse = new ApiResponseBO();
                _apiResponse.HttpStatusCode = "400";
                _apiResponse.Message        = ex.Message;
                _apiResponse.Status         = "Error";

                return(BadRequest(_apiResponse));
            }
        }
Ejemplo n.º 4
0
        public ActionResult Send([FromBody] WalletTransactionBO walletTransaction)
        {
            try
            {
                // GET SESSIONS
                SessionController sessionController = new SessionController();
                TblUserAuth       userAuth          = sessionController.GetSession(HttpContext.Session);

                UserAppService userAppService = new UserAppService();
                TblUserInfo    userInfo       = userAppService.Get(userAuth);

                UserResponseBO _apiResponse = new UserResponseBO();

                TransactionAppService transactionAppService = new TransactionAppService();
                transactionAppService.CreateWithdrawalRequest(walletTransaction);

                _apiResponse.HttpStatusCode = "200";
                _apiResponse.Message        = "Transaction successful";
                _apiResponse.Status         = "Success";

                return(Ok(_apiResponse));
            }
            catch (Exception ex)
            {
                ApiResponseBO _apiResponse = new ApiResponseBO();
                _apiResponse.HttpStatusCode = "400";
                _apiResponse.Message        = ex.Message;
                _apiResponse.Status         = "Error";

                return(BadRequest(_apiResponse));
            }
        }
Ejemplo n.º 5
0
        public ActionResult GetWallet([FromBody] WalletBO wallet)
        {
            try
            {
                // GET SESSIONS
                SessionController sessionController = new SessionController();
                TblUserAuth       userAuth          = sessionController.GetSession(HttpContext.Session);

                UserAppService userAppService = new UserAppService();
                TblUserInfo    userInfo       = userAppService.Get(userAuth);

                List <WalletBO> walletBOs = new List <WalletBO>();
                WalletBO        walletBO  = new WalletBO();
                wallet.xPriv          = "Cardano private key";
                wallet.xPub           = "Cardano public key";
                wallet.Balance.Amount = 10m;

                walletBOs.Add(walletBO);

                return(Ok(walletBOs));
            }
            catch (Exception ex)
            {
                ApiResponseBO _apiResponse = new ApiResponseBO();
                _apiResponse.HttpStatusCode = "400";
                _apiResponse.Message        = ex.Message;
                _apiResponse.Status         = "Error";

                return(BadRequest(_apiResponse));
            }
        }
Ejemplo n.º 6
0
        public ActionResult Create()
        {
            try
            {
                // GET SESSIONS
                SessionController sessionController = new SessionController();
                TblUserAuth       userAuth          = sessionController.GetSession(HttpContext.Session);

                UserAppService userAppService = new UserAppService();
                TblUserInfo    userInfo       = userAppService.Get(userAuth);

                WalletBO wallet = new WalletBO();
                wallet.xPriv = "Cardano private key";
                wallet.xPub  = "Cardano public key";

                return(Ok(wallet));
            }
            catch (Exception ex)
            {
                ApiResponseBO _apiResponse = new ApiResponseBO();
                _apiResponse.HttpStatusCode = "400";
                _apiResponse.Message        = ex.Message;
                _apiResponse.Status         = "Error";

                return(BadRequest(_apiResponse));
            }
        }
Ejemplo n.º 7
0
        public ActionResult Update([FromBody] UserBO userBO)
        {
            UserAppService userAppService = new UserAppService();
            ApiResponseBO  _apiResponse   = new ApiResponseBO();

            try
            {
                userAppService.Create(userBO);

                _apiResponse.HttpStatusCode = "200";
                _apiResponse.Message        = "User successfully created";
                _apiResponse.Status         = "Success";
            }
            catch (Exception ex)
            {
                _apiResponse.HttpStatusCode = "500";
                _apiResponse.Message        = ex.InnerException.Message;
                _apiResponse.Status         = "Error";
            }

            return(Ok(_apiResponse));
        }
Ejemplo n.º 8
0
        public ActionResult History([FromBody] WalletBO wallet)
        {
            try
            {
                // GET SESSIONS
                SessionController sessionController = new SessionController();
                TblUserAuth       userAuth          = sessionController.GetSession(HttpContext.Session);

                UserAppService userAppService = new UserAppService();
                TblUserInfo    userInfo       = userAppService.Get(userAuth);

                List <WalletTransactionBO> walletTransactions = new List <WalletTransactionBO>();

                WalletTransactionBO walletTransaction = new WalletTransactionBO();
                walletTransaction.From   = "from wallet address..";
                walletTransaction.To     = "to wallet address..";
                walletTransaction.Amount = 100f;

                walletTransactions.Add(walletTransaction);

                walletTransaction.From   = "from wallet address..";
                walletTransaction.To     = "to wallet address..";
                walletTransaction.Amount = 100f;

                walletTransactions.Add(walletTransaction);

                return(Ok(walletTransactions));
            }
            catch (Exception ex)
            {
                ApiResponseBO _apiResponse = new ApiResponseBO();
                _apiResponse.HttpStatusCode = "400";
                _apiResponse.Message        = ex.Message;
                _apiResponse.Status         = "Error";

                return(BadRequest(_apiResponse));
            }
        }
Ejemplo n.º 9
0
        public ActionResult History([FromBody] TransactionQueryBO transactionQuery)
        {
            try
            {
                // GET SESSIONS
                SessionController sessionController = new SessionController();
                TblUserAuth       userAuth          = sessionController.GetSession(HttpContext.Session);

                TransactionAppService           transactionAppService    = new TransactionAppService();
                List <UserTransactionHistoryBO> userTransactionHistories = transactionAppService.Get(transactionQuery);

                return(Ok(userTransactionHistories));
            }
            catch (Exception ex)
            {
                ApiResponseBO _apiResponse = new ApiResponseBO();
                _apiResponse.HttpStatusCode = "400";
                _apiResponse.Message        = ex.Message;
                _apiResponse.Status         = "Error";

                return(BadRequest(_apiResponse));
            }
        }