r83253 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83252‎ | r83253 | r83254 >
Date:22:43, 4 March 2011
Author:awjrichards
Status:deferred
Tags:
Comment:
Added debug log messages to transaction results; string-ified token match result in debug log message
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
@@ -142,7 +142,7 @@
143143 $token_match = $this->fnPayflowMatchEditToken( $token_check, $wgPayflowGatewaySalt );
144144 if ( $wgRequest->wasPosted() ) {
145145 self::log( $payflow_data[ 'order_id' ] . " " . $payflow_data[ 'i_order_id' ] . " Submitted edit token: " . $wgRequest->getText( 'token', 'None' ), 'payflowpro_gateway', LOG_DEBUG);
146 - self::log( $payflow_data[ 'order_id' ] . " " . $payflow_data[ 'i_order_id' ] . " Token match: " . $token_match, 'payflowpro_gateway', LOG_DEBUG );
 146+ self::log( $payflow_data[ 'order_id' ] . " " . $payflow_data[ 'i_order_id' ] . " Token match: " . ($token_match ? 'true' : 'false' ), 'payflowpro_gateway', LOG_DEBUG );
147147 }
148148 }
149149
@@ -505,19 +505,24 @@
506506
507507 // if approved, display results and send transaction to the queue
508508 if ( $errorCode == '1' ) {
 509+ self::log( $data[ 'order_id' ] . " " . $data[ 'i_order_id' ] . " Transaction approved.", 'payflowpro_gateway', LOG_DEBUG );
509510 $this->fnPayflowDisplayApprovedResults( $data, $responseArray, $responseMsg );
510511 // give user a second chance to enter incorrect data
511512 } elseif ( ( $errorCode == '3' ) && ( $data['numAttempt'] < '5' ) ) {
 513+ self::log( $data[ 'order_id' ] . " " . $data[ 'i_order_id' ] . " Transaction unsuccessful (invalid info).", 'payflowpro_gateway', LOG_DEBUG );
512514 // pass responseMsg as an array key as required by displayForm
513 - $this->errors['retryMsg'] = $responseMsg;
514 - $this->fnPayflowDisplayForm( $data, $this->errors );
 515+ $this->errors['retryMsg'] = $responseMsg;
 516+ $this->fnPayflowDisplayForm( $data, $this->errors );
515517 // if declined or if user has already made two attempts, decline
516518 } elseif ( ( $errorCode == '2' ) || ( $data['numAttempt'] >= '3' ) ) {
517 - $this->fnPayflowDisplayDeclinedResults( $responseMsg );
 519+ self::log( $data[ 'order_id' ] . " " . $data[ 'i_order_id' ] . " Transaction declined.", 'payflowpro_gateway', LOG_DEBUG );
 520+ $this->fnPayflowDisplayDeclinedResults( $responseMsg );
518521 } elseif ( ( $errorCode == '4' ) ) {
519 - $this->fnPayflowDisplayOtherResults( $responseMsg );
 522+ self::log( $data[ 'order_id' ] . " " . $data[ 'i_order_id' ] . " Transaction unsuccessful.", 'payflowpro_gateway', LOG_DEBUG );
 523+ $this->fnPayflowDisplayOtherResults( $responseMsg );
520524 } elseif ( ( $errorCode == '5' ) ) {
521 - $this->fnPayflowDisplayPending( $data, $responseArray, $responseMsg );
 525+ self::log( $data[ 'order_id' ] . " " . $data[ 'i_order_id' ] . " Transaction pending.", 'payflowpro_gateway', LOG_DEBUG );
 526+ $this->fnPayflowDisplayPending( $data, $responseArray, $responseMsg );
522527 }
523528
524529 }// end display results

Status & tagging log