YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

IPN Status always Returns INVAILD Options
classdesk@gmail.com
#1 Posted : Wednesday, April 28, 2010 8:11:20 AM
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:)
Sponsor  
 
SPRFRKR
#2 Posted : Wednesday, April 28, 2010 1:01:16 PM
Rank: Administrator

Groups: Administrators, Registered

Joined: 1/30/2008
Posts: 68
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.com
Sell Downloads - eBooks, Videos, Music, Documents, and more...
classdesk@gmail.com
#3 Posted : Thursday, April 29, 2010 3:43:46 AM
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..)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFVision Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF | YAF © 2003-2009, Yet Another Forum.NET
This page was generated in 0.092 seconds.