r100449 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100448‎ | r100449 | r100450 >
Date:20:31, 21 October 2011
Author:kaldari
Status:ok
Tags:fundraising 
Comment:
some helpful comments, fixing an error message
Modified paths:
  • /trunk/extensions/DonationInterface/gateway_common/gateway.adapter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/gateway_common/gateway.adapter.php
@@ -469,17 +469,18 @@
470470
471471 $this->dataObj->updateContributionTracking( defined( 'OWA' ) );
472472
 473+ // If the payment processor requires XML, package our data into XML.
473474 if ( $this->getCommunicationType() === 'xml' ) {
474 - $this->getStopwatch( "buildRequestXML" );
475 - $curlme = $this->buildRequestXML();
476 - $this->saveCommunicationStats( "buildRequestXML", $transaction );
 475+ $this->getStopwatch( "buildRequestXML" ); // begin profiling
 476+ $curlme = $this->buildRequestXML(); // build the XML
 477+ $this->saveCommunicationStats( "buildRequestXML", $transaction ); // save profiling data
477478 }
478479
 480+ // If the payment processor requires name/value pairs, package our data into name/value pairs.
479481 if ( $this->getCommunicationType() === 'namevalue' ) {
480 - //buildRequestNameValueString()
481 - $this->getStopwatch( "buildRequestNameValueString" );
482 - $curlme = $this->buildRequestNameValueString();
483 - $this->saveCommunicationStats( "buildRequestNameValueString", $transaction );
 482+ $this->getStopwatch( "buildRequestNameValueString" ); // begin profiling
 483+ $curlme = $this->buildRequestNameValueString(); // build the name/value pairs
 484+ $this->saveCommunicationStats( "buildRequestNameValueString", $transaction ); // save profiling data
484485 }
485486 } catch ( MWException $e ) {
486487 self::log( "Malformed gateway definition. Cannot continue: Aborting.", LOG_CRIT );
@@ -488,7 +489,7 @@
489490 //TODO: appropriate messages.
490491 'message' => "$transaction : Malformed gateway definition. Cannot continue: Aborting.",
491492 'errors' => array(
492 - '1000000' => 'Faulty Code! Bad programmer. Bad!' //...please change this.
 493+ '1000000' => 'Transaction could not be processed due to an internal error.'
493494 ),
494495 'action' => $this->action,
495496 );
@@ -777,6 +778,11 @@
778779 return $result;
779780 }
780781
 782+ /**
 783+ * Get the communication type from the gateway class. The communication type is how we need to
 784+ * package the donation data before we send it off to the payment processor, for example, 'xml'
 785+ * or 'namevalue'.
 786+ */
781787 static function getCommunicationType() {
782788 $c = get_called_class();
783789 return $c::COMMUNICATION_TYPE;

Status & tagging log