Exemplo n.º 1
0
        public IActionResult SendMoney(string recipientcode, string accountnumber, string bankcode, string bankname, string name)
        {
            //Get user account name for final verification
            var result1 = _bankAccount.ResolveBankAccount(accountnumber, bankcode);
            var result2 = _bankAccount.GetPaystackBalance();
            var message = result1.Result.Result.message;

            if (result1.Result.Result.data == null)
            {
                TempData["notification"] = message;
                TempData["notifytype"]   = NotificationType.error;

                return(RedirectToAction("Index"));
            }


            var accountname = result1.Result.Result.data.account_name;
            var balance     = result2.Result.Result.data[0].balance;

            var sendmoneyviewmodel = new SendMoneyViewModel
            {
                balance       = balance,
                accountname   = accountname,
                bankname      = bankname,
                recipientcode = recipientcode,
                accountnumber = accountnumber,
                name          = name
            };

            //pass object to the view
            return(View(sendmoneyviewmodel));
        }
Exemplo n.º 2
0
        public IActionResult InitiateTransfer(SendMoneyViewModel sendMoneyViewModel)
        {
            var initiatetransfer = new InitiateTransferRequestModel
            {
                reason    = sendMoneyViewModel.reason,
                source    = "balance",
                amount    = sendMoneyViewModel.amount,
                recipient = sendMoneyViewModel.recipientcode,
                currency  = "NGN"
            };

            var result1 = _transfer.InitiateTransfer(initiatetransfer);
            var message = result1.Result.Result.message;

            if (result1.Result.Result.status == "true")
            {
                TempData["notification"] = "Transfer Initiated Successfully";
                TempData["notifytype"]   = NotificationType.success;
            }
            else
            {
                TempData["notification"] = message;
                TempData["notifytype"]   = NotificationType.error;
            }


            return(RedirectToAction("Index"));
        }
Exemplo n.º 3
0
 void SendMoney_Tapped(object sender, System.EventArgs e)
 {
     svm = new SendMoneyViewModel();
     svm.IsExistingRecipient = true;
     svm.IsNewRecipient      = false;
     Navigation.PushAsync(new Pages.LocalTransfer.SendMoney());
 }
Exemplo n.º 4
0
        public SendMoneyPage(IChikwamaNavService navService, NewWalletController controller)
        {
            InitializeComponent();


            BindingContext = new SendMoneyViewModel(navService, controller);
        }
Exemplo n.º 5
0
        protected override async void HandleOnNavigatedTo(NavigationEventArgs e)
        {
            base.HandleOnNavigatedTo(e);
            if (this._isInitialized)
            {
                return;
            }
            User   parameterForIdAndReset = (User)ParametersRepository.GetParameterForIdAndReset("MoneyTransferTargetUser");
            long   targetId = long.Parse(((Page)this).NavigationContext.QueryString["TargetId"]);
            int    amount   = int.Parse(((Page)this).NavigationContext.QueryString["Amount"]);
            string comment  = Extensions.ForUI(((Page)this).NavigationContext.QueryString["Comment"]);

            this._viewModel = new SendMoneyViewModel(targetId, parameterForIdAndReset, amount, comment);
            await Task.Delay(1);

            base.DataContext = this._viewModel;
            this._viewModel.Load();
            this._isInitialized = true;
        }