r100462 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100461‎ | r100462 | r100463 >
Date:22:00, 21 October 2011
Author:jpostlethwaite
Status:deferred (Comments)
Tags:fundraising 
Comment:
Changed $transactionType to $payment_method. Added $result parameter to executeiFrameForCreditCard().
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
@@ -53,6 +53,7 @@
5454 // Hide unneeded interface elements
5555 $wgOut->addModules( 'donationInterface.skinOverride' );
5656
 57+ // Used to add gateway specific error messages.
5758 $gateway_id = $this->adapter->getIdentifier();
5859
5960 $this->addErrorMessageScript();
@@ -87,21 +88,22 @@
8889
8990 // dispatch forms/handling
9091 if ( $this->adapter->checkTokens() ) {
91 - if ( $this->adapter->posted && $data['payment_method'] == 'processed' ) {
 92+ if ( $this->adapter->posted ) {
9293 // The form was submitted and the payment method has been set
9394 $this->adapter->log( "Form posted and payment method set." );
9495
9596 /*
96 - * The $transactionType should default to false.
 97+ * The $payment_method should default to false.
9798 *
98 - * An invalid $transactionType will cause an error.
 99+ * An invalid $payment_method will cause an error.
99100 */
100 - $transactionType = ( isset( $data['transaction_type'] ) && !empty( $data['transaction_type'] ) ) ? $data['transaction_type'] : false;
 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;
101103
102 - $transactionTypeMeta = $this->adapter->getTransactionTypeMeta( $transactionType, array( 'log' => true, ) );
 104+ $payment_submethodMeta = $this->adapter->getPaymentSubmethodMeta( $payment_submethod, array( 'log' => true, ) );
103105
104106 // Check form for errors
105 - $form_errors = $this->validateForm( $data, $this->errors, $transactionTypeMeta['validation'] );
 107+ $form_errors = $this->validateForm( $data, $this->errors, $payment_submethodMeta['validation'] );
106108
107109 // If there were errors, redisplay form, otherwise proceed to next step
108110 if ( $form_errors ) {
@@ -115,9 +117,9 @@
116118
117119 $this->displayResultsForDebug( $result );
118120
119 - if ( $transactionType == 'credit' ) {
 121+ if ( $payment_method == 'credit' ) {
120122
121 - $this->executeiFrameForCreditCard();
 123+ $this->executeIframeForCreditCard( $result );
122124 }
123125
124126
@@ -144,9 +146,14 @@
145147 }
146148
147149 /**
148 - * Execute execute iFrame for credit card
 150+ * Execute iframe for credit card
 151+ *
 152+ * @param array $result The result array from the gateway adapter
 153+ *
 154+ * @todo
 155+ * - this needs to be moved out of @see GlobalCollectGateway and into the adapter.
149156 */
150 - public function executeiFrameForCreditCard() {
 157+ public function executeIframeForCreditCard( $result ) {
151158
152159 global $wgOut;
153160

Follow-up revisions

RevisionCommit summaryAuthorDate
r100643Commenting out parts of r100462, r100461, r100411, in order to get CC in Glob...khorn20:07, 24 October 2011
r100648Fixed the issues with credit cards for r100643.jpostlethwaite21:32, 24 October 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r100456Reallocating fields in forms: payment_method. Adding fields: payment_submetho...jpostlethwaite21:42, 21 October 2011

Comments

#Comment by Khorn (WMF) (talk | contribs)   20:09, 24 October 2011

Parts of this broke CC in GlobalCollect. Those parts were commented out in r100643. Please fix asap.

#Comment by Jpostlethwaite (talk | contribs)   21:34, 24 October 2011

Fixed in r100648.

Status & tagging log