Pergunta

I'm working on Payment Gateway for large e-Commerce site which is based on ASP.NET MVC3(C#). I've have PG Server IP address that they provide me for validation.
but I'm concern about Response.

I'm requesting to PG by below code.

   HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url);
   HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
   myHttpWebResponse.Close();

So, How can I validate IP address when I get response ? or Is there any technique to validate?

Foi útil?

Solução

There's no IP address in response. When you send an HTTP request to a given url, the DNS server resolves the domain name in this url to an IP address. So there's nothing to validate if you are sure that your are sending the HTTP request to the correct address: http://pg.com. There's no way to get a response from a different IP address than the one you sent the HTTP request to.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top