PDA

View Full Version : PayPal Express always returns to login.php



emty
11-03-2010, 12:46 AM
Hi Folks,

PAYPAL EXPRESS V1.00/OSCMax V2.0.25

This is only my second posting and I am a novice so bare with me. I have spent a couple of months getting my site ready and I have worked through all other issues from your excellent postings. I am now dead in the water with this final payment module.

The problem I am having is with Paypal Express and I am hoping you can help me. This is going to sound unbelievable! Yesterday the PAYPAL EXPRESS payment module worked fine i.e. I could successfully complete a checkout and payment. Then when I go to do a final test today this is what happens. Test customer has product in cart. He hits checkout button and is directed to checkout_shipping.php. He hits continue and is redirected to checkout_payment.php. He hits continue and is redirected to PAYPAL. All OK so far. He logs on to paypal and hits continue AND THEN IS REDIRECTED BACK TO LOGIN.PHP. The process has logged him off his account and his cart shows empty. If he logs on again, his cart shows the item still exists in his cart. Trying to checkout again just loops around as above and checkout never succeeds. Nothing has been altered on the site in /ext/modules/payment/paypal/express.php or /includes/modules/payment/paypal_express.php. I have checked stock and all is OK.

Strangely, a week ago this same problem happened. I sent a message to a PAYPAL Integration Engineer (who had helped me set up the API initially) and went to bed - it was damn late and I was frazzled. Low and behold when I went back to the site next day everything worked fine - I was able to complete confirmation of an order and got the order completed/success page. I contacted the PAYPAL IE and said don't worry, everything was now fine. I felt embarassed and put it down to lack of sleep or finger problems. Now it appears there is a real problem.

Today I have my problem back. I haven't altered anything and again I am being redirected to login.php. What is going on here? Can anyone shed some light as to where I should be looking? I have viewed express.php and the return URL seems OK. As I said I haven't edited any files since this was working fine. I am completely lost for an explaination - especially since this has now happened twice.

ridexbuilder
11-03-2010, 04:48 AM
Assumes this is the US version. :rolleyes:

emty
11-03-2010, 10:02 PM
It is the standard PAYPAL EXPRESS module which I believe is the U.S. version. It is the one that just says "Paypal Express Checkout" and does not have any (UK) affiliations. I am located in Australia and was directed to use this module by the Paypal Integration Engineer (who happens to have a California telephone number +1 408 etc but resides in India!).

Guess what I logged into my website today and as per the first time this problem occured, I now have no problem performing a transaction. Why would this occur one day and not the next? Twice this has fixed itself by me just waiting until the next day. Do you have any idea what might be happening?

michael_s
11-04-2010, 05:05 AM
Bad cookie or session. If you clear your browser cookies it will also resolve the problem. It resolves itself because the session cookie expires overnight and you start with a clean browser session.

emty
11-06-2010, 09:04 PM
Thank you Michael. I did clear out all cookies, temp files stc. in my browser when both times this happened and restart the browser yet it only seemed the "overnight wait" that cleared things. Do you have any suggestions as to why these bad cookies crop up and why the clearing of the browser did not work? Also , forgive my ignorance also but what is the distinction between bad cookie or session in this scenario?

lukassumarli
02-27-2011, 01:24 PM
Hi, I too have a problem with setting up paypal express in oscmax. When I set it up in Admin, it was activated and the button appeared just below the checkout button. But when you click it to make a payment, it always comes back to the login page. As far as I know, paypal express enables visitors to pay without going through the process of creating an account. Is this correct? Or do they still need to create an account when paying with paypal express? I've tried looking for the way to install the Paypal Express (PE), however the only documentation that I can get is the wiki, which tells you nothing but repeating the information from the admin section, such as API, etc.

I've also suspected that I need to have a paid subscription with payapl before I can accept the paypal express, is this true? However, the pricing table that I found from paypal clearly states that the use of paypal express is free.

Could anyone please clear this up for the rest of us? I'm pretty sure there are a lot of people wondering the same thing, but just never get around to ask.

nb:
Oh by the way, this is not a cookie problem

Lukas

emty
03-01-2011, 02:14 AM
I hope I have understood your questions and the following helps.

If you are a store customer, and select the paypal payment option, Paypal Express will provide you two options when redirected to the paypal web site :-

a) login in to your existing paypal account and pay for your purchase

or

b) pay by credit card without using a paypal account.

If you are the web store owner, you need a paypal account to accept paypal express payments. You also need a paypal account to transfer any payments to your bank accounts, do other transfers, issue refunds etc. You will be charged by paypal a percentage of each transaction as their fee for using their paypal express service. Best advice is to contact paypal via their website and they will get an Integration Engineer to help you through the set up process - there is no charge for this service and they are particularly helpful.

lukassumarli
03-03-2011, 03:21 AM
Hi, thanks for the reply. That is the thing, I tried to get the paypal express going, but everytime you hit paypal express, it directs you to the login page, where you can signup, login, or checkout without registering. As far as I know, paypal express enables buyer to go straight to paypal to pay without having to go through the login process from Oscmax. Have I done something wrong?

I have a paypal business account in Australia, I have set up to accept paypal express, but it still is not working.

lukassumarli
03-03-2011, 03:36 AM
I've also found out the following code under /ext/modules/payment/paypal/express.php, at line 16. It seems that the express will require you to log in as a customer. In my experience shopping with paypal express, I can certainly purchase something and pay using paypal express (as offered by the store owner) without even having to have an account with them. This is the process that I am aiming at. However looking at the code below, it states differently. Any insights will be appreciated.

// if the customer is not logged on, redirect them to the login page
if (!tep_session_is_registered('customer_id')) {
$snapshot = array('page' => 'ext/modules/payment/paypal/express.php',
'mode' => $request_type,
'get' => $HTTP_GET_VARS,
'post' => $HTTP_POST_VARS);

$navigation->set_snapshot($snapshot);

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}

emty
03-06-2011, 12:38 AM
If you go to Admin - Configuration - Customer Details you can select whether a customer can purchase without an account or not. My own store has this selected as "no" which means they have to log in to their account (or create one and log in) before they can check out. I find this desirable as I want to be able to capture their details. I have not tried tried the alternative "yes" option but I suspect you can then by bypass the login page before completing check out. You will have to try this out yourself. Hope this helps.

lukassumarli
03-07-2011, 12:58 PM
Hi,

Thanks again for the reply, however, that is the whole paypal express is all about. You can checkout and goes straight to paypal makes payment and goes back to the shop without having to go through the checkout process. This is regardless your configuration to allow checkout without an account or not.

Seriously, I believe there are people out there, even in this forum that has been using it, so please if you are, please help. At least provide an example how it works. I've been looking all around the net and cant seem to find the answer.

emty
03-07-2011, 10:46 PM
Hi,

I am sorry but I don't think I can help you further. My paypal express works fine and requires no login - I believe it only did because of a cookie problem originally as Michael explained. If you ring Paypal (1800 727 729 in Australia) and ask to work with an integration engineer to help you get set up, I am sure you will get things sorted. Set up a 1c item for them to work through a transaction and they can access your site and work out the correct flow. I think this will be your most expedient solution at this point.

lukassumarli
03-09-2011, 03:04 PM
Thanks for the reply, yea I guess you are right....I probably best call paypal and ask them. I also re-install a new oscmax with default skin, and activated the paypal express, but it is still the same thing, not sure why.

lukassumarli
03-09-2011, 03:22 PM
Some updates,

I tried to install OSCOMMERCE version and activated the paypal express using the same API username and everything, and it works! So there must be something's wrong how the module coded in OSCMAX.

lukassumarli
03-09-2011, 04:02 PM
Yet another test....

