Zen Cart Logo
Forums / Upgrading to 1.5.x / ajax error during checkout

ajax error during checkout

Views: 5,631

Results 1 to 20 of 34
2 Nov 2015, 4:10 AM
#1
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

ajax error during checkout

I am in the process of upgrading from 1.5.3 to 1.5.4. I started with a clean install of 1.5.4, and then added a number of mods that I had been using previously. I got the latest version available of each mod.
My server uses php version 5.4.45 and MySQL 5.5.45-cll.
I am currently running the upgraded version on my test site, which is a subdomain of my regular site.
https://www.test.xxxxx.com
I have the beta version of COWOA installed, although I don't know if that is related to my issue.
I put something in my cart, login, and begin the checkout process.
I get to the checkout_shipping page, then click "continue checkout" to get to the checkout_payment page.
I choose "Cash on Delivery", and click "continue checkout".
The screen briefly flashes with an ajax error, and then goes to the "checkout_confirmation" page. I was able to do a screenshot, to see what the error is.
The error is: An unknown response null::null:: was received while processing an ajax call. The action you requested could not be completed.
Attachment 15769
My concern is that I don't want this error showing up on my live site, when I switch over.
Is there any way for me to debug this error, and figure out why it is showing up? Also, is there any explanation of how ajax is used in the checkout process? I'm not familiar with it.
I temporarily turned off ssl in the configure.php file, and then the error does not show up.
I was getting some other ajax errors before, related to having a subdomain, but I was able to fix them by always using https://www.test.xxxxx.com, instead of test.xxxxx.com, both in the configure.php files, and in a rewrite rule in the .htaccess file.
It might be the case that this problem is caused by the subdomain, but I don't want to take the chance that it will persist on the live site.
Thanks in advance for any help with this!

2 Nov 2015, 5:21 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: ajax error during checkout

I am currently running the upgraded version on my test site, which is a subdomain of my regular site

I temporarily turned off ssl in the configure.php file, and then the error does not show up.
The subdomain is not serviced by the SSL Certificate that you may have and most likely why when you have ssl on in the subdomain you are seeing the error

Check your install /logs folder for any debug files

2 Nov 2015, 9:00 PM
#3
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,963
Plugin Contributions:
8

Re: ajax error during checkout

debugging ajax can be confusing...

i would look at developer tools for your browser and then the console tab...

good luck.

3 Nov 2015, 1:45 AM
#4
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Re: ajax error during checkout

kobra:

The subdomain is not serviced by the SSL Certificate that you may have and most likely why when you have ssl on in the subdomain you are seeing the error

Check your install /logs folder for any debug files

Hi Kobra. Thanks for your comments and suggestions!
My webhost company generated a self-signed SSL certificate for my subdomain, test.XXXXX.com, a while ago, so that I would be able to test the checkout and admin portions of my website before doing an upgrade. I have added an exception for it to my browser, so that things do work pretty well. But it's possible that the error is related to the subdomain and ssl.

I have checked the logs directory, and no debug files are being generated for this error.

3 Nov 2015, 1:56 AM
#5
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Re: ajax error during checkout

carlwhat:

debugging ajax can be confusing...

i would look at developer tools for your browser and then the console tab...

good luck.

Hi Carlwhat. Thanks for your suggestions!
I followed what you suggested, and in Firefox, I went to Developer Tools -> Console tab.
I generated the error, and this is the contents of the Console tab:

Object { readyState: 0, getResponseHeader: .ajax/v.getResponseHeader(), getAllResponseHeaders: .ajax/v.getAllResponseHeaders(), setRequestHeader: .ajax/v.setRequestHeader(), overrideMimeType: .ajax/v.overrideMimeType(), statusCode: .ajax/v.statusCode(), abort: .ajax/v.abort(), state: .Deferred/d.state(), always: .Deferred/d.always(), then: .Deferred/d.then(), 11 more… }

I clicked on the js sub-tab, and I see:

uncaught exception: out of memory

I clicked on security, and I see the following warning, which presumably is because of the self-signed SSL certificate:

This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.

I've never dealt with ajax before, and I'm not sure what to look for, or how to debug this error. Any suggestions? Or should I just hope that it goes away when I switch to my real domain?

Thanks again for any help with this!

3 Nov 2015, 12:18 PM
#6
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,097
Plugin Contributions:
56

Re: ajax error during checkout

There have been a couple of reports of the ajax-handling throwing that message. @earth-friendly: How have you got your subdomain site configured? If you could post the contents of your /includes/configure.php, perhaps that will shed some light.

