public FundAccountOTPPage(DebitAnyBankCard model, string paymentId)
 {
     InitializeComponent();
     fundModel   = model;
     paymentID   = paymentId;
     dbcOTPMOdel = new DebitAnyBankCardWithOTP();
 }
        private async void SubmitBtn_Clicked(object sender, EventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(otpTxt.Text))
            {
                var pd = await ProgressDialog.Show("Please wait...");

                string endpoint = "Spay/DebitAnyBankCardWithOTP";
                string url      = BaseURL + endpoint;

                try
                {
                    dbcOTPMOdel = new DebitAnyBankCardWithOTP()
                    {
                        pin           = fundModel.pin,
                        expiry_date   = fundModel.expiry_date,
                        cvv2          = fundModel.cvv,
                        pan           = fundModel.pan,
                        otp           = otpTxt.Text.Trim(),
                        CreditAccount = fundModel.CreditAccount,
                        paymentId     = paymentID,
                        amount        = fundModel.amount.ToString()
                    };


                    var response = await apiRequest.Post(dbcOTPMOdel, "", BaseURL, endpoint, "FundAccountOTPPage", true);

                    if (response.StatusCode == HttpStatusCode.OK)
                    {
                        await pd.Dismiss();

                        var jsonString = await response.Content.ReadAsStringAsync();

                        jsonString = jsonString.JsonCleanUp();
                        var responseObj = JsonConvert.DeserializeObject <FundAccountOTPResponse>(jsonString);
                        if (responseObj.message == "Successful")
                        {
                            MessageDialog.Show("Success", $"Account funding of {responseObj.amount} was successful.", DialogType.Success, "OK", null);
                            Navigation.PushAsync(new Dashboard.Dashboard());
                        }
                        else
                        {
                            MessageDialog.Show("Failure", "Sorry we are unable to process your request at the moment. Kindly try again later.", DialogType.Error, "DISMISS", null);
                        }
                    }
                    else
                    {
                        await pd.Dismiss();

                        var jsonString = await response.Content.ReadAsStringAsync();

                        MessageDialog.Show("Error", "Sorry, We are unable to credit recipient's account at the moment. Kindly try again later", DialogType.Error, "OK", null);
                        await BusinessLogic.Log("", "", url, "**SENSITIVE**", jsonString, "FundAccountOTPPage");
                    }
                }
                catch (Exception ex)
                {
                    await pd.Dismiss();

                    MessageDialog.Show("Error", "Sorry, We are unable to credit recipient's account at the moment. Kindly try again later", DialogType.Error, "OK", null);
                    await BusinessLogic.Log(ex.ToString(), "", url, "**SENSITIVE**", "", "FundAccountOTPPage");
                }
            }
            else
            {
                MessageDialog.Show("Fund Account", "Kindly enter the OTP sent to your phone number and/or email address to continue", DialogType.Info, "OK", null);
            }
        }