Thursday, 22 August 2013

Asp.net Paypal Return Url Requirement

Asp.net Paypal Return Url Requirement

I'm using asp.net for my test program.
//string Server_URL = "https://www.paypal.com/ph/cgi-bin/webscr?";
string Server_URL =
ConfigurationManager.AppSettings["URL"].ToString();
//Assigning Cmd Path as Statically to Parameter
string cmd = "_xclick";
//Assigning business Id as Statically to Parameter
string business =
ConfigurationManager.AppSettings["BusinessName"].ToString();
//Assigning item name as Statically to Parameter
string item_name = lblProductCode.Text;
//Passing Amount as Statically to parameter
double amount = Convert.ToDouble(_lblPrice.Text);
Session["Amount"] = amount;
//Passing Currency as Statically to parameter
string currency_code = "PHP";
string redirect = "";
//Pass your
Server_Url,cmd,business,item_name,amount,currency_code
variable.
redirect += Server_URL;
redirect += "cmd=" + cmd;
redirect += "&business=" + business;
redirect += "&first_name=" + Session["id"].ToString();
redirect += "&item_name=" + item_name;
redirect += "&amount=" + amount;
redirect += "&quantity=1";
redirect += "&currency_code=" + currency_code;
redirect += "&return=http://localhost:49457/Fun/Success.aspx";
redirect += "&cancel_return=" +
ConfigurationManager.AppSettings["FailedURL"].ToString();
Session["Redirect"] = redirect;
Response.Redirect(redirect);
Now in Website Payment Preferences I set the return URL same in my return
in my code. it said "We were unable to validate the URL you have entered.
Please check your entry and try again."
Is it possible to insert a localhost url in the return url???

No comments:

Post a Comment