r100643 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100642‎ | r100643 | r100644 >
Date:20:07, 24 October 2011
Author:khorn
Status:ok
Tags:fundraising 
Comment:
Commenting out parts of r100462, r100461, r100411, in order to get CC in GlobalCollect back to a working state.
Did not do the automatic revert, because that ended up being significantly more work to track down.
Modified paths:
  • /trunk/extensions/DonationInterface/gateway_common/GatewayForm.php (modified) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php (modified) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php
@@ -92,18 +92,25 @@
9393 // The form was submitted and the payment method has been set
9494 $this->adapter->log( "Form posted and payment method set." );
9595
96 - /*
97 - * The $payment_method should default to false.
98 - *
99 - * An invalid $payment_method will cause an error.
100 - */
101 - $payment_method = ( isset( $data['payment_method'] ) && !empty( $data['payment_method'] ) ) ? $data['payment_method'] : false;
102 - $payment_submethod = ( isset( $data['payment_submethod'] ) && !empty( $data['payment_submethod'] ) ) ? $data['payment_submethod'] : false;
103 -
104 - $payment_submethodMeta = $this->adapter->getPaymentSubmethodMeta( $payment_submethod, array( 'log' => true, ) );
 96+ /* Commenting out because this is completely breaking Credit Card in GC.
 97+ * Under usual circumstances, that would be an automatic revert, but
 98+ * there were no small number of clean places to do that.
 99+ **/
105100
106 - // Check form for errors
107 - $form_errors = $this->validateForm( $data, $this->errors, $payment_submethodMeta['validation'] );
 101+// /*
 102+// * The $payment_method should default to false.
 103+// *
 104+// * An invalid $payment_method will cause an error.
 105+// */
 106+// $payment_method = ( isset( $data['payment_method'] ) && !empty( $data['payment_method'] ) ) ? $data['payment_method'] : false;
 107+// $payment_submethod = ( isset( $data['payment_submethod'] ) && !empty( $data['payment_submethod'] ) ) ? $data['payment_submethod'] : false;
 108+//
 109+// $payment_submethodMeta = $this->adapter->getPaymentSubmethodMeta( $payment_submethod, array( 'log' => true, ) );
 110+//
 111+// // Check form for errors
 112+// $form_errors = $this->validateForm( $data, $this->errors, $payment_submethodMeta['validation'] );
 113+
 114+ $form_errors = $this->validateForm( $data, $this->errors, array( 'address', 'amount', 'creditCard', 'email', 'name' ) );
108115
109116 // If there were errors, redisplay form, otherwise proceed to next step
110117 if ( $form_errors ) {
@@ -117,10 +124,10 @@
118125
119126 $this->displayResultsForDebug( $result );
120127
121 - if ( $payment_method == 'credit' ) {
 128+ //if ( $payment_method == 'credit' ) {
122129
123 - $this->executeIframeForCreditCard( $result );
124 - }
 130+ $this->executeIframeForCreditCard( $result );
 131+ //}
125132
126133
127134 //TODO: add all the hooks back in.
Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php
@@ -325,27 +325,32 @@
326326 */
327327 public function getPaymentSubmethodMeta( $payment_submethod, $options = array() ) {
328328
329 - extract( $options );
 329+ /* Commenting out because this is completely breaking Credit Card in GC.
 330+ * Under usual circumstances, that would be an automatic revert, but
 331+ * there were no small number of clean places to do that.
 332+ **/
330333
331 - $log = isset( $log ) ? (boolean) $log : false ;
332 -
333 - if ( isset( $this->payment_submethods[ $payment_submethod ] ) ) {
334 -
335 - if ( $log ) {
336 - $this->log( 'Getting payment submethod: ' . ( string ) $payment_submethod );
337 - }
338 -
339 - // Ensure that the validation index is set.
340 - if ( !isset( $this->payment_submethods[ $payment_submethod ]['validation'] ) ) {
341 - $this->payment_submethods[ $payment_submethod ]['validation'] = array();
342 - }
343 -
344 - return $this->payment_submethods[ $payment_submethod ];
345 - }
346 - else {
347 - $message = 'The payment submethod [ ' . $payment_submethod . ' ] was not found.';
348 - throw new Exception( $message );
349 - }
 334+// extract( $options );
 335+//
 336+// $log = isset( $log ) ? (boolean) $log : false ;
 337+//
 338+// if ( isset( $this->payment_submethods[ $payment_submethod ] ) ) {
 339+//
 340+// if ( $log ) {
 341+// $this->log( 'Getting payment submethod: ' . ( string ) $payment_submethod );
 342+// }
 343+//
 344+// // Ensure that the validation index is set.
 345+// if ( !isset( $this->payment_submethods[ $payment_submethod ]['validation'] ) ) {
 346+// $this->payment_submethods[ $payment_submethod ]['validation'] = array();
 347+// }
 348+//
 349+// return $this->payment_submethods[ $payment_submethod ];
 350+// }
 351+// else {
 352+// $message = 'The payment submethod [ ' . $payment_submethod . ' ] was not found.';
 353+// throw new Exception( $message );
 354+// }
350355 }
351356
352357 /**
Index: trunk/extensions/DonationInterface/gateway_common/GatewayForm.php
@@ -95,6 +95,9 @@
9696 * @see GatewayForm::fnValidateForm()
9797 */
9898 public function validateForm( &$data, &$error, $options = array( ) ) {
 99+
 100+ //TODO: Should parts of this fail closed? Probably. Right now, with no
 101+ //options sent, nothing will validate.
99102
100103 extract( $options );
101104

Follow-up revisions

RevisionCommit summaryAuthorDate
r100648Fixed the issues with credit cards for r100643.jpostlethwaite21:32, 24 October 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r100411Removed BANK_TRANSFER as a transaction. Set it as a transaction type. Added t...jpostlethwaite04:52, 21 October 2011
r100461Changed $transaction_groups to $payment_methods. Changed $transaction_types t...jpostlethwaite21:59, 21 October 2011
r100462Changed $transactionType to $payment_method. Added $result parameter to execu...jpostlethwaite22:00, 21 October 2011

Status & tagging log