https://www.mediawiki.org/wiki/Special:Code/MediaWiki/102052

Revision: 102052
Author:   jpostlethwaite
Date:     2011-11-04 21:40:09 +0000 (Fri, 04 Nov 2011)
Log Message:
-----------
Removing dependency from accessing raw data in GlobalCollectGateway::execute(). 
See r102050, r102051.

Modified Paths:
--------------
    
trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php

Modified: 
trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php
===================================================================
--- 
trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php
     2011-11-04 21:37:27 UTC (rev 102051)
+++ 
trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php
     2011-11-04 21:40:09 UTC (rev 102052)
@@ -84,26 +84,14 @@
                // dispatch forms/handling
                if ( $this->adapter->checkTokens() ) {  
 
-                       //TODO: Get rid of $data out here completely, by 
putting this logic inside the adapter somewhere. 
-                       //All we seem to be doing with it now, is internal 
adapter logic outside of the adapter. 
-                       $data = $this->adapter->getData_Raw();
-
                        if ( $this->adapter->posted ) {
                                
                                // The form was submitted and the payment 
method has been set
-                               /*
-                                * The $payment_method should default to false.
-                                *
-                                * An invalid $payment_method will cause an 
error.
-                                */
+                               $payment_method = 
$this->adapter->getPaymentMethod();
+                               $payment_submethod = 
$this->adapter->getPaymentSubmethod();
 
-                               $payment_method = ( isset( 
$data['payment_method'] ) && !empty( $data['payment_method'] ) ) ? 
$data['payment_method'] : 'cc';
-                               $payment_submethod = ( isset( 
$data['payment_submethod'] ) && !empty( $data['payment_submethod'] ) ) ? 
$data['payment_submethod'] : '';
-               
-                               $payment_submethodMeta = 
$this->adapter->getPaymentSubmethodMeta( $payment_submethod, array( 'log' => 
true, ) );
-                               
                                // Check form for errors
-                               $form_errors = $this->validateForm( 
$this->errors, $payment_submethodMeta['validation'] );
+                               $form_errors = $this->validateForm( 
$this->errors, $this->adapter->getPaymentSubmethodFormValidation() );
                                
                                // If there were errors, redisplay form, 
otherwise proceed to next step
                                if ( $form_errors ) {
@@ -172,6 +160,10 @@
                                        $this->adapter->do_transaction( 
'GET_ORDERSTATUS' );
                                        $this->displayResultsForDebug();
                                }
+
+                               //TODO: Get rid of $data out here completely, 
by putting this logic inside the adapter somewhere. 
+                               //All we seem to be doing with it now, is 
internal adapter logic outside of the adapter. 
+                               $data = $this->adapter->getData_Raw();
                                
                                // If the result of the previous transaction 
was failure, set the retry message.
                                if ( $data && array_key_exists( 'response', 
$data ) && $data['response'] == 'failure' ) {


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to