Ecommerce payment processing bug hunting -ZenCart One-Page Checkout authorize.net cim guest checkout loading timeout fix

Author:

Resolving Guest Checkout Sticking Issue with Zen Cart 1.5.8a and Authorize.net CIM

The guest checkout functionality can sometimes become stuck at the loading stage and eventually timeout when using the Authorize.net CIM module (v2.3.3) in conjunction with the OPC module (v2.4.6) in Zen Cart 1.5.8a.

Code Fix:

To resolve this issue, you can modify the authorizenet_cim.php file by changing the code near line 901 as follows:

/includes/modules/payment/authorizenet_cim.php

private function checkEmailAddress(int $customerID, string $email)
{
global $db;

        if ($_SESSION['opc']->isGuestCheckout())  $error = false; //fix guest checkout loading and logoff error
        else { //fix guest checkout loading and logoff error
            $customerCheck = $db->Execute('select customers_email_address from ' . TABLE_CUSTOMERS . " WHERE customers_id = $customerID LIMIT 1");
            $error = false;
            if ($customerCheck->EOF) {
                $error = true;
            }
            if (!$error && $email !== $customerCheck->fields['customers_email_address']) {
                $error = true;
            }
            if ($error) {
                sleep(45);
                trigger_error($customerID . ' was logged off and should be looked at!');
                zen_redirect(zen_href_link(FILENAME_LOGOFF, '', 'SSL', true, false));
            }
        }//fix guest checkout loading and logoff error
    }

By making this modification, you should be able to resolve the sticking issue with guest checkout and successfully complete payments using Authorize.net CIM in Zen Cart 1.5.8a.
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x