Ejegg has uploaded a new change for review.
https://gerrit.wikimedia.org/r/250062
Change subject: Log reasons for redirects to fail/ty pages
......................................................................
Log reasons for redirects to fail/ty pages
Change-Id: I3a7f0826f0f5c0c8be3a3c444b4a90c921147b49
---
M gateway_common/GatewayPage.php
M globalcollect_gateway/globalcollect_resultswitcher.body.php
M paypal_gateway/paypal_resultswitcher.body.php
M worldpay_gateway/worldpay_resultswitcher.body.php
4 files changed, 18 insertions(+), 4 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface
refs/changes/62/250062/1
diff --git a/gateway_common/GatewayPage.php b/gateway_common/GatewayPage.php
index e0b7484..780f5b3 100644
--- a/gateway_common/GatewayPage.php
+++ b/gateway_common/GatewayPage.php
@@ -71,6 +71,7 @@
}
if ( $this->adapter->getGlobal( 'Enabled' ) !== true ) {
+ $this->logger->info( 'Displaying fail page for disabled
gateway' );
$this->displayFailPage();
return;
}
@@ -84,7 +85,7 @@
try {
$this->handleRequest();
} catch ( Exception $ex ) {
- $this->logger->error( "Gateway page errored out due to:
" . $ex->getMessage() );
+ $this->logger->error( "Displaying fail page for
exception: " . $ex->getMessage() );
$this->displayFailPage();
}
}
@@ -142,6 +143,7 @@
$wgOut->addModules( $form_obj->getResources() );
$wgOut->addHTML( $form );
} else {
+ $this->logger->error( "Displaying fail page for bad
form class '$form_class'" );
$this->displayFailPage();
}
}
@@ -418,12 +420,15 @@
// communication_type of 'incoming' and a way to
provide the
// adapter the GET/POST params harvested here.
$this->adapter->processResponse( $response );
- switch ( $this->adapter->getFinalStatus() ) {
+ $status = $this->adapter->getFinalStatus();
+ switch ( $status ) {
case FinalStatus::COMPLETE:
case FinalStatus::PENDING:
+ $this->logger->info( "Displaying thank you page
for status $status." );
$this->getOutput()->redirect(
$this->adapter->getThankYouPage() );
return;
}
+ $this->logger->info( "Displaying fail page for final
status $status" );
} else {
$this->logger->error( "Resultswitcher: Token Check
Failed. Order ID: $oid" );
}
@@ -444,6 +449,7 @@
*/
protected function renderResponse( PaymentResult $result ) {
if ( $result->isFailed() ) {
+ $this->logger->info( 'Displaying fail page for failed
PaymentResult' );
$this->displayFailPage();
} elseif ( $url = $result->getRedirect() ) {
$this->getOutput()->redirect( $url );
@@ -482,6 +488,7 @@
$this->displayForm();
} else {
// Success.
+ $this->logger->info( 'Displaying thank you page for
successful PaymentResult' );
$this->getOutput()->redirect(
$this->adapter->getThankYouPage() );
}
}
diff --git a/globalcollect_gateway/globalcollect_resultswitcher.body.php
b/globalcollect_gateway/globalcollect_resultswitcher.body.php
index e7fc7e0..c194cb9 100644
--- a/globalcollect_gateway/globalcollect_resultswitcher.body.php
+++ b/globalcollect_gateway/globalcollect_resultswitcher.body.php
@@ -124,14 +124,17 @@
$this->displayResultsForDebug( $result );
//do the switching between the... stuff.
- if ( $this->adapter->getFinalStatus() ){
- switch (
$this->adapter->getFinalStatus() ) {
+ $status = $this->adapter->getFinalStatus();
+ if ( $status ) {
+ switch ( $status ) {
case FinalStatus::COMPLETE:
case FinalStatus::PENDING:
case FinalStatus::PENDING_POKE:
+ $this->logger->info(
"Displaying thank you page for final status $status" );
$go =
$this->adapter->getThankYouPage();
break;
case FinalStatus::FAILED:
+ $this->logger->info(
'Displaying fail page for final status failed.' );
$this->displayFailPage();
return;
}
@@ -151,6 +154,7 @@
} else {
$this->logger->error("Resultswitcher: Token Check
Failed. Order ID: $oid" );
}
+ $this->displayFailPage();
}
function popout_if_iframe() {
diff --git a/paypal_gateway/paypal_resultswitcher.body.php
b/paypal_gateway/paypal_resultswitcher.body.php
index 0f763cd..4ab6534 100644
--- a/paypal_gateway/paypal_resultswitcher.body.php
+++ b/paypal_gateway/paypal_resultswitcher.body.php
@@ -61,6 +61,7 @@
}
$this->getOutput()->redirect(
$this->adapter->getFailPage() );
*/
+ $this->logger->info( "Displaying thank you page" );
$this->getOutput()->redirect(
$this->adapter->getThankYouPage() );
} else {
$this->logger->info( "Resultswitcher: Token Check
Failed. Order ID: $oid" );
diff --git a/worldpay_gateway/worldpay_resultswitcher.body.php
b/worldpay_gateway/worldpay_resultswitcher.body.php
index b7fe881..c89cabc 100644
--- a/worldpay_gateway/worldpay_resultswitcher.body.php
+++ b/worldpay_gateway/worldpay_resultswitcher.body.php
@@ -28,9 +28,11 @@
case FinalStatus::COMPLETE:
case FinalStatus::PENDING:
case FinalStatus::PENDING_POKE:
+ $this->logger->info( "Displaying thank
you page for status $status." );
$this->getOutput()->redirect(
$this->adapter->getThankYouPage() );
break;
case FinalStatus::FAILED:
+ $this->logger->info( 'Displaying fail
page for final status failed.' );
$this->displayFailPage();
return;
}
--
To view, visit https://gerrit.wikimedia.org/r/250062
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3a7f0826f0f5c0c8be3a3c444b4a90c921147b49
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits