/// <summary>
        /// get the redirect url from wirecard
        /// </summary>
        /// <param name="paymentInfo">The payment information.</param>
        /// <returns>Task&lt;System.String&gt;.</returns>
        /// <exception cref="Exception">Create redirect url failed: {await response.Content.ReadAsStringAsync()}{Environment.NewLine}</exception>
        public async Task <string> GetRedirectUrlFromWirecard(PaymentInfo paymentInfo)
        {
            // http client
            var client = new HttpClient();

            // get endpoint and payment method
            var endpoint      = _wirecardConfiguration.GetEndpoint(paymentInfo.EndpointName);
            var paymentMethod = endpoint.GetPaymentMethod(paymentInfo.PaymentName);

            client.DefaultRequestHeaders.Authorization = CreateAuthenticationHeader(paymentMethod.Username, paymentMethod.Password);

            // set the request type
            var contentType = $"application/{paymentMethod.RequestType.ToString().ToLower()}";
            // create the payload for the wirecard rest request
            var payload = CreatePayload(paymentInfo, endpoint, paymentMethod);
            // get the response url from wirecard
            var response = await client.PostAsync(endpoint.Uri, new StringContent(payload, Encoding.UTF8, contentType));

            // there was a problem and the request was not successfull
            if (!response.IsSuccessStatusCode)
            {
                // throw exception with responese data
                throw new Exception($"Create redirect url failed: {await response.Content.ReadAsStringAsync()}{Environment.NewLine}");
            }

            // extract redirect url from response
            if (paymentMethod.RequestType == RequestFormat.Json)
            {
                return(await CreateRedirectUrlJson(response));
            }
            else
            {
                return(await CreateRedirectUrlXml(response));
            }
        }