Jump to content
kymation

Paypal App install fails on modified osCommerce 2.3.4

Recommended Posts

The problem: I have installed the Paypal App on a highly-modified osCommerce 2.3.4 (not Responsive). In Admin >> Paypal >>Start I click on Retrieve Sandbox Credentials. The URL changes to http://www.example.com/path/to/paypal.php?action=start&subaction=process&type=sandbox and nothing else happens. No error messages. I can click on any link in that page and the URL changes to the expected value, but nothing else happens. The install fails to proceed.

 

The server: FreeBSD 8.2-STABLE, Apache/2.2.31, PHP 5.6.23 with mysql and mysqli extensions, MySQL 5.0.11

 

What I have done:

  1. The server php.ini is set to log all errors to a file. All possible error reporting is turned on, except for the line that displays errors on the page. The osCommerce installation error reporting is set to E_ALL. There are no errors in the error log.
  2. There is a copy of the site set up in a subdirectory for development. The codebase is exactly the same as the main site. The Paypal App installed on that copy gives the exact same result as on the live site.
  3. I installed a copy of stock osC 2.3.4 in another subdirectory, and installed the Paypal App in that. The App works as expected there.
  4. I have compared all of the class and function files, both catalog and admin side, from the live store to stock 2.3.4. There are many changes due to the various addons that have been installed, but nothing that I can see that would affect the Paypal App. Of course I don't know all of the dependencies in the App, so I may have missed something.

Has anyone ever seen this before? Do you have any idea what could cause this? Any and all hints welcome. I'm running out of hair to pull.

 

Regards
Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

When that link is clicked, it loads the paypal.php file in admin. The block of code causing it to go to paypal is small so I would start there. If it is not being reached when the start link is clicked, you can try going directly to it with http://....com/admin/paypal.php?action=start

 

The code uses the DIR_FS_CATALOG define and I've ran across some shops that had that set correctly, though I would think that would cause an error which you don't get. It also needs to load the hooks.php file in includes/classes/ (shop side). There is a fix posted somewhere here that hides the error when that class fails to load so if you have that fix applied and the class isn't present, that may cause something like this.

Share this post


Link to post
Share on other sites

The paypal.php file is being reached and loads properly. It's only when the subactions try to load that it fails.

 

DIR_FS_CATALOG is defined correctly in the configure.php. Everything else in that file looks correct, and all the rest of the Admin works. That doesn't necessarily mean anything where this App is concerned, so I might take another look at that.

 

Hooks.php is in place and working. I don't believe anybody had added any patches to disable error reporting on it in any case.

 

Thanks for taking a look at my problem. If yo think of anything else pleas post it here.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

What paypal modules is installed before?
Do you see any "OSCOM_APP_PAYPAL_" in configuration table?


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites

Paypal Express and PayPal Website Payments Pro - Direct Payments are installed and in use. PayPal Pro DP works and is reliable, while Express has random failures and causes customer complaints. This was the reason for installing the App.

 

There are 22 configuration entries starting with OSCOM_APP_PAYPAL_. The oscom_app_paypal_log table exists and is empty.

 

Does this give you any ideas?

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

@@kymation The oscom_app_paypal_log table is just for keeping log entries so since this isn't working, it would be empty.

 

Maybe I don't understand the problem but what I was trying to say is that when you mouseover the get credentials button, it will show the url. The url will be to the paypal.php file with some parameters. So if you went to that url directly and the redirect to paypal is reached in the code but the paypal site fails to load paypal, then something on the server is preventing that. If it does go to paypal then you can add statements to the paypal.php file to see where it is failing.

Share this post


Link to post
Share on other sites

@@Jack_mcs  Mousing over that button gives http://www.example.com/path/to/paypal.php?action=start&subaction=process&type=sandbox. Clicking on that button gives the same URL in the address bar, and reloads the same page I started with. Similar results for all of the rest of the buttons on that page.

 

The paypal.php file is full of the usual undocumented spaghetti mess common to all osCommerce. I was hoping that I wouldn't have to try to debug that mess, but I'm probably going to have to. Thanks for the suggestions anyway.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Migration process probably had done. PayPal Website Payments Pro - Direct Payments is strange for me. Save configuration table and try to uninstall all paypal modules from configuration table by hand.


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites

@@kymation If you are in a position to do so, perhaps creating a new, blank, shop with just the app installed would be an easier approach. If that fails too, then it must be something on the server. Or, I suppose, it could be a mistake you are making in the installation but that seems unlikely. Assuming the new shop works, it should be a simple matter of comparing files to find the problem.

Share this post


Link to post
Share on other sites

@@Gergely  Good idea -- I'll go try that.

 

@@Jack_mcs  I already did that. On a copy of osC 2.3.4, freshly installed in a new directory, the Paypal App installs and works correctly. So it's something in that modified code that's going wrong. I've already compared everything I can think of as well. There are differences, but as far as I can tell they are additions and not alterations to the base.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I removed all of the Configuration keys containing PAYPAL and tried again. Same result. I'm digging through the code, but it's slow going. I'll post whatever I find.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Found it. A change to the compatibility functions caused the copy from the $_GET array to the old $HTTP_GET_VARS to not work reliably. Some of the variables were getting set and others not. The solution was to change all of the variable names in the Paypal App to the modern versions.

 

I don't understand why we are keeping these deprecated forms. The short form superglobals have been around since PHP 4.1. It's long past time to let go of the long variable names.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

New version will use superglobals. v2.3.4 was the end of the past but first we tried build test responsive version from it (v2.3.4BS).

I have similar experiensies. Old formula sometimes cant be global variable.


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites
On 8.7.2016 at 5:38 AM, kymation said:

Found it. A change to the compatibility functions caused the copy from the $_GET array to the old $HTTP_GET_VARS to not work reliably. Some of the variables were getting set and others not. The solution was to change all of the variable names in the Paypal App to the modern versions.

 

I don't understand why we are keeping these deprecated forms. The short form superglobals have been around since PHP 4.1. It's long past time to let go of the long variable names.

 

Regards

Jim

I think I am having the same problem with the paypal app..   But I don't know what variable names are you talking about ?  Could you post the code fix you made ?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×