Click here to Skip to main content
15,882,114 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I am creating online travel portal website. I am having the error in getting session variable after the payment successpage. It is working fine in local server but online not working properly. Paypal and CCAvenue payment gateway are use in my website.

Example here :-

In my page load am getting some request query string value and assigned that to session like this
C#
Session["fname"] = Request.Querystring["name"];

Session["lname"] = Request.Querystring["age"];

Session["email"] = Request.Querystring["email"];


and PayPal payment code is
C#
string redirecturl = "";
string amount = Session["dollarrate"].ToString();
// Mention URL to redirect content to paypal site
redirecturl += "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_xclick&business=" + ConfigurationManager.AppSettings["paypalemail"].ToString();

// First name i assign static based on login details assign this value
redirecturl += "&first_name=name";

// City i assign static based on login user detail you change this value
redirecturl += "&city=city";

// State i assign static based on login user detail you change this value
redirecturl += "&state=city";

// Product Name
redirecturl += "&item_name=Property Verification Charge";

// Product Amount
redirecturl += "&amount=" + amount;

// Business contact id
redirecturl += "&business=email";

//Shipping charges if any
redirecturl += "&shipping=5";

// Handling charges if any
redirecturl += "&handling=5";

// Tax amount if any
redirecturl += "&tax=5";

// Add quatity i added one only statically
redirecturl += "&quantity=1";

//Currency code
redirecturl += "¤cy=USD";

//Success return page url
redirecturl += "&return=ConfigurationManager.AppSettings["SuccessURL"].ToString();

// Failed return page url
redirecturl += "&cancel_return=" + ConfigurationManager.AppSettings["FailedURL"].ToString();
Response.Redirect(redirecturl);

after click and payment is properly finished but the paypal page is redirected success page am not get the session value. it all is going to null. but this code is working properly in local server but not in online server...
Posted
v3
Comments
Thanks7872 19-Sep-13 2:14am    
Code is some thing that can't be guessed.
Gowtham B 19-Sep-13 2:17am    
In my page load am getting some request query string value and assigned that to session like this

Session["fname"] = Request.Querystring["name"];

Session["lname"] = Request.Querystring["age"];

Session["email"] = Request.Querystring["email"];

and paypal payment code is

string redirecturl = "";
string amount = Session["dollarrate"].ToString();
// Mention URL to redirect content to paypal site
redirecturl += "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_xclick&business=" + ConfigurationManager.AppSettings["paypalemail"].ToString();

// First name i assign static based on login details assign this value
redirecturl += "&first_name=name";

// City i assign static based on login user detail you change this value
redirecturl += "&city=city";

// State i assign static based on login user detail you change this value
redirecturl += "&state=city";

// Product Name
redirecturl += "&item_name=Property Verification Charge";

// Product Amount
redirecturl += "&amount=" + amount;

// Business contact id
redirecturl += "&business=email";

//Shipping charges if any
redirecturl += "&shipping=5";

// Handling charges if any
redirecturl += "&handling=5";

// Tax amount if any
redirecturl += "&tax=5";

// Add quatity i added one only statically
redirecturl += "&quantity=1";

//Currency code
redirecturl += "¤cy=USD";

//Success return page url
redirecturl += "&return=ConfigurationManager.AppSettings["SuccessURL"].ToString();

// Failed return page url
redirecturl += "&cancel_return=" + ConfigurationManager.AppSettings["FailedURL"].ToString();
Response.Redirect(redirecturl);

after click and payment is properly finished but the paypal page is redirected success page am not get the session value. it all is going to null. but this code is working properly in local server but not in online server...
ridoy 19-Sep-13 3:22am    
post it inside your question so that everyone can realize it.
sridhargiri 19-Sep-13 4:51am    
how can u pass session value directly as query string and append to url?

1 solution

 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900