So, I went to the OSCMax demo page, where you get access to the admin and the shopfront access. Basically, I went into the admin section go to modules -> payment -> then install the paypal express, fill in the real API information as I have filled in my own site AND the oscommerce test site (which the paypal express works without redirecting to the login page), create a test category item, and a test product.

Then went into the shop front, click on add to cart, click on checkout, then click on the "paypal express button", and guess what, it brings you to the login page! Can anyone, the developer please explain this? Paypal express was meant to redirect client without having to go through the login and registration process, instead it will use the saved information from paypal as the client shipping address and the billing address. If this works with OSCOMMERCE, there must be something is wrong with the coding.

Again, when I looked at the code on /ext/modules/payment/paypal/express.php it clearly displays the following: (pay attention to the comments on the first line)


// if the customer is not logged on, redirect them to the login page
if (!tep_session_is_registered('customer_id')) {
$snapshot = array('page' => 'ext/modules/payment/paypal/express.php',
'mode' => $request_type,
'get' => $HTTP_GET_VARS,
'post' => $HTTP_POST_VARS);

$navigation->set_snapshot($snapshot);

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}

BUT if you looked at the same file on OSCOMMERCE, it gives you the following code instead: (basically the same check method, but different action!)

// initialize variables if the customer is not logged in
if (!tep_session_is_registered('customer_id')) {
$customer_id = 0;
$customer_default_address_id = 0;
}

I tried to bypass the OSCMAX code by commenting out the "tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));", it went straight to the paypal express BUT gives no order summary.

So, I'm sure this is not my mistake of filling in the wrong Paypal API information, or using the wrong templates, etc. So please, the developers help us out here. Or is this community really that ignorant? OR is this community made to believe that the paypal express is not meant to go straight to paypal.???

Please do not take this as negative rants, but simply me being stressed out and hoping so much that someone could help out. Please at least, go through the same way I did, and let me know what your findings are.

ellery.esd
01-29-2012, 05:53 PM
Just want to pump up this thread as I have this problem also. The script redirect me to login page when I checkout!

It seems to be a session/cookie problem. However, I have already cleared all the necessary temp files both in Firefox 9.01 and IE 9 but it is of no use.

So does anyone have any idea on how to solve this? Thank you.

ellery.esd
01-29-2012, 05:55 PM
delete as duplicated.

emty
01-29-2012, 10:45 PM
delete as duplicated.
Sorry ellery.esd I cannot help you. Reading this over again I think there were two problems here. In my case, I force my customers to log into Oscmax when they checkout so that I can file there details. I only experienced the continual login problem during testing and this was a session/cookie issue as Michael explained. Paypal express seems to works fine where the customer has to log in first.

If I understand lukassumarli's correctly, he appears to not want to force the customer to log in to complete checkout. It appears the code does not allow this and redirects the customer to the login page, regardless of whether the customer log before checkout in has been set on/off in admin. According to lukassumarli this is not a session/cookie problem. He doesn't say whether he found a solution or not.

I think only lukassumarli or one of the developers can help you at this stage - unless you elect to use the working "force customer to log in" scenario that I (and possibly most people) have been using.

Good luck mate!

ellery.esd
01-29-2012, 10:56 PM
Thanks emty.

Actually you are correct. When I dig deeper it is the session and the code problem, but I don't know how to solve it.

Here is the problem:

When I first login I have an item in cart already, so:
- I go to check-out
- Go to paypal, click continue (I am using sandbox)
- then get back to start "pay".

Up to this moment, the session is still there (I can print out session, even AFTER the tep_session_close()!) in express_checkout.php, however, when I click "pay", that session is lost.

And since that session losts, when it runs to the first if statement, it redirects me to the login page.

So it is the session problem as michael said, even if i clear all the caches/temp files and everything. But I don't know how to fix this.

Although the problem is still there, thank you for your response emty.