Click here to Skip to main content
15,887,328 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: about connectivity of share market database. Pin
Ramkumar_S18-Sep-11 21:21
Ramkumar_S18-Sep-11 21:21 
AnswerRe: about connectivity of share market database. Pin
MaulikDusara19-Sep-11 2:13
MaulikDusara19-Sep-11 2:13 
Questionhow to show news on my page in between marquee using asp.net Pin
umeshdaiya18-Sep-11 3:19
umeshdaiya18-Sep-11 3:19 
AnswerRe: how to show news on my page in between marquee using asp.net Pin
m@dhu18-Sep-11 3:38
m@dhu18-Sep-11 3:38 
GeneralRe: how to show news on my page in between marquee using asp.net Pin
subhash11118-Sep-11 6:00
subhash11118-Sep-11 6:00 
GeneralRe: how to show news on my page in between marquee using asp.net Pin
umeshdaiya18-Sep-11 21:58
umeshdaiya18-Sep-11 21:58 
QuestionProblems connecting to AS/400 Pin
Member 322226418-Sep-11 1:29
Member 322226418-Sep-11 1:29 
QuestionPayPal Instant Payment Notification(IPN) Issue.. Pin
NetMan201217-Sep-11 8:45
NetMan201217-Sep-11 8:45 
Hi i m using paypal IPN for payment notifications. I am using the same code provided by Paypal however i m having issues. Here is the code

string strSandbox = "https://www.sandbox.paypal.com/cgi-bin/webscr";
string strLive = "https://www.paypal.com/cgi-bin/webscr";
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(strSandbox);

//Set values for the request back
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
byte[] param = Request.BinaryRead(HttpContext.Current.Request.ContentLength);
string strRequest = Encoding.ASCII.GetString(param);

Dictionary<string, string=""> nvs = new Dictionary<string, string="">();
string[] items = strRequest.Split("&".ToCharArray());

foreach (string item in items)
{
string[] parts = item.Split("=".ToCharArray());
nvs.Add(parts[0], HttpUtility.UrlDecode(parts[1]));
}

strRequest += "&cmd=_notify-validate";
req.ContentLength = strRequest.Length;

//for proxy
//Hook up 1&1 proxy server

//WebProxy proxy = new WebProxy("ntproxyus.lxa.perfora.net:3128",false);
//req.Proxy = proxy;

//Send transaction detail with the flag back to PayPal

StreamWriter streamOut = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII);
streamOut.Write(strRequest);
streamOut.Close();

//DataLayer dl3 = new DataLayer();
//dl3.executeQuery("Update petOwner set orderStatus = 'Afterproxy(Invalid Card)' where orderId = '" + Request.Form["item_name"] + "'");

//Get validation status from PayPal
StreamReader streamIn = new StreamReader(req.GetResponse().GetResponseStream());
string strResponse = streamIn.ReadToEnd();
streamIn.Close();

//DataLayer dl4 = new DataLayer();
//dl4.executeQuery("Update petOwner set orderStatus = 'Afterproxy2(Invalid Card)' where orderId = '" + Request.Form["item_name"] + "'");

if (strResponse == "VERIFIED")
{
//check the payment_status is Completed

if (nvs["payment_status"] == "Completed")
{
//check that txn_id has not been previously processed
//check that receiver_email is your Primary PayPal email
//check that payment_amount/payment_currency are correct
//process payment
DataLayer dl = new DataLayer();
dl.executeQuery("Update petOwner set orderStatus = 'Paid' where orderId = '" + Request.Form["item_name"] + "'");
CheckPaymentMode();
SendOrderEmail();
}
}
else if (strResponse == "INVALID")
{
DataLayer dl = new DataLayer();
dl.executeQuery("Update petOwner set orderStatus = 'Not Paid(Invalid Card)' where orderId = '" + Request.Form["item_name"] + "'");
//log for manual investigation
}
else
{
DataLayer dl = new DataLayer();
dl.executeQuery("Update petOwner set orderStatus = 'Not Paid(Invalid Card)' where orderId = '" + Request.Form["item_name"] + "'");
//log response/ipn data for manual investigation
}
}

The code is working fine untl this line of code

StreamWriter streamOut = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII);
streamOut.Write(strRequest);
streamOut.Close();

When it comes to send request to paypal. from here on no line of code gets executed.

I ve contacted the hosting company they are saying no proxy is needed to send request.

I am unable to trace the issue. Need urgent help

Thanks in Advance,

Asfand
AnswerRe: PayPal Instant Payment Notification(IPN) Issue.. Pin
Richard Andrew x6417-Sep-11 16:22
professionalRichard Andrew x6417-Sep-11 16:22 
AnswerRe: PayPal Instant Payment Notification(IPN) Issue.. Pin
MaulikDusara18-Sep-11 21:00
MaulikDusara18-Sep-11 21:00 
Questioncreate chat room Pin
apadana_198917-Sep-11 7:02
apadana_198917-Sep-11 7:02 
AnswerRe: create chat room Pin
m@dhu18-Sep-11 3:39
m@dhu18-Sep-11 3:39 
QuestionBroadcastMessage Pin
apadana_198917-Sep-11 3:16
apadana_198917-Sep-11 3:16 
AnswerRe: BroadcastMessage Pin
Parwej Ahamad17-Sep-11 5:13
professionalParwej Ahamad17-Sep-11 5:13 
AnswerRe: BroadcastMessage Pin
MaulikDusara19-Sep-11 2:14
MaulikDusara19-Sep-11 2:14 
Questionasp.net 2010 web.config Pin
Member 821751716-Sep-11 6:59
Member 821751716-Sep-11 6:59 
Questionhow to send mail without internet connection Pin
sathyan_829416-Sep-11 6:43
sathyan_829416-Sep-11 6:43 
AnswerRe: how to send mail without internet connection Pin
Richard MacCutchan17-Sep-11 1:20
mveRichard MacCutchan17-Sep-11 1:20 
GeneralRe: how to send mail without internet connection Pin
GenJerDan17-Sep-11 1:51
GenJerDan17-Sep-11 1:51 
GeneralRe: how to send mail without internet connection Pin
Richard MacCutchan17-Sep-11 2:46
mveRichard MacCutchan17-Sep-11 2:46 
QuestionMVC3 DropDownList Question Pin
eddieangel16-Sep-11 6:41
eddieangel16-Sep-11 6:41 
QuestionNeed lowdown on my custom CacheDependency implementation [modified] Pin
Jaime Premy15-Sep-11 16:46
professionalJaime Premy15-Sep-11 16:46 
AnswerRe: Need lowdown on my custom CacheDependency implementation Pin
Parwej Ahamad15-Sep-11 19:22
professionalParwej Ahamad15-Sep-11 19:22 
QuestionNeed help with Multi Select Drop down display Pin
Parul Jee15-Sep-11 10:46
Parul Jee15-Sep-11 10:46 
AnswerRe: Need help with Multi Select Drop down display Pin
MaulikDusara19-Sep-11 2:17
MaulikDusara19-Sep-11 2:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.