r101826 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101825‎ | r101826 | r101827 >
Date:15:51, 3 November 2011
Author:jpostlethwaite
Status:ok
Tags:fundraising 
Comment:
Changed displayResultsForDebug() to not require the $results parameter. This can be pulled from $this->adapter->getTransactionAllResults(). Added resultHandler() and resultHandlerError().
Modified paths:
  • /trunk/extensions/DonationInterface/gateway_common/GatewayForm.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/gateway_common/GatewayForm.php
@@ -50,7 +50,6 @@
5151 */
5252 public $validateFormResult = true;
5353
54 -
5554 /**
5655 * Constructor
5756 */
@@ -349,8 +348,18 @@
350349 return $this->form_class;
351350 }
352351
353 - function displayResultsForDebug( $results ) {
 352+ /**
 353+ * Get the currently set form class
 354+ *
 355+ * Will set the form class if the form class not already set
 356+ * Using logic in setFormClass()
 357+ * @return string
 358+ */
 359+ protected function displayResultsForDebug( $results = array() ) {
354360 global $wgOut;
 361+
 362+ $results = empty( $results ) ? $this->adapter->getTransactionAllResults() : $results;
 363+
355364 if ( $this->adapter->getGlobal( 'DisplayDebug' ) !== true ){
356365 return;
357366 }
@@ -553,6 +562,41 @@
554563 $this->validateFormResult = empty( $validateFormResult ) ? false : ( boolean ) $validateFormResult;
555564 }
556565
 566+ /**
 567+ * Handle the result from the gateway
 568+ *
 569+ * @todo
 570+ * - This is being implemented in GlobalCollect
 571+ * - Do we need to implement this for PayFlow Pro? Not yet!
 572+ */
 573+ protected function resultHandler() {
 574+ global $wgOut;
 575+
 576+ // If transaction was successful, go to the thank you page.
 577+ if ( $this->adapter->getTransactionStatus() ) {
 578+ $thankyoupage = $this->adapter->getGlobal( 'ThankYouPage' );
 579+
 580+ if ( $thankyoupage ) {
 581+ return $wgOut->redirect( $thankyoupage . "/" . $this->adapter->getTransactionDataLanguage() );
 582+ }
 583+ }
 584+
 585+ // If we did not go to the Thank you page, there must be an error.
 586+ return $this->resultHandlerError();
 587+
 588+ }
 589+
 590+ /**
 591+ * Handle the error result from the gateway
 592+ *
 593+ * Override this method in the payment gateway body class.
 594+ */
 595+ protected function resultHandlerError() {
 596+
 597+ // Display debugging results
 598+ $this->displayResultsForDebug();
 599+ }
 600+
557601 }
558602
559603 //end of GatewayForm class definiton

Follow-up revisions

RevisionCommit summaryAuthorDate
r102236MFT r90286, r100671, r100837, r100950, r101060, r101063, r101064, r101073, r1......khorn03:06, 7 November 2011
r102237MFT r90286, r100671, r100837, r100950, r101060, r101063, r101064, r101073, r1......khorn03:07, 7 November 2011

Status & tagging log