When posting that file, use the CODE tags (the **# **in the right-hand side of the toolbar that's displayed when you're writing your post) and make sure to xxx-out your database credentials and (possibly) the site's URL).

4 Nov 2015, 2:17 AM
#7
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Re: ajax error during checkout

Hi lat9.

Here is my configure.php file (with all the real info renamed):

define('HTTP_SERVER', 'http://www.test.mydomain.com');
define('HTTPS_SERVER', 'https://www.test.mydomain.com');
define('ENABLE_SSL', 'true');

define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');
define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_INCLUDES', 'includes/');
define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/');
define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/');
define('DIR_WS_PHPBB', '/');

define('DIR_FS_CATALOG', '/home/mydir/MyTest/');
define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
define('DIR_WS_UPLOADS', DIR_WS_IMAGES . 'uploads/');
define('DIR_FS_UPLOADS', DIR_FS_CATALOG . DIR_WS_UPLOADS);
define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');

define('DB_TYPE', 'mysql');
define('DB_PREFIX', '');
define('DB_CHARSET', 'utf8');
define('DB_SERVER', 'localhost');
define('DB_SERVER_USERNAME', 'dbname');
define('DB_SERVER_PASSWORD', 'dbpass');
define('DB_DATABASE', 'zendb');
define('USE_PCONNECT', 'false');
define('STORE_SESSIONS', 'db');

define('SQL_CACHE_METHOD', 'none');
define('DIR_FS_SQL_CACHE', '/home/mydir/MyTest/cache');

And I also have a rewrite rule in my .htaccess file, to always include the "www". Before I made sure to include the "www", in both the .htaccess file and the configure.php, I got additional ajax errors when I tried to use the admin.
Here is the .htaccess rule:

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
4 Nov 2015, 11:04 AM
#8
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: ajax error during checkout

If you are running v1.5.4 then you are missing some important information
How did you upgrade??
Info in red missing

  define('HTTP_SERVER', 'http://domain.com');
  define('HTTPS_SERVER', 'https://domain.com');

  // Use secure webserver for checkout procedure?
  define('ENABLE_SSL', 'true');

// NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
// * DIR_WS_* = Webserver directories (virtual/URL)
  // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
  define('DIR_WS_CATALOG', '/');
  define('DIR_WS_HTTPS_CATALOG', '/');

  define('DIR_WS_IMAGES', 'images/');
  define('DIR_WS_INCLUDES', 'includes/');
  define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
  define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
  define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
  define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
  define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/');
  define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/');

  define('DIR_WS_PHPBB', '/');

// * DIR_FS_* = Filesystem directories (local/physical)
  //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
  define('DIR_FS_CATALOG', '/home/user/public_html/');

  //the following path is a COMPLETE path to the /logs/ folder  eg: /var/www/vhost/accountname/public_html/store/logs ... and no trailing slash
  define('DIR_FS_LOGS', '/home/user/public_html/logs');

  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
  define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
  define('DIR_WS_UPLOADS', DIR_WS_IMAGES . 'uploads/');
  define('DIR_FS_UPLOADS', DIR_FS_CATALOG . DIR_WS_UPLOADS);
  define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');
4 Nov 2015, 5:45 PM
#9
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Re: ajax error during checkout

Hi kobra. Thanks very much for pointing that out.
I have added the following to both of my configure.php files:

define('DIR_FS_LOGS', DIR_FS_CATALOG . 'logs');

I think that is correct, because DIR_FS_CATALOG has a trailing slash, and the comments say that DIR_FS_LOGS should not have a trailing slash.

In answer to your question about how did I upgrade:
I started with a clean version of 1.5.4.
I added in my template files (I did some merging between the default template files, but not in all cases.)
I added a number of addons that I had been using before.
I copied over my previous configure.php files.
I uploaded the new files to my fileserver, and pointed my development website to this location.
I ran the upgrade scripts.
The trickiest part was dealing with my existing template files. I had gotten them from a previous company that was hosting my website. They had included a bunch of addons into their zencart version, so some of this was embedded in the template files. But, I had worked hard on the template files, getting everything styled the way I wanted it, so I didn't start over with a clean set of template files, and I didn't have access to a clean set of the same template files. So I did the best I could to remove all the addons from the template files initially, to start cleanly before adding any of the addons.

Anyway, that is the long, painful process I went through. Does it sound reasonable, or did I miss something? I'm guessing that at some point, DIR_FS_LOGS was added to the configure.php files, and I never got those into my configure.php files until now.

5 Nov 2015, 12:28 AM
#10
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: ajax error during checkout

I copied over my previous configure.php files.
This explains why you did not have up to date configure's
I have added the following to both of my configure.php files:

define('DIR_FS_LOGS', DIR_FS_CATALOG . 'logs');

This should be a full path to the logs directory

  //the following path is a COMPLETE path to the /logs/ folder  eg: /var/www/vhost/accountname/public_html/store/logs ... and no trailing slash
  define('DIR_FS_LOGS', '/home/user/public_html/logs');
5 Nov 2015, 1:09 AM
#11
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Re: ajax error during checkout

kobra:

This explains why you did not have up to date configure's
I have been looking at some of the online faqs on how to upgrade your zencart site, and I think they are saying that you should copy over the configure.php files from your older site.
https://www.zen-cart.com/content.php?148-how-do-i-upgrade-my-zen-cart-site
and
https://www.zen-cart.com/entry.php?3-How-do-I-rebuild-my-site-on-the-new-version-instead-of-upgrading
kobra:

define('DIR_FS_LOGS', DIR_FS_CATALOG . 'logs');

> This should be a full path to the logs directory
> ```
  //the following path is a COMPLETE path to the /logs/ folder  eg: /var/www/vhost/accountname/public_html/store/logs ... and no trailing slash
  define('DIR_FS_LOGS', '/home/user/public_html/logs');

I believe that the following IS a complete path to the /logs/ folder:

define('DIR_FS_LOGS', DIR_FS_CATALOG . 'logs');

DIR_FS_CATALOG is
/home/mydir/MyTest/
so that makes DIR_FS_LOGS
/home/mydir/MyTest/logs

5 Nov 2015, 1:45 AM
#12
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,963
Plugin Contributions:
8

Re: ajax error during checkout

wow, earthfriendly, there seems to be a lot of issues going on here....

while i do run 1.5.4 on a local test server as well as on a client site, you said

"Before I made sure to include the "www", in both the .htaccess file and the configure.php, I got additional ajax errors when I tried to use the admin..."

perhaps someone else can chime in, but i do not think there are any ajax calls being made in the admin; i could be wrong.

i'm guessing that adding the logs directory into your configure.php files is an excellent idea, but i doubt it's the root of your problem. my limited understanding of ajax is that you can send information to the server, get a response back, and process that response without the need to reload the page. which makes it very tricky to debug. from what i remember on how i implemented it, it was also part of a javascript file; in addition i was using an add-on as opposed to the base version.

there is an ajax debugger add-on that you can use in chrome which will probably help isolate that part of the problem. what you want to look at is what you are sending to the server and what the server is sending you back. and you can take it from there.

in addition, earlier you said:

" Or should I just hope that it goes away when I switch to my real domain?"

hope may spring eternal, but i have serious doubts that this will work when you switch to your real domain.... but again i could be wrong.

good luck!

5 Nov 2015, 10:32 AM
#13
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: ajax error during checkout

I believe that the following IS a complete path to the /logs/ folder:

define('DIR_FS_LOGS', DIR_FS_CATALOG . 'logs');

> DIR_FS_CATALOG is
> /home/mydir/MyTest/
> so that makes DIR_FS_LOGS
> /home/mydir/MyTest/logs
The item in red is correct not your previous assumption

I am concentrating on this so that you can get mydebug files logged into your /logs folder in an attempt to proceed
5 Nov 2015, 1:49 PM
#14
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Re: ajax error during checkout

Thanks to both kobra and carlwhat for your responses!
kobra, I will modify the entry in my config files to include the complete path for the logs directory.
However, as carlwhat suggested, that may not help with this particular problem, because according to what I've been reading, ajax errors don't show up in the logs.

I added firebug to firefox, and started it up right before my click to go to the confirmation page, and I clicked on the console to see what info would show up after I clicked to confirm.
I need to spend more time on learning how to debug in firebug, but as a first pass, I saw the following:

Error:
uncaught exception: out of memory
This was in red, and might be significant. I'm not sure how to get more details on what generated this error. I think I would need to set breaks in the code, or something like that. Can't go further now, because I have to get to work. If anyone has experience in using this, and wants to help, please feel free to chime in on how I can get more info.

Warnings:
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.

POST https://www.test.mydomain.com/ajax.php?act=ajaxPayment&method=setNoscriptCookie

I didn't see an actual return value.

I'll look into this more tonight, but if anyone has any suggestions, please let me know.
Thanks very much!

5 Nov 2015, 5:22 PM
#15
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,806
Plugin Contributions:
15

Re: ajax error during checkout

First of all, just for anyone lurking now or in the future, one should never try to automate any Zen Cart load or upgrade. It just never works out well. Not saying it was done here, BUT should be listed as a no-no wherever possible.
Anywho.....
In the place you quoted (https://www.zen-cart.com/content.php...-zen-cart-site), the item I put in red (see below) often gets missed and probably should be changed. It tells you to copy the old configs ONLY IF they are not present. Many glance over the if and ruin perfectly good config files by copying over the ones installed by Zen Cart. Since the 1.5.x series, the config files are way different from their predecessors. Trying to use earlier configs really screws things up. You should only need to touch the two configs AFTER moving them to their final resting place on your server. IOW, if you did your upgrade in /shoptest and moved back to the root, you'd remove any mention of /shoptest from both configs. Other than turning SSL on or off, that's really the only reason to touch the configs.> 3. Testing

Make a NEW database to install the new version of Zen Cart® into.
If the last backup you made of your data is older than the last order that might have been processed or customer registration, make a fresh database backup.
Restore your database from the backup in step #1 earlier into your NEW database just created.
If your /zen_new folder doesn't have "/includes/configure.php" and "/admin/includes/configure.php" files, copy them from your old store folder.IMHO, The second link () also should mention that > Replace all the Zen Cart php files/folders/images/everything in your live store with the new files (except the configure.php files which usually stay the same)
Be sure to also delete any files that don't belong anymore.can be a problem if you are upgrading from 1.3.x to 1.5.x. As mentioned before, the config files are WAY different. Again, copying and editing the NEW could save lots of trouble when upgrading.

6 Nov 2015, 3:08 AM
#16
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Re: ajax error during checkout

I think I basically followed all the upgrade steps correctly, except that I copied over the configure.php files before running the upgrade script. It looks like I should have just not copied them over, and then run the upgrade script, which would have created them from scratch, and then I could have modified them as necessary. Is that correct?

Anyway, I did some more testing, and found a few things.
I have 3 payment modules installed: cod, paypal express, and authorizenet_aim.
I tested all 3 modules, and the cod and paypal express modules both give the ajax error, but the authorizenet_aim module does not give the error. I was able to checkout completely using the authorizenet_aim module, without any ajax errors.
I looked at the code for the 3 modules, and it is not obvious to me what the difference is for each of them, such that 2 would generate this error, and one would not.
Also, just to be clear, I did remove and reinstall each of the payment modules for the upgrade.

I tried debugging in firefox firebug, and set it to break on all errors, but this didn't make any difference, and it didn't break any sooner.
As I said above, the Post is:

 https://www.test.mydomain.com/ajax.php?act=ajaxPayment&method=setNoscriptCookie

and the error is
uncaught exception: out of memory

I don't see any other useful information.
Is there some place where I can put some debug print statements that will show up in the firebug debug console, that might be helpful? Anything else I can do to try to figure this out?

I'm at a loss as to how to proceed. Does anyone have any suggestions?

Thanks very much for your help!

6 Nov 2015, 3:47 AM
#17
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Re: ajax error during checkout

One more thing. I just tried to redo the upgrade process on my test site.
I re-backed up the db from my live site.
I restored the backed-up db to my test db.
I removed both configure.php files from the test site.
I went to https://www.test.mydomain.com/zc_install/index.php
It created an empty includes/configure.php
It asked me to create an empty admin/includes/configure.php
Once I did that, it said: Ready to Install? (This will wipe any existing data. You are NOT in Upgrade mode!!!)
So, my understanding is, if you do not copy over your previous configure.php files, it will not be able to connect to your db, and thus, it will not be able to do an upgrade, only a new install, which will wipe out your db. So I don't see how you can get it to recreate your configure.php files with any new variables, and still do an upgrade, without wiping out your db. Is there something I'm doing wrong in this process?

6 Nov 2015, 9:46 PM
#18
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,806
Plugin Contributions:
15

Re: ajax error during checkout

You missed my point. You keep deleting correct config files.
Use the Zen Cart install to create a new site. In so doing, IT will create the CORRECT config files. Empty the database it creates and replace it with your old. Copy any image files from old to new. You now have a working new site with correct config files. There won't be any mods or templates but, your site will work at the new location. You can then apply any mods or templates to complete the install/upgrade.
You will NOT need to touch the config files again until you MOVE the new install/upgrade. If you did the install/upgrade in yoursite.com/test and wanted to move it back to yoursite.com, you would edit the two configs to remove any reference to /test.

8 Nov 2015, 12:31 AM
#19
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Re: ajax error during checkout

There has been some really helpful information about the upgrade process. Thanks to everyone for their help with this.
But back to my original issues, I wonder if anyone has any suggestions on how I can debug this ajax error issue?
I am a programmer, and I am willing to work to resolve this, and to report my findings to the zencart community. But I don't have any experience with ajax, and I'm not sure how it is used in the checkout process of zencart. As I said above, I tried using firebug in firefox to get more information on the request and response.
Like I said above, the Post is: ```
https://www.test.mydomain.com/ajax.php?act=ajaxPayment&method=setNoscriptCookie

and the error is
uncaught exception: out of memory.
Is there some place in the code where I can put some debug print statements that will show up in the firebug debug console, or in the error logs, that might be helpful? Anything else I can do to try to figure this out?
Also, as I said above, when I used the cod and paypal payment methods, I got the ajax error when I clicked to go to the order confirmation page. But when I used the authorizenet_aim payment method, I was able to checkout completely without any errors. I looked at the code for the 3 payment modules, and I didn't see anything obvious that would cause the errors in the 2 modules, but not in the third.

I'm at a loss as to how to proceed. Does anyone have any suggestions?
I'm considering hiring someone to solve this for me. But as I said, I am a programmer, and I'd like to learn how to do it myself. I'd really appreciate any help with this!

Thanks very much for your help! I really appreciate it!
8 Nov 2015, 5:33 AM
#20
earth_friendly avatar

earth_friendly

New Zenner

Join Date:
Apr 2014
Location:
NJ
Posts:
59
Plugin Contributions:
0

Re: ajax error during checkout

I've been trying to make progress on this. I've made a little progress.
(1) I found the file containing the javascript code that generates the original error message that I saw:

An unknown response null::null::was received while processing an ajax call...

in includes/templates/template_default/jscript/jscript_framework.php.
I was able to see more information by adding options.url to the alert message.
I now see that the ajax call that generated the error is:

ajax.php?act=ajaxPayment&method=doesCollectCardDataOnsite

This actually makes a little sense, because both cod and paypal express generated the error, and they both do NOT collect the card data on the website, while authorizenet_aim does not generate the error, and it DOES collect the card data on the website, and its class has this variable set to TRUE. So I think the error may somehow be caused within the code that deals with doesCollectCardDataOnsite or collectsCardDataOnsite
(2)
When I looked at the page source of the checkout_payment page, I noticed that the end of the javascript function check_form, has 2 return statements in a row:

if (error == 1 && submitter != 1) {
    alert(error_message);
    return false;
  } else {
   return collectsCardDataOnsite(payment_value);
    return true;
  }

This is because in the file includes/classes/payment.php, in the function javascript_validation, it contains

       $js =  $js .'  if (error == 1 && submitter != 1) {' . "\n";
       $js =  $js .'    alert(error_message);' . "\n";
       $js =  $js . '    return false;' . "\n";
       $js =  $js .'  } else {' . "\n";
       if ($this->doesCollectsCardDataOnsite == true && PADSS_AJAX_CHECKOUT == '1') {
         $js .= '   return collectsCardDataOnsite(payment_value);' . "\n";
       }
       $js =  $js .'    return true;' . "\n";

I'm guessing that the "if" statement should perhaps be

       if ($this->doesCollectsCardDataOnsite == true && PADSS_AJAX_CHECKOUT == '1') {
         $js .= '   return collectsCardDataOnsite(payment_value);' . "\n";
       } else {
       $js =  $js .'    return true;' . "\n";
       }

but I'm not sure about that. (I did try making this change, but I still get the error.)

I did read somewhere that this ajax out of memory error could be caused by a form being submitted that causes a page to redirect, which expunges the ajax javascript. I'm not sure if that applies in this case.

I've been putting in alerts into the javascript, and I've been printing debug statements into a file, to see if I can discover anything interesting, but I haven't made any more revelations.
I'm hoping that perhaps something that I said above might trigger some ideas for the zencart developers, and you might have suggestions of things that I could try, to figure this out and hopefully fix it.
I just don't understand what would be different in my site, so that no one else has come across this problem for the cod or paypal express modules. I haven't made any changes directly to those modules. And I don't think I've made any changes to the checkout process, or the payment class.
Any ideas/suggestions would be greatly appreciated!! Thanks very much!