KonaKart Community Forum

Installation / Configuration => Configuration of KonaKart => Topic started by: Satish Shah on May 03, 2016, 02:54:37 pm

Title: New Payment Gateway Installation - Session Problem
Post by: Satish Shah on May 03, 2016, 02:54:37 pm
Hello,

I have installed Payment Gateway that successfully works but after ipn callback I am getting error as follows,

The session "Session id" is not found.

Would you please help me to get out of this.

I am following Paypal payment gateway code files.

Payment done successfully, orders and inventory updates successfully.

from IPN callback i am forwarding users to CheckoutFinishedAction.

Thank You

Title: Re: New Payment Gateway Installation - Session Problem
Post by: Brian on May 03, 2016, 03:42:57 pm
Have you configured the module correctly in the Admin Console.  Are any credentials that are required accurately specified?
Title: Re: New Payment Gateway Installation - Session Problem
Post by: Satish Shah on May 03, 2016, 07:53:05 pm
Yes brian..

All set correctly..

The problem is..

in ipn callback, the seesion we get from SSOToken get logout in finally block..

And then i am forwarding to the CheckoutFinishedAction.. bt there session not found.. and it redirects to login page..

I am also getting xsrf attack possible for current user ID

Please help..

Thanks a lot
Title: Re: New Payment Gateway Installation - Session Problem
Post by: Satish Shah on May 05, 2016, 12:09:03 pm
On checkoutfinishedAction.java , custId not found..

Sometimes  it forwarded to login page.. and sometime gives error message that The session 'some session id' not found..


Pleas reply

Thank you
Title: Re: New Payment Gateway Installation - Session Problem
Post by: Satish Shah on May 05, 2016, 12:36:21 pm
When error comes it always comes at

CatalogAfterLoginAction.java at line 70

kkAppEng.getOrderMgr().populateCustomerOrders();
Title: Re: New Payment Gateway Installation - Session Problem
Post by: Brian on May 21, 2016, 01:46:42 pm
You have the code for the module so you can easily diagnose this.   Add some debug statements if you can't make do with the standard logging.

You'll see in there where the SSOToken is created and saved in the database.  In order to get a sessionId it needs to log in using your callback username and password.  Check these are entered correctly for the module.

Once the SSOToken is saved it returns a UUID so that it can be accessed later.   This UUID is put in the custom field of the PayPal message.

When you get a callback from PayPal the UUID is picked up again from the custom field of the callback message from PayPal.   This is used to read the SSOToken.  The SSOToken has the sessionId.

Have you verified the contents of the callback from PayPal?

Have you verified that the order status is actually updated after the callback arrives?

Are you sure the return URL isn't causing a new session to be created?   Is it the same host and port as your user doing the shopping.

Add debug statements to the code to help you figure out what's going on or add logging such as:

# Database
log4j.logger.com.konakart.db                  = INFO

# Payemnt modules
log4j.logger.com.konakart.bl.modules.payment    = DEBUG

# IPNs
log4j.logger.com.konakart.actions.ipn           = DEBUG

# Storefront Actions
log4j.logger.com.konakart.actions               = DEBUG


Title: Re: New Payment Gateway Installation - Session Problem
Post by: Satish Shah on June 14, 2016, 12:15:44 pm
Thanks Brian for your time.

yes every thing works fine. Order status is getting updated, stock is also updated and at the end when this session (getting from SSOToken) is logged out and the current user is also getting logged out. And the user is forwarded to login page.

As of now what i am doing is storing session id of current customer in SSOToken. and getting the same on callback from UUID. and i am not logging out this session after orders status and stock updation. so can get current user logged in.

is it correct practice..?
Title: Re: New Payment Gateway Installation - Session Problem
Post by: Brian on June 26, 2016, 11:47:20 am
No I would never recommend that you log out the user just because he's made a payment.

I would recommend you revert to the original code and keep the customer logged-in.   If the customer's session is being lost you should investigate why...  check the URLs in use at each stage to see why it considers that your customer has switched to another session.

Title: Re: New Payment Gateway Installation - Session Problem
Post by: Satish Shah on July 02, 2016, 05:16:51 am
oh..I see.

Ok I ll try to find out that.

Thank You so much for correcting me..

Thank you
Title: Re: New Payment Gateway Installation - Session Problem
Post by: cav on July 15, 2016, 02:05:39 pm
Statish,

Did you get it corrected?  I have the same issue.

Brian,

My return url is also directing me to login page.  I have version 7.4.  Is this due to Paypal changes or possibly new browser feature?  The return URL is the same host and port as your user doing the shopping.  I do notice after payment in Paypal it takes it to another paypal page to thank user for purchase and then does a redirect to the return URL.  Is this causing the session to be lost?

Thanks.
Title: Re: New Payment Gateway Installation - Session Problem
Post by: cav on July 15, 2016, 11:13:34 pm
Nevemind...I figured out my issue.  My return URL needed to return to an SSL URL.  You may want to update the tooltip for that field to indicate it needs to be HTTPS URL.  Thanks.