private async void btnConfirm_Clicked(object sender, EventArgs e) { try { vm.SelectAccount = SelectedAccount.SelectedItem; if (!vm.ValidateForm("CurrencySwapConclusion")) { MessageDialog.Show("Info", "You have to fill all fields before you can proceed", DialogType.Info, "OK", null, "", null); return; } vm.CurrencyCode = GlobalStaticFields.Customer.ListOfAllAccounts.FirstOrDefault(a => a.AccountBalanceAccountType == vm.SelectAccount).currencyCode; if (vm.SelectedCurrencyValue != vm.CurrencyCode) { MessageDialog.Show("Error", "The Source Account currency and the Currency you selected do not match", DialogType.Error, "OK", null, "", null); return; } string newRate = string.Empty; if (vm.SelectedCurrencyValue == "USD") { newRate = vm.USDCurrencyValue; } if (vm.SelectedCurrencyValue == "GBP") { newRate = vm.GBPCurrencyValue; } if (vm.SelectedCurrencyValue == "EUR") { newRate = vm.EURCurrecnyValue; } vm.Nuban = GlobalStaticFields.Customer.ListOfAllAccounts.FirstOrDefault(a => a.AccountBalanceAccountType == vm.SelectAccount).nuban; string responseMsg = $"Source Account: {vm.Nuban} \n Destination Account:{vm.BeneficiaryAcc} \n Rate:{newRate} \n Amount: {string.Format("{0:N1}", vm.AmountRecieved)}"; MessageDialog.Show("Confirmation", responseMsg, DialogType.Info, "Yes", () => { Device.BeginInvokeOnMainThread(() => { if (GlobalStaticFields.Customer.IsTPin) { var tpin = new PopUps.VerifyPinPage("Confirmation", vm.AmountRecieved, "NGN", responseMsg); tpin.Validated += Tpin_Validated; Navigation.PushAsync(tpin); } else { vm.ExecuteCurrencySwap(vm.Nuban, vm.CurrencyCode); } }); }, "No", null ); } catch (Exception ex) { ex.Message.ToString(); // throw; } }
private async void Confirm(object sender, EventArgs e) { if (AccountPicker.SelectedItem == null) { MessageDialog.Show("Treasury Bills", "Kindly select an account to continue.", DialogType.Info, "OK", null); return; } string message = $"You are about to purchase Treasury Bill of {BillAmountTxt.Text} with maturity value of {ValueTxt.Text} in {treasuryBill.Tenor} days. Do you want to continue?"; if (string.IsNullOrWhiteSpace(ValueTxt.Text)) { message = $"You are about to purchase Treasury Bill of {BillAmountTxt.Text}. Do you want to continue?"; } MessageDialog.Show("Treasury Bills", message, DialogType.Question, "Proceed", () => { Device.BeginInvokeOnMainThread(async() => { if (GlobalStaticFields.Customer.IsTPin) { var msg = $"Maturity value:{ValueTxt.Text}"; var ValidateTreasureBillTPIN = new PopUps.VerifyPinPage("Confirma Treasure Bill", BillAmountTxt.Text, "NGN", msg); ValidateTreasureBillTPIN.Validated += ValidateTreasureBillTPIN_Validated; await Navigation.PushAsync(ValidateTreasureBillTPIN); } else { CallPathian(); } }); }, "Cancel", null); }
private void SellTreasuryBill(object sender, EventArgs e) { string message = $"You are about to sell your Treasury Bill earlier than it's maturity date of {MaturityTxt.Text}. Do you want to continue?"; if (DateTime.Now.Date >= treasuryBill.MaturityDate.Date) { message = $"You are about to sell your Treasury Bill. Do you want to continue?"; } MessageDialog.Show("Treasury Bills", message, DialogType.Question, "Proceed", () => { Device.BeginInvokeOnMainThread(() => { if (GlobalStaticFields.Customer.IsTPin) { var SelltreasuryBillVerifyPIN = new PopUps.VerifyPinPage("Confirmation", Convert.ToDecimal(ValueTxt.Text).ToString("N2"), "NGN", null); SelltreasuryBillVerifyPIN.Validated += SelltreasuryBillVerifyPIN_Validated; Navigation.PushAsync(SelltreasuryBillVerifyPIN); } else { SellTBills(); } }); }, "Cancel", null); }
public async Task ExecuteCardLess() { try { if (GlobalStaticFields.Customer.IsTPin) { var CardLessWithdrawalWithTPIN = new PopUps.VerifyPinPage("Confirmation", Amount, "NGN", null); CardLessWithdrawalWithTPIN.Validated += CardLessWithdrawalWithTPIN_Validated; await Navigation.PushAsync(CardLessWithdrawalWithTPIN); } else { await DoExecuteCardlessWithdrawal(); } } catch (Exception ex) { MessageDialog.Show("OOPS", "An unknown error occurred while generating Token, please try again", DialogType.Error, "OK", null); } finally { // await prog.Dismiss(); } }
private void ValidateInfo() { if (AccountPicker.SelectedItem == null) { MessageDialog.Show("fvCard To Card Transfer", "Please select account to debit", DialogType.Error, "OK", null); return; } SenderAccountNumber = customer.ListOfAllAccounts.Where(x => x.AccountNumberWithBalance == AccountPicker.SelectedItem).SingleOrDefault().nuban; BeneficiaryCard = BeneficiaryCardTxt.Text; Beneficiary = BeneficiaryNameTxt.Text; Amount = AmountTxt.Text; Description = DescriptionTxt.Text; if (string.IsNullOrEmpty(BeneficiaryCard)) { MessageDialog.Show("Card To Card Transfer", "Please enter beneficiary card details", DialogType.Error, "OK", null); return; } else if (string.IsNullOrEmpty(Beneficiary)) { MessageDialog.Show("Card To Card Transfer", "Please enter Beneficiary's Fullname", DialogType.Error, "OK", null); return; } else if (string.IsNullOrEmpty(Amount)) { MessageDialog.Show("Card To Card Transfer", "Please enter amount to send", DialogType.Error, "OK", null); return; } else if (string.IsNullOrEmpty(Description)) { MessageDialog.Show("Card To Card Transfer", "Please enter a description", DialogType.Error, "OK", null); return; } else { MessageDialog.Show("Confirm Transaction", $"Please Confirm the transfer of: {Utilities.GetCurrency("NGN")}{Convert.ToDouble(Amount).ToString("N2")} to {Beneficiary}", DialogType.Question, "Proceed", () => { Device.BeginInvokeOnMainThread(() => { if (GlobalStaticFields.Customer.IsTPin) { var CardToCardVerifyPIN = new PopUps.VerifyPinPage("Confirmation", Convert.ToDouble(Amount).ToString("N2"), "NGN", null); CardToCardVerifyPIN.Validated += CardToCardVerifyPIN_Validated; Navigation.PushAsync(CardToCardVerifyPIN); } else { ProcessPayment(); } }); }, "Dismiss", null); } }
public async void DoFixedDeposit() { var accSplitted = Utilities.SplitBeneficiaryDetailsByTab(InvestAccount.Trim()); // string investAccount = accSplitted[0]; if (GlobalStaticFields.Customer.IsTPin) { var ValidateFixDepositWithTPIN = new PopUps.VerifyPinPage("Confirmation", FixedDepositDataModel.InvestAmount, "NGN", null); ValidateFixDepositWithTPIN.Validated += ValidateFixDepositWithTPIN_Validated; await Navigation.PushAsync(ValidateFixDepositWithTPIN); } else { await NewMethod(); } }
async void MakeBillsPayment() { Device.BeginInvokeOnMainThread(async() => { totalAmount = (Convert.ToDouble(txtAmount.Text) + Convert.ToDouble(Subcharge)); if (GlobalStaticFields.Customer.IsTPin) { var IsTPINValidate = new PopUps.VerifyPinPage("Confirmation", string.Format("{0:N1}", totalAmount), "NGN", null); IsTPINValidate.Validated += IsTPINValidate_Validated; await Navigation.PushAsync(IsTPINValidate); } else { DoBillsPaymentTransaction(); } }); }
private async void ConsumateTransfer() { try { BusinessLogic bl = new BusinessLogic(); var selectedDisplayedAcct = AccountListPicker.SelectedItem; var Nuban = GlobalStaticFields.Customer.ListOfAllAccounts.FirstOrDefault(k => k.AccountBalanceAccountType.ToLower().Trim() == selectedDisplayedAcct.ToLower().Trim()).nuban; svmx.AmountInputted = txtAmount.Text; svmx.MyAccount = Nuban; if (svmx.IsNewRecipient) { svmx.BeneficiaryAccount = txtToAccount.Text; } else if (svmx.IsExistingRecipient) { svmx.BeneficiaryAccount = svmx.SavedBeneficiaries.beneficiaryNuban; } //sterling to sterling transfer if (svmx.TransferTypeSelected.ToUpper().Trim() == SendMoneyConstantss.ToSterling.ToUpper().Trim()) { var nameVal = new IntraBankNameInquiry() { NUBAN = svmx.BeneficiaryAccount, ReferenceID = Utilities.GenerateReferenceId(), RequestType = "219" }; //await pd.Message = "Name Enqiury. Please wait"; // var pdd = await ProgressDialog.Show("Name Enquiry. Please wait."); var reply = await bl.NameInquiryIntrabank(nameVal); // await pdd.Dismiss(); if (reply != null) { if (reply.IBSResponse.ResponseCode == "00") { svmx.BeneficiaryName = reply.IBSResponse.ResponseText; svmx.NameofBeneficiaryBank = "Sterling Bank"; svmx.AmountFormattedComma = string.Format("{0:n}", Convert.ToInt32(svmx.AmountInputted)); if (SwitchSchedulePayment.IsToggled) { var ScheduleID = svmx.paymentScheduleTypes.FirstOrDefault(x => x.SchedulePaymentText == RepeatSchedule.SelectedItem.Trim()).SchedulePaymenyID; var FrequencyID = ScheduleFrequency(ScheduleDatePicker.Date, scheduleEndDatePicker.Date); svmx.createScheduleDebitPayment = new CreateScheduleDebitPayment { Amount = decimal.Parse(svmx.AmountInputted), bankCode = "0001", BillType = 1, FromAccount = svmx.MyAccount, remarks = txtReference.Text, Scheduled = ScheduleID, ScheduledCount = FrequencyID, StartDate = scheduleDate, ToAccount = svmx.BeneficiaryAccount }; //svmx.createScheduleDebitPayment = s; var msg = RepeatSchedule.SelectedItem.Trim() != "Never" ? RepeatSchedule.SelectedItem.Trim() : string.Empty; MessageDialog.Show("Confimation", $"You have initiated a {msg} schedule payment of {svmx.AmountInputted} to {reply.IBSResponse.ResponseText} of sterling bank to start on {scheduleDate} for " + $"{svmx.createScheduleDebitPayment.ScheduledCount} times {Environment.NewLine} Do you want to continue", DialogType.Info, "Yes", () => { Device.BeginInvokeOnMainThread(() => { if (GlobalStaticFields.Customer.IsTPin) { var SchedulePayTPIN = new PopUps.VerifyPinPage("Confirm schedule payment", svmx.AmountFormattedComma, "NGN", null); SchedulePayTPIN.Validated += SchedulePayTPIN_Validated; } else { CreateScheduleDebitSteringBank(svmx.createScheduleDebitPayment); } }); } , "No", null); } else { svmx.SterlingToSterling = new TransferSterlingToSterling() { Amount = txtAmount.Text, FromAccount = Nuban, ToAccount = svmx.BeneficiaryAccount, PaymentReference = txtReference.Text, ReferenceID = Utilities.GenerateReferenceId(), RequestType = "102" }; svmx.AmountFormattedComma = string.Format("{0:n}", Convert.ToInt32(svmx.AmountInputted)); MessageDialog.Show("Confirmation", $"You have initiated a transfer of NGN {svmx.AmountFormattedComma} to {svmx.BeneficiaryName} of Sterling" + Environment.NewLine + "Do you want to continue?", DialogType.Info, "Yes", () => { Device.BeginInvokeOnMainThread(() => { if (GlobalStaticFields.Customer.IsTPin) { var SendMoneyVerifySterlingTPIN = new PopUps.VerifyPinPage("Confirmation", svmx.AmountFormattedComma, "NGN", null); SendMoneyVerifySterlingTPIN.Validated += SendMoneyVerifyTPIN_Validated; Navigation.PushAsync(SendMoneyVerifySterlingTPIN); } else { ConsumateTransferToSterling(svmx.SterlingToSterling); } //ConsumateTransferToSterling2(); } ); } , "No", null ); } } else { MessageDialog.Show("Info", "Name Enquiry failed at this time. Please try again", DialogType.Info, "OK", null, "", null); } } else { MessageDialog.Show("Info", "Could not verify the name at this time. Please try again", DialogType.Info, "OK", null, "", null); } } else if (svmx.TransferTypeSelected.ToUpper().Trim() == SendMoneyConstantss.ToOtherBank.ToUpper().Trim())//sterling to other banks { try { if (svmx.IsNewRecipient) { svmx.NameofBeneficiaryBank = txtRecipientBank.Text; } else if (svmx.IsExistingRecipient) { svmx.NameofBeneficiaryBank = svmx.SavedBeneficiaries.Bank; svmx.DestinationBankCode = svmx.SavedBeneficiaries.BankCode; } if (string.IsNullOrEmpty(svmx.DestinationBankCode)) { svmx.DestinationBankCode = GetBankCode(txtRecipientBank.Text); } if (string.IsNullOrEmpty(svmx.DestinationBankCode)) { MessageDialog.Show("Error", "Destination bank code error. Please try again", DialogType.Error, "OK", null, "", null); return; } var nameVal = new InterbankNameInquiry() { DestinationBankCode = svmx.DestinationBankCode, ToAccount = svmx.BeneficiaryAccount, ReferenceID = Utilities.GenerateReferenceId(), RequestType = "105" }; var pdNameEnq = await ProgressDialog.Show("Name Enuiry. Please wait."); var nameValResp = await bl.NameInquiryInterbank(nameVal); await pdNameEnq.Dismiss(); if (nameValResp.IBSResponse.ResponseCode == "00") { svmx.BeneficiaryName = nameValResp.IBSResponse.AccountName; if (SwitchSchedulePayment.IsToggled) { var ScheduleID = svmx.paymentScheduleTypes.FirstOrDefault(x => x.SchedulePaymentText == RepeatSchedule.SelectedItem.Trim()).SchedulePaymenyID; var FrequencyID = ScheduleFrequency(ScheduleDatePicker.Date, scheduleEndDatePicker.Date); svmx.createScheduleDebitPayment = new CreateScheduleDebitPayment { Amount = decimal.Parse(svmx.AmountInputted), bankCode = svmx.DestinationBankCode, BillType = 2, FromAccount = svmx.MyAccount, remarks = txtReference.Text, Scheduled = ScheduleID, ScheduledCount = FrequencyID, StartDate = scheduleDate, ToAccount = svmx.BeneficiaryAccount }; var msg = RepeatSchedule.SelectedItem.Trim() != "Never" ? RepeatSchedule.SelectedItem.Trim() : string.Empty; MessageDialog.Show("Confimation", $"You have initiated a {msg} schedule payment of {svmx.AmountInputted} to {svmx.BeneficiaryName} of {svmx.NameofBeneficiaryBank} to start on {scheduleDate} for " + $"{svmx.createScheduleDebitPayment.ScheduledCount} times {Environment.NewLine} Do you want to continue", DialogType.Info, "Yes", () => { Device.BeginInvokeOnMainThread(() => { if (GlobalStaticFields.Customer.IsTPin) { var SchedulePayTPIN = new PopUps.VerifyPinPage("Confirm schedule payment", svmx.AmountFormattedComma, "NGN", null); SchedulePayTPIN.Validated += SchedulePayTPIN_Validated; } else { CreateScheduleDebitSteringBank(svmx.createScheduleDebitPayment); } }); } , "No", null); } else { svmx.OtherBanks = new OtherBanks() { Amount = Convert.ToDouble(txtAmount.Text), ToAccount = svmx.BeneficiaryAccount, DestinationBankCode = svmx.DestinationBankCode, ReferenceID = Utilities.GenerateReferenceId(), RequestType = "101", PaymentReference = txtReference.Text, SessionID = nameValResp.IBSResponse.SessionID, NEResponse = nameValResp.IBSResponse.ResponseCode, BenefiName = nameValResp.IBSResponse.AccountName, FromAccount = Nuban }; svmx.AmountFormattedComma = string.Format("{0:n}", Convert.ToInt32(svmx.AmountInputted)); MessageDialog.Show("Confirmation", $"You have initiated a transfer of {Utilities.GetCurrency("NGN")} {svmx.AmountFormattedComma} to {svmx.BeneficiaryName } of {svmx.NameofBeneficiaryBank}.{Environment.NewLine} You will charged {Utilities.GetCurrency("NGN")}52.50." + Environment.NewLine + "Do you want to continue?", DialogType.Info, "Yes", () => { Device.BeginInvokeOnMainThread(() => { if (GlobalStaticFields.Customer.IsTPin) { var SendMoneyVerifyTPINOtherBanks = new PopUps.VerifyPinPage("Confirmation", svmx.AmountFormattedComma, "NGN", null); SendMoneyVerifyTPINOtherBanks.Validated += SendMoneyVerifyTPINOtherBanks_Validated; Navigation.PushAsync(SendMoneyVerifyTPINOtherBanks); } else { ConsumateTransferToOtherbanks(svmx.OtherBanks); } }); }, "No", null); } } else { MessageDialog.Show("Error", "Error during name enquiry", DialogType.Error, "OK", null, "", null); //await pdd.Dismiss(); } } catch (Exception ex) { string log = ex.ToString(); await BusinessLogic.Log(log, "error at send money", "", "", "", ""); } } else { Device.BeginInvokeOnMainThread(() => { MessageDialog.Show("Info", "Did not find the configured transfer type", DialogType.Error, "OK", null); }); } } catch (Exception ex) { var log = ex; await BusinessLogic.Log(ex.ToString(), "Error at Send money", "", "", "", "SendMoneyLocally"); Device.BeginInvokeOnMainThread(() => { MessageDialog.Show("Info", "Sorry. Error Occured. Please try again", DialogType.Error, "OK", null); }); } //await pdd.Dismiss(); }
private async void SubmitBtn_Tapped(object sender, EventArgs e) { try { //Populate various models(Wallet, Account, Card) //var destination = DestinationCardPicker.SelectedItem; var method = MethodPicker.SelectedItem; //var account = GlobalStaticFields.Customer.ListOfAllAccounts.FirstOrDefault(k => k.AccountNumberWithBalance == AccountPicker.SelectedItem).nuban; var card = GlobalStaticFields.Customer.MyCards.Where(x => x.MaskedPan == CardPicker.SelectedItem).SingleOrDefault().CardPan; var debitCard = CardToDebitTxt.Text; var currency = CardCurrencyPicker.SelectedItem; var expiry = ExpiryTxt.Text.Replace("/", ""); var cvv = CVVTxt.Text; var pin = PinTxt.Text; var amount = AmountTxt.Text; //if (string.IsNullOrWhiteSpace(DestinationCardPicker.SelectedItem)) //{ // MessageDialog.Show("Fund Card", "Kindly select whose card to fund.", DialogType.Error, "OK", null); // return; //} if (string.IsNullOrWhiteSpace(MethodPicker.SelectedItem)) { MessageDialog.Show("Fund Card", "Kindly select funding method.", DialogType.Error, "OK", null); return; } if (string.IsNullOrWhiteSpace(card)) { MessageDialog.Show("Fund Card", "Kindly select the card to fund.", DialogType.Error, "OK", null); return; } if (string.IsNullOrWhiteSpace(amount)) { MessageDialog.Show("Fund Card", "Kindly enter the amount to fund.", DialogType.Error, "OK", null); return; } if (MethodPicker.SelectedItem == "From Card") { if (string.IsNullOrWhiteSpace(debitCard)) { MessageDialog.Show("Fund Card", "Kindly enter the card to debit.", DialogType.Error, "OK", null); return; } if (string.IsNullOrWhiteSpace(expiry)) { MessageDialog.Show("Fund Card", "Kindly enter the card expiry date.", DialogType.Error, "OK", null); return; } if (string.IsNullOrWhiteSpace(cvv)) { MessageDialog.Show("Fund Card", "Kindly enter the card's CVV.", DialogType.Error, "OK", null); return; } if (string.IsNullOrWhiteSpace(pin)) { MessageDialog.Show("Fund Card", "Kindly enter the card's PIN.", DialogType.Error, "OK", null); return; } if (string.IsNullOrWhiteSpace(currency)) { MessageDialog.Show("Fund Card", "Kindly enter the card's currency.", DialogType.Error, "OK", null); return; } cardModel = new FundWithCardModel() { pan = debitCard, cvv = cvv, pin = pin, expiry_date = expiry, currency = currency, CreditAccount = card, amount = amount, Translocation = "0,0", customerId = GlobalStaticFields.Customer.CustomerId, RequestType = 211, Referenceid = "5991" + DateTime.Now.Ticks.ToString(), remark = " " }; if (GlobalStaticFields.Customer.IsTPin) { var FundAccountVerifyTPIN = new PopUps.VerifyPinPage("Confirmation", amount, "NGN", null); FundAccountVerifyTPIN.Validated += FundAccountVerifyTPIN_Validated; await Navigation.PushAsync(FundAccountVerifyTPIN); } else { FundCardWithCard(); } } else if (MethodPicker.SelectedItem == "From Account") { var accountToDebit = GlobalStaticFields.Customer.ListOfAllAccounts.Where(x => x.nuban == AccountPicker.SelectedItem).SingleOrDefault(); var account = accountToDebit.nuban; if (string.IsNullOrWhiteSpace(account)) { MessageDialog.Show("Fund Card", "Kindly select account to debit.", DialogType.Error, "OK", null); return; } if (accountToDebit.accountType.ToLower().Contains("wallet")) { walletdModel = new FundWithWalletModel() { Referenceid = "5991" + DateTime.Now.Ticks.ToString(), toPAN = card, Amt = amount, WalletfromAcct = account, Narrations = " " }; if (GlobalStaticFields.Customer.IsTPin) { var FundAccountVerifyTPINs = new PopUps.VerifyPinPage("Confirmation", amount, "NGN", null); FundAccountVerifyTPINs.Validated += FundAccountVerifyTPINs_Validated;; await Navigation.PushAsync(FundAccountVerifyTPINs); } else { FundCardWithWallet(); } } else { accountModel = new FundWithAccountModel() { Referenceid = "5991" + DateTime.Now.Ticks.ToString(), PAN = card, Amount = amount, Account = account, RequestType = 213, Narration = " ", Translocation = "0,0" }; if (GlobalStaticFields.Customer.IsTPin) { var FundAccountVerifyTPINeS = new PopUps.VerifyPinPage("Confirmation", amount, "NGN", null); FundAccountVerifyTPINeS.Validated += FundAccountVerifyTPINeS_Validated;; await Navigation.PushAsync(FundAccountVerifyTPINeS); } else { FundCardWithAccount(); } } } } catch (Exception ex) { string log = ex.Message; await BusinessLogic.Log(ex.ToString(), "Exception on Fund Card", "", "", "", "FundCardPage"); } }