/// <summary> /// Downloads the content of the accept or decline Url. /// </summary> /// <param name="uri">The URI.</param> /// <param name="payment">The payment.</param> /// <returns></returns> /// <remarks>This method converts the HTML page of the accept or decline url into a string. /// Instead of rederecting Authorize.NET in the <see cref="ProcessCallback"/>, we write the HTML page directly to them /// in their request. This method Returns the string to write to Authorize.NET. /// </remarks> private string DownloadPageContent(Uri uri, Payment payment) { var client = new WebClient(); var requestedHtml = client.DownloadData(uri.AddOrderGuidParameter(payment.PurchaseOrder)); var encoding = new UTF8Encoding(); return(encoding.GetString(requestedHtml)); }