number.1
November 27th, 2013, 23:16
سلام درخواست تبدیل کد #c به php دارم
اگر کسی می تونه این کد زیر را به php تبدیل کنه لطفا به من بگه و مبلغش هم پرداخت میشه
private bool PaypalPDTVerified(string txToken, ref string strPost)
{
bool flag = true;
string pDTIdentityToken = this.PDTIdentityToken;
string str2 = string.Format("cmd=_notify-synch&tx={0}&at={1}", txToken, pDTIdentityToken);
string requestUriString = "https://www.paypal.com/cgi-bin/webscr";
if (((string) base.get_Settings()["dpEn"]) == "sandbox")
{
requestUriString = "https://www.sandbox.paypal.com/cgi-bin/webscr";
}
HttpWebRequest request = (HttpWebRequest) WebRequest.Create(requestUriString);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = str2.Length;
StreamWriter writer = new StreamWriter(request.GetRequestStream(), Encoding.ASCII);
writer.Write(str2);
writer.Close();
StreamReader reader = new StreamReader(request.GetResponse().GetResponseStre am());
strPost = reader.ReadToEnd();
reader.Close();
if (!strPost.StartsWith("SUCCESS"))
{
flag = false;
}
return flag;
}
اگر کسی می تونه این کد زیر را به php تبدیل کنه لطفا به من بگه و مبلغش هم پرداخت میشه
private bool PaypalPDTVerified(string txToken, ref string strPost)
{
bool flag = true;
string pDTIdentityToken = this.PDTIdentityToken;
string str2 = string.Format("cmd=_notify-synch&tx={0}&at={1}", txToken, pDTIdentityToken);
string requestUriString = "https://www.paypal.com/cgi-bin/webscr";
if (((string) base.get_Settings()["dpEn"]) == "sandbox")
{
requestUriString = "https://www.sandbox.paypal.com/cgi-bin/webscr";
}
HttpWebRequest request = (HttpWebRequest) WebRequest.Create(requestUriString);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = str2.Length;
StreamWriter writer = new StreamWriter(request.GetRequestStream(), Encoding.ASCII);
writer.Write(str2);
writer.Close();
StreamReader reader = new StreamReader(request.GetResponse().GetResponseStre am());
strPost = reader.ReadToEnd();
reader.Close();
if (!strPost.StartsWith("SUCCESS"))
{
flag = false;
}
return flag;
}