|
|
|
Rank: Starting Member
Groups: Registered
Joined: 4/28/2010 Posts: 2
|
Hi, Im new to paypal dev.I have two sandbox account one for buyer and seller..Both are verified a/c. and i created a buy now button in that i mention succuess page url and faliure page url.when buyer a/c paid amount and return back to my page i check IPN staus its always INVAILDS.
Here i my coded
string strSandbox = "https://www.sandbox.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); strRequest += "&cmd=_notify-validate"; req.ContentLength = strRequest.Length;
//for proxy //WebProxy proxy = new WebProxy(new Uri("http://url:port#")); //req.Proxy = proxy;
//Send the request to PayPal and get the response StreamWriter streamOut = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII); streamOut.Write(strRequest); streamOut.Close(); StreamReader streamIn = new StreamReader(req.GetResponse().GetResponseStream()); string strResponse = streamIn.ReadToEnd(); streamIn.Close();
if (strResponse == "VERIFIED") { //check the payment_status is 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 } else if (strResponse == "INVALID") { //log for manual investigation } else { //log response/ipn data for manual investigation }
can any one help me.. whats went wrong?
Thanks in adv:)
|
|
|
|
|
|
|
|
|
Rank: Administrator
Groups: Administrators, Registered
Joined: 1/30/2008 Posts: 70 Location: ,
|
The IPN script you posted is running in the sandbox. Be sure that your test transaction is also going through the sandbox. --- Shannon @ PayLoadz.comSell Downloads - eBooks, Videos, Music, Documents, and more...
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 4/28/2010 Posts: 2
|
S test tranactions is going thr sandbox only ...i deleted all test a/c and created new and tested but still returns invaild..Please help..( i am testing it in LocalHost..)
|
|
|
|
Guest
|
YAFVision Theme by Jaben Cargman (Tiny Gecko)Powered by YAF |
YAF © 2003-2009, Yet Another Forum.NETThis page was generated in 0.264 seconds.