r102052 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102051‎ | r102052 | r102053 >
Date:21:40, 4 November 2011
Author:jpostlethwaite
Status:ok
Tags:fundraising 
Comment:
Removing dependency from accessing raw data in GlobalCollectGateway::execute(). See r102050, r102051.
Modified paths:
  • /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php
@@ -84,26 +84,14 @@
8585 // dispatch forms/handling
8686 if ( $this->adapter->checkTokens() ) {
8787
88 - //TODO: Get rid of $data out here completely, by putting this logic inside the adapter somewhere.
89 - //All we seem to be doing with it now, is internal adapter logic outside of the adapter.
90 - $data = $this->adapter->getData_Raw();
91 -
9288 if ( $this->adapter->posted ) {
9389
9490 // The form was submitted and the payment method has been set
95 - /*
96 - * The $payment_method should default to false.
97 - *
98 - * An invalid $payment_method will cause an error.
99 - */
 91+ $payment_method = $this->adapter->getPaymentMethod();
 92+ $payment_submethod = $this->adapter->getPaymentSubmethod();
10093
101 - $payment_method = ( isset( $data['payment_method'] ) && !empty( $data['payment_method'] ) ) ? $data['payment_method'] : 'cc';
102 - $payment_submethod = ( isset( $data['payment_submethod'] ) && !empty( $data['payment_submethod'] ) ) ? $data['payment_submethod'] : '';
103 -
104 - $payment_submethodMeta = $this->adapter->getPaymentSubmethodMeta( $payment_submethod, array( 'log' => true, ) );
105 -
10694 // Check form for errors
107 - $form_errors = $this->validateForm( $this->errors, $payment_submethodMeta['validation'] );
 95+ $form_errors = $this->validateForm( $this->errors, $this->adapter->getPaymentSubmethodFormValidation() );
10896
10997 // If there were errors, redisplay form, otherwise proceed to next step
11098 if ( $form_errors ) {
@@ -172,6 +160,10 @@
173161 $this->adapter->do_transaction( 'GET_ORDERSTATUS' );
174162 $this->displayResultsForDebug();
175163 }
 164+
 165+ //TODO: Get rid of $data out here completely, by putting this logic inside the adapter somewhere.
 166+ //All we seem to be doing with it now, is internal adapter logic outside of the adapter.
 167+ $data = $this->adapter->getData_Raw();
176168
177169 // If the result of the previous transaction was failure, set the retry message.
178170 if ( $data && array_key_exists( 'response', $data ) && $data['response'] == 'failure' ) {

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

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r102050Added helpers: getPaymentMethod() and getPaymentSubmethod().jpostlethwaite21:36, 4 November 2011
r102051Added helper: getPaymentSubmethodFormValidation().jpostlethwaite21:37, 4 November 2011

Status & tagging log