Skip to content

PayPal: Cannot instantiate Gateway class #17

Description

@rossbcan

Hi Mamba;

I updated oledrion to oledrion-2.35_RC1 (hacked modules/oledrion/xoops_version.php:$modversion['min_xoops'] = '2.5.9';) to install on 2.5.9, since code inspection yielded no reason it should not work on 2.5.9. Correct me if wrong.

In re-testing Paypal, there is an issue with gateway class. To prove this, altered file
modules/oledrion/gateway-notify.php:

<?php
/*
 You may not change or alter any portion of this comment or credits
 of supporting developers from this source code or any supporting source code
 which is considered copyrighted (c) material of the original comment or credit authors.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/

/**
 * oledrion
 *
 * @copyright   {@link https://xoops.org/ XOOPS Project}
 * @license     {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
 * @author      Hervé Thouzard (http://www.herve-thouzard.com/)
 */

/**
 * Page appelée par la passerelle de paiement dans le cas de l'utilisation de l'IPN (ou d'une méthode similaire)
 * Dialogue entre le site et la passerelle
 */
@error_reporting(0);
@$xoopsLogger->activated = false;
require_once __DIR__ . '/header.php';
@error_reporting(0);
@$xoopsLogger->activated = false;
if (!file_exists(OLEDRION_GATEWAY_LOG_PATH)) {
    file_put_contents(OLEDRION_GATEWAY_LOG_PATH, '<?php exit(); ?>', LOCK_EX);
}
$gateway          = \XoopsModules\Oledrion\Gateways::getCurrentGateway();
$temporaryGateway = null;
$temporaryGateway = \XoopsModules\Oledrion\Gateways::getGatewayObject();
if (is_object($temporaryGateway)) {
    $user_log = $temporaryGateway->gatewayNotify(OLEDRION_GATEWAY_LOG_PATH);
    unset($temporaryGateway);
} else {
    $user_log = "Could not instantiate Gateway\n";
    file_put_contents(OLEDRION_GATEWAY_LOG_PATH, $user_log, FILE_APPEND | LOCK_EX);
}
echo $user_log;

... to detect and report this error.

The error appears to be a consequence of incomplete testing (my part) of your changes (class renaming, cleanup) when we last worked together on this.

Assuming you are not setup for paypal sandbox testing:
How can I help with further information to debug this? I have failed to debug why gateway class instantiation fails.
Assuming you are setup for paypal sandbox testing:
Swap the file above and, you can see for yourself.

At the end of this exercise, I am willing to write a short HowTo (for oledrion readme) setup for PayPal / sandbox testing.

Note: This issue also exists on oledrion-2.35_Beta-3 (which is for 2.5.9), so it is not a consequence of hacking RC1 for 2.5.9

Regards;
Bill

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions