public async Task <PaymentTermsRegRespObj> TransferPaymentAsync(inv_invoice invoice)
        {
            var paymentResponse = new PaymentTermsRegRespObj {
                Status = new APIResponseStatus {
                    IsSuccessful = false, Message = new APIResponseMessage()
                }
            };

            try
            {
                var banks = await _financeServer.GetAllBanksAsync();

                var currencies = await _serverRequest.GetSingleCurrencyAsync(invoice.CurrencyId);

                var CurrencyCode       = currencies.commonLookups.FirstOrDefault(q => q.LookupId == invoice.CurrencyId)?.code;
                var suplierBankDetails = _dataContext.cor_bankaccountdetail.Where(d => d.SupplierId == invoice.SupplierId).ToList();
                if (suplierBankDetails.Count() == 0)
                {
                    paymentResponse.Status.Message.FriendlyMessage = "UnIdentified Supplier Bank Details";
                    return(paymentResponse);
                }
                var singlesupbnDet = suplierBankDetails.FirstOrDefault(a => invoice.SupplierBankId == a.BankAccountDetailId);
                if (singlesupbnDet == null)
                {
                    paymentResponse.Status.Message.FriendlyMessage = "Unable to find Supplier Bank Details";
                    return(paymentResponse);
                }
                if (string.IsNullOrEmpty(CurrencyCode))
                {
                    paymentResponse.Status.Message.FriendlyMessage = "UnIdentified Currency";
                    return(paymentResponse);
                }
                if (banks.bank.Count() > 0)
                {
                    if (!banks.bank.Select(w => w.BankGlId).Contains(singlesupbnDet.Bank))
                    {
                        paymentResponse.Status.Message.FriendlyMessage = "UnIdentified Supplier Bank Details";
                        return(paymentResponse);
                    }
                    var trans = new TransferObj();

                    trans.account_bank   = banks.bank.FirstOrDefault(q => q.BankGlId == invoice.PaymentBankId)?.BankCode;
                    trans.account_number = singlesupbnDet.AccountNumber;
                    trans.amount         = Convert.ToInt64(invoice.Amount);
                    trans.currency       = CurrencyCode;
                    trans.debit_currency = CurrencyCode;
                    trans.narration      = $"'{invoice.Description}' Payment";
                    trans.reference      = invoice.InvoiceNumber;
                    var res = await _financeServer.MakePaymentsAsync(trans);

                    if (res.status == null || !res.status.Contains("success"))
                    {
                        paymentResponse.Status.Message.FriendlyMessage = res.message;
                        //return paymentResponse;
                    }

                    var entryRequest1 = BuildSupplierSecondEntryRequestObject(invoice);
                    var invoiceentry  = await _financeServer.PassEntryAsync(entryRequest1);

                    if (!invoiceentry.Status.IsSuccessful)
                    {
                        paymentResponse.Status.IsSuccessful            = false;
                        paymentResponse.Status.Message.FriendlyMessage = $"Unable to pass invoice entry : '{invoiceentry.Status.Message.FriendlyMessage}'";
                        _logger.Information(invoiceentry.Status.Message.FriendlyMessage);
                        return(paymentResponse);
                    }
                    var entryRequest2 = BuildTaxEntryRequestObject(invoice);
                    if (entryRequest2.Count() > 0)
                    {
                        foreach (var tx in entryRequest2)
                        {
                            var taxEntry = await _financeServer.PassEntryAsync(tx);

                            if (!taxEntry.Status.IsSuccessful)
                            {
                                paymentResponse.Status.IsSuccessful            = false;
                                paymentResponse.Status.Message.FriendlyMessage = $"Unable to pass tax entry : '{taxEntry.Status.Message.FriendlyMessage}'";
                                _logger.Information(taxEntry.Status.Message.FriendlyMessage);
                                return(paymentResponse);
                            }
                        }
                    }
                    paymentResponse.Status.IsSuccessful = true;
                    return(paymentResponse);
                }
                else
                {
                    paymentResponse.Status.Message.FriendlyMessage = "No bank Found";
                    return(paymentResponse);
                }
            }
            catch (Exception ex)
            {
                paymentResponse.Status.Message.FriendlyMessage = ex?.Message;
                return(paymentResponse);
            }
        }