Index: trunk/extensions/DonationInterface/gateway_common/gateway.adapter.php |
— | — | @@ -469,17 +469,18 @@ |
470 | 470 | |
471 | 471 | $this->dataObj->updateContributionTracking( defined( 'OWA' ) ); |
472 | 472 | |
| 473 | + // If the payment processor requires XML, package our data into XML. |
473 | 474 | 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 |
477 | 478 | } |
478 | 479 | |
| 480 | + // If the payment processor requires name/value pairs, package our data into name/value pairs. |
479 | 481 | 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 |
484 | 485 | } |
485 | 486 | } catch ( MWException $e ) { |
486 | 487 | self::log( "Malformed gateway definition. Cannot continue: Aborting.", LOG_CRIT ); |
— | — | @@ -488,7 +489,7 @@ |
489 | 490 | //TODO: appropriate messages. |
490 | 491 | 'message' => "$transaction : Malformed gateway definition. Cannot continue: Aborting.", |
491 | 492 | 'errors' => array( |
492 | | - '1000000' => 'Faulty Code! Bad programmer. Bad!' //...please change this. |
| 493 | + '1000000' => 'Transaction could not be processed due to an internal error.' |
493 | 494 | ), |
494 | 495 | 'action' => $this->action, |
495 | 496 | ); |
— | — | @@ -777,6 +778,11 @@ |
778 | 779 | return $result; |
779 | 780 | } |
780 | 781 | |
| 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 | + */ |
781 | 787 | static function getCommunicationType() { |
782 | 788 | $c = get_called_class(); |
783 | 789 | return $c::COMMUNICATION_TYPE; |