jenkins-bot has submitted this change and it was merged.
Change subject: Use DonationLogger in GatewayPage subclasses
......................................................................
Use DonationLogger in GatewayPage subclasses
Bug: T86266
Change-Id: Iaf62b9ce6cedc7d4110e2b24166ef26b5068844a
---
M adyen_gateway/adyen_resultswitcher.body.php
M amazon_gateway/amazon_gateway.body.php
M gateway_common/GatewayPage.php
M gateway_forms/RapidHtml.php
M globalcollect_gateway/globalcollect_resultswitcher.body.php
M paypal_gateway/paypal_resultswitcher.body.php
6 files changed, 25 insertions(+), 25 deletions(-)
Approvals:
Awight: Looks good to me, approved
jenkins-bot: Verified
diff --git a/adyen_gateway/adyen_resultswitcher.body.php
b/adyen_gateway/adyen_resultswitcher.body.php
index 72bbe5a..666dcf7 100644
--- a/adyen_gateway/adyen_resultswitcher.body.php
+++ b/adyen_gateway/adyen_resultswitcher.body.php
@@ -55,11 +55,11 @@
global $wgServer;
if ( ( strpos( $referrer, $wgServer ) === false ) &&
!$liberated ) {
$_SESSION[ 'order_status' ][ $oid ] = 'liberated';
- $this->adapter->log("Resultswitcher: Popping out of
iframe for Order ID " . $oid);
+ DonationLogger::log("Resultswitcher: Popping out of
iframe for Order ID " . $oid);
//TODO: Move the $forbidden check back to the beginning
of this if block, once we know this doesn't happen a lot.
//TODO: If we get a lot of these messages, we need to
redirect to something more friendly than FORBIDDEN, RAR RAR RAR.
if ( $forbidden ) {
- $this->adapter->log("Resultswitcher: $oid
SHOULD BE FORBIDDEN. Reason: $f_message", LOG_ERR);
+ DonationLogger::log("Resultswitcher: $oid
SHOULD BE FORBIDDEN. Reason: $f_message", LOG_ERR);
}
$this->getOutput()->allowClickjacking();
$this->getOutput()->addModules( 'iframe.liberator' );
@@ -69,10 +69,10 @@
$this->setHeaders();
if ( $forbidden ){
- $this->adapter->log( "Resultswitcher: Request
forbidden. " . $f_message . " Adapter Order ID: $oid", LOG_CRIT );
+ DonationLogger::log( "Resultswitcher: Request
forbidden. " . $f_message . " Adapter Order ID: $oid", LOG_CRIT );
return;
} else {
- $this->adapter->log( "Resultswitcher: OK to process
Order ID: " . $oid );
+ DonationLogger::log( "Resultswitcher: OK to process
Order ID: " . $oid );
}
if ( $this->adapter->checkTokens() ) {
@@ -91,7 +91,7 @@
$this->getOutput()->redirect(
$this->adapter->getFailPage() );
}
} else {
- $this->adapter->log( "Resultswitcher: Token Check
Failed. Order ID: $oid", LOG_ERR );
+ DonationLogger::log( "Resultswitcher: Token Check
Failed. Order ID: $oid", LOG_ERR );
}
}
diff --git a/amazon_gateway/amazon_gateway.body.php
b/amazon_gateway/amazon_gateway.body.php
index 785f4b9..b13bf91 100644
--- a/amazon_gateway/amazon_gateway.body.php
+++ b/amazon_gateway/amazon_gateway.body.php
@@ -50,7 +50,7 @@
return;
}
- $this->log( 'At gateway return with params: ' .
json_encode( $this->getRequest()->getValues() ), LOG_INFO );
+ DonationLogger::log( 'At gateway return with params: '
. json_encode( $this->getRequest()->getValues() ), LOG_INFO );
if ( $this->adapter->checkTokens() &&
$this->getRequest()->getText( 'status' ) ) {
$this->adapter->do_transaction(
'ProcessAmazonReturn' );
@@ -67,7 +67,7 @@
if ( !is_null( $specialform ) &&
$this->adapter->isValidSpecialForm( $specialform ) ){
$this->displayForm();
} else {
- $this->log( 'Failed to process gateway
return. Tokens bad or no status.', LOG_ERR );
+ DonationLogger::log( 'Failed to process
gateway return. Tokens bad or no status.', LOG_ERR );
}
}
}
diff --git a/gateway_common/GatewayPage.php b/gateway_common/GatewayPage.php
index f342786..85c7b65 100644
--- a/gateway_common/GatewayPage.php
+++ b/gateway_common/GatewayPage.php
@@ -128,7 +128,7 @@
$page = $this->adapter->getGlobal( "FailPage" );
$log_message = '"Redirecting to [ ' . $page . ' ] "';
- $this->log( $log_message, LOG_INFO );
+ DonationLogger::log( $log_message, LOG_INFO );
if ( $page ) {
@@ -218,7 +218,7 @@
* @param int|string $log_level The severity level of the message.
*/
public function log( $msg, $log_level=LOG_INFO ) {
- $this->adapter->log( $msg, $log_level );
+ DonationLogger::log( $msg, $log_level );
}
/**
@@ -341,7 +341,7 @@
'currency_code' => $defaultCurrency
) );
- $this->adapter->log( "Unsupported currency $oldCurrency forced
to $defaultCurrency" );
+ DonationLogger::log( "Unsupported currency $oldCurrency forced
to $defaultCurrency" );
return true;
}
}
diff --git a/gateway_forms/RapidHtml.php b/gateway_forms/RapidHtml.php
index d6cff83..4634eb7 100644
--- a/gateway_forms/RapidHtml.php
+++ b/gateway_forms/RapidHtml.php
@@ -134,7 +134,7 @@
$this->set_html_file_path( $ffname );
} catch ( MWException $mwe ) {
$message = "Could not load form '$ffname'";
- $this->gateway->log( $message, LOG_ERR );
+ DonationLogger::log( $message, LOG_ERR );
$this->set_html_file_path( 'error-noform' );
}
}
@@ -492,7 +492,7 @@
if ( $problems ){
if ( $fatal ){
$message = 'Requested an unavailable or
non-existent form.';
- $this->gateway->log( $message . ' ' .
$debug_message . ' ' . $this->gateway->getData_Unstaged_Escaped('utm_source') ,
LOG_ERR );
+ DonationLogger::log( $message . ' ' .
$debug_message . ' ' . $this->gateway->getData_Unstaged_Escaped('utm_source') ,
LOG_ERR );
throw new MWException( $message ); # TODO:
translate
} else {
return;
diff --git a/globalcollect_gateway/globalcollect_resultswitcher.body.php
b/globalcollect_gateway/globalcollect_resultswitcher.body.php
index f4e8cbf..5e5c6af 100644
--- a/globalcollect_gateway/globalcollect_resultswitcher.body.php
+++ b/globalcollect_gateway/globalcollect_resultswitcher.body.php
@@ -70,18 +70,18 @@
$f_message = "Requested order id not present in the
session. (session_oid = '$session_oid')";
if ( !$_SESSION ) {
- $this->adapter->log( "Resultswitcher:
{$this->qs_oid} Is popped out, but still has no session data.", LOG_ERR );
+ DonationLogger::log( "Resultswitcher:
{$this->qs_oid} Is popped out, but still has no session data.", LOG_ERR );
}
}
if ( $forbidden ){
- $this->adapter->log( $this->qs_oid . " Resultswitcher:
forbidden for reason: {$f_message}", LOG_ERR );
+ DonationLogger::log( $this->qs_oid . " Resultswitcher:
forbidden for reason: {$f_message}", LOG_ERR );
wfHttpError( 403, 'Forbidden', wfMessage(
'donate_interface-error-http-403' )->text() );
return;
}
$this->setHeaders();
- $this->adapter->log( "Resultswitcher: OK to process Order ID: "
. $this->qs_oid );
+ DonationLogger::log( "Resultswitcher: OK to process Order ID: "
. $this->qs_oid );
// dispatch forms/handling
if ( $this->adapter->checkTokens() ) {
@@ -97,7 +97,7 @@
if ( array_key_exists( 'pending',
$_SESSION ) ){
$started = $_SESSION['pending'];
//not sure what to do with this
yet, but I sure want to know if it's happening.
- $this->adapter->log(
"Resultswitcher: Parallel Universe Unlocked. Start time: $started", LOG_ALERT );
+ DonationLogger::log(
"Resultswitcher: Parallel Universe Unlocked. Start time: $started", LOG_ALERT );
}
$_SESSION['pending'] = microtime( true
); //We couldn't have gotten this far if the server wasn't sticky.
@@ -106,7 +106,7 @@
$_SESSION['order_status'][$oid]['data']['count'] = 0;
} else {
$_SESSION['order_status'][$oid]['data']['count'] =
$_SESSION['order_status'][$oid]['data']['count'] + 1;
- $this->adapter->log( "Resultswitcher:
Multiple attempts to process. " .
$_SESSION['order_status'][$oid]['data']['count'], LOG_ERR );
+ DonationLogger::log( "Resultswitcher:
Multiple attempts to process. " .
$_SESSION['order_status'][$oid]['data']['count'], LOG_ERR );
}
$result = $_SESSION['order_status'][$oid];
$this->displayResultsForDebug( $result );
@@ -128,16 +128,16 @@
$this->getOutput()->addHTML(
"<br>Redirecting to page $go" );
$this->getOutput()->redirect(
$go );
} else {
-
$this->adapter->log("Resultswitcher: No redirect defined. Order ID: $oid",
LOG_ERR);
+
DonationLogger::log("Resultswitcher: No redirect defined. Order ID: $oid",
LOG_ERR);
}
} else {
- $this->adapter->log("Resultswitcher: No
FinalStatus. Order ID: $oid", LOG_ERR);
+ DonationLogger::log("Resultswitcher: No
FinalStatus. Order ID: $oid", LOG_ERR);
}
} else {
- $this->adapter->log("Resultswitcher: Payment
method is not cc. Order ID: $oid", LOG_ERR);
+ DonationLogger::log("Resultswitcher: Payment
method is not cc. Order ID: $oid", LOG_ERR);
}
} else {
- $this->adapter->log("Resultswitcher: Token Check
Failed. Order ID: $oid", LOG_ERR);
+ DonationLogger::log("Resultswitcher: Token Check
Failed. Order ID: $oid", LOG_ERR);
}
}
@@ -169,17 +169,17 @@
$referrer = $this->getRequest()->getHeader( 'referer' );
if ( ( strpos( $referrer, $wgServer ) === false ) ) {
if ( !$_SESSION ) {
- $this->adapter->log( "Resultswitcher:
{$this->qs_oid} warning: iframed script cannot see session cookie.", LOG_ERR );
+ DonationLogger::log( "Resultswitcher:
{$this->qs_oid} warning: iframed script cannot see session cookie.", LOG_ERR );
}
$_SESSION['order_status'][$this->qs_oid] = 'liberated';
- $this->adapter->log("Resultswitcher: Popping out of
iframe for Order ID " . $this->qs_oid);
+ DonationLogger::log("Resultswitcher: Popping out of
iframe for Order ID " . $this->qs_oid);
$this->getOutput()->allowClickjacking();
$this->getOutput()->addModules( 'iframe.liberator' );
return true;
}
- $this->adapter->log( "Resultswitcher: good, it appears we are
not in an iframe. Order ID {$this->qs_oid}" );
+ DonationLogger::log( "Resultswitcher: good, it appears we are
not in an iframe. Order ID {$this->qs_oid}" );
}
}
diff --git a/paypal_gateway/paypal_resultswitcher.body.php
b/paypal_gateway/paypal_resultswitcher.body.php
index 3056534..b157cbd 100644
--- a/paypal_gateway/paypal_resultswitcher.body.php
+++ b/paypal_gateway/paypal_resultswitcher.body.php
@@ -63,7 +63,7 @@
*/
$this->getOutput()->redirect(
$this->adapter->getThankYouPage() );
} else {
- $this->adapter->log("Resultswitcher: Token Check
Failed. Order ID: $oid");
+ DonationLogger::log("Resultswitcher: Token Check
Failed. Order ID: $oid");
$this->getOutput()->redirect(
$this->adapter->getFailPage() );
}
}
--
To view, visit https://gerrit.wikimedia.org/r/190135
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iaf62b9ce6cedc7d4110e2b24166ef26b5068844a
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: Katie Horn <[email protected]>
Gerrit-Reviewer: Ssmith <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits