public async Task <string> CardToCardMVISA(MVISACardModel model)
        {
            string url      = BaseURI;
            string endpoint = "Spay/MVisaPushFundsTransactions";

            var response = await apiRequest.Post(model, "", BaseURI, endpoint, "CardToCardPage");

            if (response.StatusCode == HttpStatusCode.OK)
            {
                var jsonstring = await response.Content.ReadAsStringAsync();

                return(jsonstring);
            }

            return("");
        }
        private async void ProcessPayment()
        {
            var pd = await ProgressDialog.Show("Sending payment, please wait...");

            DateTime d  = DateTime.Today;
            int      yr = DateTime.Today.Year;
            string   lastDigitOfYear = yr.ToString().Substring(3, 1);
            var      da = lastDigitOfYear + d.DayOfYear.ToString("000");
            var      systTraceAuditNo = "05" + GenNewPin().ToString();
            string   destAmt          = "";

            var curCode = customer.ListOfAllAccounts.Where(s => s.nuban.Equals(SenderAccountNumber)).FirstOrDefault().currency;


            var cardEnquiry = new MVISAEnquiryData()
            {
                Referenceid              = Utilities.GenerateReferenceId(),
                RequestType              = 138,
                Translocation            = GlobalStaticFields.GetUserLocation,
                acquiringBin             = "408999",
                acquirerCountryCode      = "840",
                primaryAccountNumber     = BeneficiaryCard,
                retrievalReferenceNumber = da + DateTime.Now.ToString("HH") + systTraceAuditNo,  //"0055" + _helperClass.GenNewPin(),
                systemsTraceAuditNumber  = systTraceAuditNo
            };

            // call name Enquiry
            var market = await GetMarkup();   // get the markup rate

            MarkupRate markupRate = null;

            if (!string.IsNullOrEmpty(market))
            {
                markupRate = JsonConvert.DeserializeObject <MarkupRate>(market); // deserialise the markup rate
            }

            var enquiryResponse = await MVISAAccEnquiry(cardEnquiry);

            if (!string.IsNullOrEmpty(enquiryResponse))
            {
                var jsonData = JsonConvert.DeserializeObject <MVISAEnquiryResponse>(enquiryResponse);

                // perform some operations after name enquiry
                var replc = jsonData.responsedata.Replace('\\', ' ');
                var dd    = JsonConvert.DeserializeObject <MVISAEnquiryResponseData>(replc);

                if (dd.geoRestrictionInd != "N")
                {
                    await pd.Dismiss();

                    MessageDialog.Show("Error", "Recipient issuer does not participate in fast funds.", DialogType.Error, "OK", null);
                    return;
                }
                if (dd.pushFundsBlockIndicator == "N")
                {
                    await pd.Dismiss();

                    MessageDialog.Show("Error", "Recipient issuer does not participate in fast funds.", DialogType.Error, "OK", null);
                    return;
                }

                if (dd.cardIssuerCountryCode != "566")
                {
                    Random gen0    = new Random();
                    var    TraceNo = gen0.Next(100000, 999999);

                    // lets have a watchlist before
                    var wl = new MVisaWatchListReq()
                    {
                        cardIssuerCountryCode = dd.cardIssuerCountryCode,
                        city            = dd.billingCurrencyCode,
                        name            = Beneficiary,
                        Translocation   = GlobalStaticFields.GetUserLocation,
                        Referenceid     = Utilities.GenerateReferenceId(),
                        RequestType     = 140,
                        referenceNumber = da + DateTime.Now.ToString("HH") + TraceNo.ToString()
                    };

                    // call watchlist
                    var wldata = await MVisawatchListInquiry(wl);

                    if (!string.IsNullOrEmpty(wldata))
                    {
                        var wldd     = JsonConvert.DeserializeObject <MVISAEnquiryResponse>(wldata);
                        var wldReplc = wldd.responsedata.Replace('\\', ' ');
                        var wlrplcdd = JsonConvert.DeserializeObject <WListData>(wldReplc);
                        if (Convert.ToInt32(wlrplcdd.ofacScore) >= 65)
                        {
                            await pd.Dismiss();

                            MessageDialog.Show("Transaction Failed", "Recipient issuer does not participate in fast funds.", DialogType.Error, "OK", null);
                            return;
                        }
                    }

                    // lets call exchange rate
                    var exrate = new MVISAExchangeRate()
                    {
                        destinationCurrencyCode = dd.billingCurrencyCode,
                        sourceAmount            = Amount,
                        markUpRate = markupRate.markUpRate,
                        systemsTraceAuditNumber  = systTraceAuditNo,
                        Referenceid              = Utilities.GenerateReferenceId(),
                        RequestType              = 137,
                        retrievalReferenceNumber = da + DateTime.Now.ToString("HH") + systTraceAuditNo,
                        sourceCurrencyCode       = curCode,
                        Translocation            = GlobalStaticFields.GetUserLocation
                    };

                    var exchrt = await MVISAExchangeRate(exrate);

                    if (!string.IsNullOrEmpty(exchrt))
                    {
                        var dt     = JsonConvert.DeserializeObject <MVISAEnquiryResponse>(exchrt);
                        var dtrplc = dt.responsedata.Replace('\\', ' ');
                        var rplc   = JsonConvert.DeserializeObject <ExchangeRateResponse>(dtrplc);
                        // destAmt = rplc.destinationAmount;

                        var newDestAmount           = Convert.ToDecimal(Amount) / Convert.ToDecimal(rplc.destinationAmount);
                        var newDestAmount2          = newDestAmount * (Convert.ToDecimal(markupRate.markUpRate) / 100);
                        var newDestAmount3          = newDestAmount + newDestAmount2;
                        var actualDestinationAmount = Convert.ToDecimal(Amount) / newDestAmount3;
                        destAmt = actualDestinationAmount.ToString();
                    }
                }
                else
                {
                    destAmt = Amount;
                }

                var mVISA = new MVISACardModel()
                {
                    senderAccountNumber = SenderAccountNumber,
                    name                          = customer?.FirstName + " " + customer?.LastName,
                    recipientName                 = Beneficiary,
                    businessApplicationId         = "PP",
                    merchantCategoryCode          = "6012",
                    sourceOfFundsCode             = "03",
                    country                       = dd.cardIssuerCountryCode,
                    county                        = dd.cardIssuerCountryCode,
                    zipCode                       = dd.cardIssuerCountryCode,
                    state                         = "",
                    Translocation                 = GlobalStaticFields.GetUserLocation,
                    Referenceid                   = Utilities.GenerateReferenceId(),
                    idCode                        = "SBPL" + GenNewPin(),
                    terminalId                    = "323" + GenNewPin(),
                    transactionIdentifier         = GenNewPin().ToString(),
                    systemsTraceAuditNumber       = systTraceAuditNo,
                    RequestType                   = 144,
                    retrievalReferenceNumber      = da + DateTime.Now.ToString("HH") + systTraceAuditNo,
                    recipientPrimaryAccountNumber = BeneficiaryCard,
                    amount                        = destAmt,
                    transactionCurrencyCode       = dd.billingCurrencyCode,
                    destinationAmount             = destAmt
                };

                var response = await CardToCardMVISA(mVISA);

                if (!string.IsNullOrEmpty(response))
                {
                    var json = JsonConvert.DeserializeObject <CardToCardResponse>(response);
                    await pd.Dismiss();

                    if (json.response == "00")
                    {
                        if (dd.fastFundsIndicator == "B" ||
                            dd.fastFundsIndicator == "D" ||
                            dd.fastFundsIndicator == "E")
                        {
                            MessageDialog.Show("Info", "Your transaction was successful. Funds will be available to recipient within 30 mins of successful transfer", DialogType.Success, "OK", null);
                        }
                        else
                        {
                            MessageDialog.Show("Info", "YOur transaction was Successful. Funds will be available within 2 business days", DialogType.Success, "OK", null);
                        }
                    }
                }
                else
                {
                    await pd.Dismiss();

                    MessageDialog.Show("Error", "Sorry, this operation was not successful. Please try again later.", DialogType.Error, "OK", null);
                    return;
                }
            }
            else
            {
                await pd.Dismiss();

                MessageDialog.Show("Error", "Sorry we are unable to validate the beneficiary account. Please review and try again.", DialogType.Error, "OK", null);
                return;
            }
        }