/** * Show the special page * * @param $par Mixed: parameter passed to the page or null */ public function execute($par) { global $wgContributionTrackingFundraiserMaintenance, $wgContributionTrackingFundraiserMaintenanceUnsched; // FIXME: Deprecate "language" param. $language = $this->getRequest()->getVal('language'); if ($language) { $this->getContext()->setLanguage($language); global $wgLang; $wgLang = $this->getContext()->getLanguage(); // BackCompat } $gatewayName = $this->getGatewayIdentifier(); $className = DonationInterface::getAdapterClassForGateway($gatewayName); try { $this->adapter = new $className(); $this->logger = DonationLoggerFactory::getLogger($this->adapter); $this->getOutput()->addModuleStyles('donationInterface.styles'); $this->getOutput()->addModules('donationInterface.skinOverride'); } catch (Exception $ex) { if (!$this->logger) { $this->logger = DonationLoggerFactory::getLoggerForType($className, $this->getLogPrefix()); } $this->logger->error("Exception setting up GatewayPage with adapter class {$className}: " . "{$ex->getMessage()}\n{$ex->getTraceAsString()}"); // Setup scrambled, no point in continuing $this->displayFailPage(); return; } if ($this->adapter->getGlobal('Enabled') !== true) { $this->logger->info('Displaying fail page for disabled gateway'); $this->displayFailPage(); return; } if ($wgContributionTrackingFundraiserMaintenance || $wgContributionTrackingFundraiserMaintenanceUnsched) { $this->getOutput()->redirect(Title::newFromText('Special:FundraiserMaintenance')->getFullURL(), '302'); return; } if ($this->adapter->getFinalStatus() === FinalStatus::FAILED) { $this->logger->info('Displaying fail page for failed GatewayReady checks'); $this->displayFailPage(); return; } Hooks::register('MakeGlobalVariablesScript', array($this->adapter, 'setClientVariables')); try { $this->handleRequest(); } catch (Exception $ex) { $this->logger->error("Displaying fail page for exception: " . $ex->getMessage()); $this->displayFailPage(); return; } }
public function __construct() { $this->logger = DonationLoggerFactory::getLoggerForType('TestingGenericAdapter'); //nothing! }
/** * Get the URL for a page to show donors after a failed donation without * requiring an adapter instance. * @param string $adapterType adapter class to use for settings and logger * e.g. AdyenGateway * @param string $logPrefix identifier used to associate log lines with * related requests * @return string full URL of the fail page */ public static function getFailPageForType($adapterType, $logPrefix = '') { return self::getFailPageFromParams(false, $adapterType::getGlobal('FailPage'), array('gateway' => $adapterType::getIdentifier(), 'payment_method' => '', 'payment_submethod' => ''), DonationLoggerFactory::getLoggerForType($adapterType, $logPrefix)); }
function __construct() { $this->logger = DonationLoggerFactory::getLoggerForType('GatewayAdapter', 'FormChooser'); parent::__construct('GatewayFormChooser'); }