public Task <FunctionResponse> DepositMoney(HttpClient httpClient, string accountnumber, MoneyDepositData payload)
 {
     return(Task <FunctionResponse> .FromResult(new FunctionResponse()
     {
         Message = "This is a mock deposit",
         InError = false
     }));
 }
        public async Task <FunctionResponse> DepositMoney(HttpClient httpClient, string accountnumber, MoneyDepositData payload)
        {
            if (null != httpClient)
            {
                string key = "";

                key = _commands.FirstOrDefault(f => f.CommandName == "Deposit Money")?.ApiKey;

                Uri postTarget = new Uri(RetailBankApi.GetBase(), RetailBankApi.DepositMoney(accountnumber, key));

                string jsonContent = JsonConvert.SerializeObject(payload);
                // Turn the payload into a JSON
                var content = new ByteArrayContent(System.Text.Encoding.UTF8.GetBytes(jsonContent));
                content.Headers.ContentType = new MediaTypeHeaderValue(RetailBankApi.PAYLOAD_TYPE);

                var response = await httpClient.PostAsync(postTarget, content);

                if (response.IsSuccessStatusCode)
                {
                    var jsonString = await response.Content.ReadAsStringAsync();

                    return(JsonConvert.DeserializeObject <FunctionResponse>(jsonString));
                }
                else
                {
                    return(new FunctionResponse()
                    {
                        Message = $"Unable to deposit money - {response.StatusCode}", InError = true
                    });
                }
            }

            return(new FunctionResponse()
            {
                Message = $"Not connected to retail bank API", InError = true
            });
        }