r100489 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100488‎ | r100489 | r100490 >
Date:02:18, 22 October 2011
Author:reedy
Status:ok
Tags:fundraising 
Comment:
Remove unuesd globals

Fix a couple of undefined variables
Modified paths:
  • /trunk/extensions/DonationInterface/extras/recaptcha/recaptcha.body.php (modified) (history)
  • /trunk/extensions/DonationInterface/gateway_common/DonationData.php (modified) (history)
  • /trunk/extensions/DonationInterface/gateway_common/GatewayForm.php (modified) (history)
  • /trunk/extensions/DonationInterface/gateway_common/donation.api.php (modified) (history)
  • /trunk/extensions/DonationInterface/gateway_forms/OneStepTwoColumn.php (modified) (history)
  • /trunk/extensions/DonationInterface/gateway_forms/TwoColumnLetter7.php (modified) (history)
  • /trunk/extensions/DonationInterface/gateway_forms/TwoStepAmount.php (modified) (history)
  • /trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumn.php (modified) (history)
  • /trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter3.php (modified) (history)
  • /trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremium.php (modified) (history)
  • /trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremiumUS.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php (modified) (history)
  • /trunk/extensions/DonationInterface/tests/Adapter/GlobalCollect/BankTransferTestCase.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/tests/Adapter/GlobalCollect/BankTransferTestCase.php
@@ -24,7 +24,7 @@
2525 require_once dirname( dirname( dirname( __FILE__ ) ) ) . DIRECTORY_SEPARATOR . 'DonationInterfaceTestCase.php';
2626
2727 /**
28 - *
 28+ *
2929 * @group Fundraising
3030 * @group Gateways
3131 * @group DonationInterface
@@ -62,7 +62,7 @@
6363 IBAN
6464 CountryDescription
6565 Notes
66 - We do not need to have donor information stored on our side yet as long as it is sent to Global Collect
 66+ We do not need to have donor information stored on our side yet as long as it is sent to Global Collect
6767 */
6868
6969 /**
@@ -80,12 +80,11 @@
8181 public function testbuildRequestXML() {
8282
8383 global $wgGlobalCollectGatewayTest;
84 - global $wgRequest;
85 -
 84+
8685 $wgGlobalCollectGatewayTest = true;
8786
8887 $_SERVER = array();
89 -
 88+
9089 $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1';
9190 $_SERVER['HTTP_HOST'] = TESTS_HOSTNAME;
9291 $_SERVER['SERVER_NAME'] = TESTS_HOSTNAME;
@@ -93,17 +92,17 @@
9493
9594
9695 $options = array();
97 -
 96+
9897 $options['test'] = true;
9998 $transactionType = 'BANK_TRANSFER';
100 -
 99+
101100 $amount = 350;
102 -
 101+
103102 $options['postDefaults'] = array(
104103 'returnTitle' => true,
105104 'returnTo' => 'http://' . TESTS_HOSTNAME . '/index.php/Special:GlobalCollectGatewayResult',
106105 );
107 -
 106+
108107 $options['testData'] = array(
109108 'amount' => $amount,
110109 'transaction_type' => $transactionType,
@@ -139,15 +138,15 @@
140139 'owa_ref' => 'http://localhost/defaultTestData',
141140 'transaction_type' => '', // Used by GlobalCollect for payment types
142141 );
143 -
 142+
144143 $gateway = new GlobalCollectAdapter( $options );
145144
146145 $result = $gateway->do_transaction( $transactionType );
147 -
 146+
148147 $request = trim( $gateway->buildRequestXML() );
149 -
 148+
150149 $orderId = $gateway->getData( 'order_id' );
151 -
 150+
152151 $expected = '<?xml version="1.0"?>' . "\n";
153152 $expected .= '<XML><REQUEST><ACTION>INSERT_ORDERWITHPAYMENT</ACTION><META><MERCHANTID>6570</MERCHANTID><VERSION>1.0</VERSION></META><PARAMS><ORDER><ORDERID>' . $orderId . '</ORDERID><AMOUNT>' . $amount * 100 . '</AMOUNT><CURRENCYCODE>EUR</CURRENCYCODE><LANGUAGECODE>en</LANGUAGECODE><COUNTRYCODE>ES</COUNTRYCODE><MERCHANTREFERENCE>' . $orderId . '</MERCHANTREFERENCE></ORDER><PAYMENT><PAYMENTPRODUCTID>11</PAYMENTPRODUCTID><AMOUNT>35000</AMOUNT><CURRENCYCODE>EUR</CURRENCYCODE><LANGUAGECODE>en</LANGUAGECODE><COUNTRYCODE>ES</COUNTRYCODE><HOSTEDINDICATOR>1</HOSTEDINDICATOR><RETURNURL>http://wikimedia-fundraising-1.17.localhost.wikimedia.org/index.php/Special:GlobalCollectGatewayResult?order_id=' . $orderId . '</RETURNURL><FIRSTNAME>Testy</FIRSTNAME><SURNAME>Testerton</SURNAME><STREET>123 Happy Street</STREET><CITY>Barcelona</CITY><STATE>XX</STATE><EMAIL>jpostlethwaite@wikimedia.org</EMAIL></PAYMENT></PARAMS></REQUEST></XML>';
154153 //$expected .= '<XML><REQUEST><ACTION>Donate</ACTION><ACCOUNT><MERCHANTID>128</MERCHANTID><PASSWORD>k4ftw</PASSWORD><VERSION>3.2</VERSION><RETURNURL>http://' . TESTS_HOSTNAME . '/index.php/Donate-thanks/en</RETURNURL></ACCOUNT><DONATION><DONOR>Tester Testington</DONOR><AMOUNT>35000</AMOUNT><CURRENCYCODE>USD</CURRENCYCODE><LANGUAGECODE>en</LANGUAGECODE><COUNTRYCODE>US</COUNTRYCODE></DONATION></REQUEST></XML>' . "\n";
@@ -181,29 +180,28 @@
182181 $this->markTestIncomplete( TESTS_MESSAGE_NOT_IMPLEMENTED );
183182
184183 global $wgGlobalCollectGatewayTest;
185 - global $wgRequest;
186 -
 184+
187185 $wgGlobalCollectGatewayTest = true;
188186
189187 $_SERVER = array();
190 -
 188+
191189 $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1';
192190 $_SERVER['HTTP_HOST'] = TESTS_HOSTNAME;
193191 $_SERVER['SERVER_NAME'] = TESTS_HOSTNAME;
194192 $_SERVER['REQUEST_URI'] = '/index.php/Special:GlobalCollectGateway?form_name=TwoStepAmount';
195193
196194 $options = array();
197 -
 195+
198196 $options['test'] = true;
199197 $transactionType = 'BANK_TRANSFER';
200 -
 198+
201199 $options['postDefaults'] = array(
202200 'returnTitle' => true,
203201 'returnTo' => 'http://' . TESTS_HOSTNAME . '/index.php/Special:GlobalCollectGatewayResult',
204202 );
205203
206204 $amount = 350;
207 -
 205+
208206 $options['testData'] = array(
209207 'amount' => $amount,
210208 'transaction_type' => $transactionType,
@@ -239,10 +237,10 @@
240238 'owa_ref' => 'http://localhost/defaultTestData',
241239 'transaction_type' => '', // Used by GlobalCollect for payment types
242240 );
243 -
 241+
244242 $gateway = new GlobalCollectAdapter( $options );
245243 $result = $gateway->do_transaction( $transactionType );
246 -
 244+
247245 $this->assertTrue( $result );
248246 }
249247 }
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
@@ -7,7 +7,7 @@
88 */
99 public function __construct() {
1010 $this->adapter = new PayflowProAdapter();
11 - parent::__construct(); //the next layer up will know who we are.
 11+ parent::__construct(); //the next layer up will know who we are.
1212 }
1313
1414 /**
@@ -16,8 +16,7 @@
1717 * @param $par Mixed: parameter passed to the page or null
1818 */
1919 public function execute( $par ) {
20 - global $wgRequest, $wgOut, $wgExtensionAssetsPath;
21 - $CSSVersion = $this->adapter->getGlobal( 'CSSVersion' );
 20+ global $wgRequest, $wgOut;
2221
2322 // Hide unneeded interface elements
2423 $wgOut->addModules( 'donationInterface.skinOverride' );
@@ -25,7 +24,7 @@
2625 $gateway_id = $this->adapter->getIdentifier();
2726
2827 $this->addErrorMessageScript();
29 -
 28+
3029 $this->setHeaders();
3130
3231 /**
@@ -38,8 +37,8 @@
3938 $this->paypalRedirect();
4039 return;
4140 }
42 - //TODO: This is short-circuiting what I really want to do here.
43 - //so stop it.
 41+ //TODO: This is short-circuiting what I really want to do here.
 42+ //so stop it.
4443 $data = $this->adapter->getDisplayData();
4544
4645 // dispatch forms/handling
@@ -179,8 +178,8 @@
180179 * @param $responseMsg String: message supplied by getResults function
181180 */
182181 function fnPayflowDisplayOtherResults( $responseMsg ) {
183 - //I have collapsed it like this because the contents were identical.
184 - //TODO: Determine if we need to be switching on anything else in the display here.
 182+ //I have collapsed it like this because the contents were identical.
 183+ //TODO: Determine if we need to be switching on anything else in the display here.
185184 $this->fnPayflowDisplayDeclinedResults( $responseMsg );
186185 }
187186
@@ -195,8 +194,8 @@
196195 }
197196
198197 //TODO: Remember why the heck I decided to leave this here...
199 - //arguably, it's because it's slightly more "view" related, but... still, shouldn't you get stashed
200 - //in the new GatewayForm class so we can override in children if we feel like it? Odd.
 198+ //arguably, it's because it's slightly more "view" related, but... still, shouldn't you get stashed
 199+ //in the new GatewayForm class so we can override in children if we feel like it? Odd.
201200 function addErrorMessageScript() {
202201 global $wgOut;
203202 $gateway_id = $this->adapter->getIdentifier();
Index: trunk/extensions/DonationInterface/extras/recaptcha/recaptcha.body.php
@@ -19,8 +19,8 @@
2020 public function __construct( &$gateway_adapter ) {
2121 parent::__construct( $gateway_adapter );
2222
23 - //stash all the vars that reCaptcha is going to need in a global just for it.
24 - //I know this is vaguely unpleasant, but it's the quickest way back to zero.
 23+ //stash all the vars that reCaptcha is going to need in a global just for it.
 24+ //I know this is vaguely unpleasant, but it's the quickest way back to zero.
2525 global $wgReCaptchaConfData;
2626 $wgReCaptchaConfData['UseHTTPProxy'] = $this->gateway_adapter->getGlobal( 'RecaptchaUseHTTPProxy' );
2727 $wgReCaptchaConfData['HTTPProxy'] = $this->gateway_adapter->getGlobal( 'RecaptchaHTTPProxy' );
@@ -74,12 +74,12 @@
7575 // load up the form class
7676 $form_class = $this->gateway_adapter->getFormClass();
7777
78 - //hmm. Looking at this now, makes me want to say
 78+ //hmm. Looking at this now, makes me want to say
7979 //TODO: Refactor the Form Class constructors. Again. Because the next three lines of code anger me deeply.
80 - //#1 - all three things are clearly in the gateway adapter, and we're passing that already.
81 - //#2 - I have to stuff them in variables because Form wants parameters by reference.
 80+ //#1 - all three things are clearly in the gateway adapter, and we're passing that already.
 81+ //#2 - I have to stuff them in variables because Form wants parameters by reference.
8282 $data = $this->gateway_adapter->getData();
83 - $erros = $this->gateway_adapter->getValidationErrors();
 83+ $errors = $this->gateway_adapter->getValidationErrors();
8484 $form_obj = new $form_class( $data, $errors, $this->gateway_adapter );
8585
8686 // set the captcha HTML to use in the form
Index: trunk/extensions/DonationInterface/gateway_forms/TwoStepAmount.php
@@ -24,19 +24,17 @@
2525 class Gateway_Form_TwoStepAmount extends Gateway_Form {
2626
2727 public function __construct( &$form_data, &$form_errors, &$gateway ) {
28 - global $wgOut;
29 -
3028 $form_data['payment_method'] = 'bt';
3129 $form_data['payment_submethod'] = 'bt';
32 -
 30+
3331 //$form_data['payment_method'] = 'rtbt';
3432 //$form_data['payment_submethod'] = 'rtbt_nordea_sweeden';
35 -
 33+
3634 //$form_data['payment_method'] = 'rtbt';
3735 //$form_data['payment_submethod'] = 'rtbt_ideal';
3836 //$form_data['issuerids'] = array();
39 -
40 -
 37+
 38+
4139 $form_data['process'] = 'other';
4240 parent::__construct( $form_data, $form_errors, $gateway );
4341
@@ -83,7 +81,7 @@
8482 output += payflowproGatewayErrorMsgJs + ' ' + currField + '.\\r\\n';
8583 }
8684 }
87 -
 85+
8886 if (document.getElementById('fname').value == '$first') {
8987 output += payflowproGatewayErrorMsgJs + ' first name.\\r\\n';
9088 }
@@ -102,7 +100,7 @@
103101 if( apos < 1 || dotpos-apos < 2 ) {
104102 output += payflowproGatewayErrorMsgEmail;
105103 }
106 -
 104+
107105 if( output ) {
108106 alert( output );
109107 return false;
@@ -114,7 +112,7 @@
115113 EOT;
116114 $wgOut->addHeadItem( 'placeholders', $js );
117115 }
118 -
 116+
119117 /**
120118 * Required method for constructing the entire form
121119 *
@@ -255,8 +253,6 @@
256254 }
257255
258256 protected function generatePaymentFields() {
259 - global $wgScriptPath;
260 -
261257 // amount
262258 $form = '<tr>';
263259 $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>';
Index: trunk/extensions/DonationInterface/gateway_forms/TwoColumnLetter7.php
@@ -1,7 +1,7 @@
22 <?php
33
44 class Gateway_Form_TwoColumnLetter7 extends Gateway_Form_OneStepTwoColumn {
5 -
 5+
66 public function __construct( &$form_data, &$form_errors, &$gateway ) {
77 global $wgScriptPath;
88
@@ -12,7 +12,7 @@
1313
1414 parent::__construct( $form_data, $form_errors, $gateway );
1515 }
16 -
 16+
1717 public function loadPlaceholders() {
1818 global $wgOut;
1919 // form placeholder values
@@ -73,7 +73,7 @@
7474 i,
7575 output = '',
7676 currField = '';
77 -
 77+
7878 var doCheck = true;
7979 if( typeof( document.payment.PaypalRedirect.value ) !== 'undefined' ) {
8080 if( document.payment.PaypalRedirect.value == 1 ) {
@@ -88,7 +88,7 @@
8989 output += payflowproGatewayErrorMsgJs + ' ' + currField + '.\\r\\n';
9090 }
9191 }
92 -
 92+
9393 if (document.getElementById('fname').value == '$first') {
9494 output += payflowproGatewayErrorMsgJs + ' first name.\\r\\n';
9595 }
@@ -104,16 +104,16 @@
105105 if (document.getElementById('zip').value == '$zip') {
106106 output += payflowproGatewayErrorMsgJs + ' zip code.\\r\\n';
107107 }
108 -
 108+
109109 // validate email address
110110 var apos = document.payment.emailAdd.value.indexOf("@");
111111 var dotpos = document.payment.emailAdd.value.lastIndexOf(".");
112 -
 112+
113113 if( apos < 1 || dotpos-apos < 2 ) {
114114 output += payflowproGatewayErrorMsgEmail;
115115 }
116116 }
117 -
 117+
118118 if( output ) {
119119 alert( output );
120120 return false;
@@ -192,7 +192,7 @@
193193 }
194194
195195 protected function generateBillingFields() {
196 - global $wgScriptPath, $wgRequest;
 196+ global $wgScriptPath;
197197 $scriptPath = "$wgScriptPath/extensions/DonationInterface/gateway_forms/includes";
198198
199199 $form = '';
@@ -202,7 +202,7 @@
203203 $form .= '<td style="text-align:center;" colspan="2"><big><b>' . wfMsg( 'payflowpro_gateway-paypal-button' ) . '</b></big><br/><a href="#" onclick="document.payment.PaypalRedirect.value=1;document.payment.submit();"><img src="' . $scriptPath . '/paypal.png"/></a></td>';
204204 $form .= '</tr>';
205205 */
206 -
 206+
207207 // amount
208208 $otherChecked = false;
209209 $amount = -1;
@@ -215,7 +215,7 @@
216216 $form .= '</tr>';
217217 $form .= '<tr>';
218218 $form .= '<td class="label"><div style="padding-top:4px;">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-amount' ), 'amount' ) . '</div></td>';
219 - $form .= '<td>' .
 219+ $form .= '<td>' .
220220 '<table cellspacing="3" cellpadding="0" border="0" style="margin-bottom:0.2em;"><tr>' .
221221 '<td>'.Xml::radio( 'amount', 20, $this->form_data['amount'] == 20, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$20 '.'</td>'.
222222 '<td>'.Xml::radio( 'amount', 35, $this->form_data['amount'] == 35, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$35 '.'</td>'.
@@ -229,7 +229,7 @@
230230 '</tr></table>' .
231231 '</td>';
232232 $form .= '</tr>';
233 -
 233+
234234 // email opt-in
235235 /*
236236 $email_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'email-opt' ] : true;
@@ -247,32 +247,32 @@
248248 // Payment type
249249 $form .= '<tr>';
250250 $form .= '<td class="label""><div style="padding-top:9px;">' . wfMsg( 'payflowpro_gateway-payment-type' ) . '</div></td>';
251 - $form .= '<td>' .
 251+ $form .= '<td>' .
252252 '<p style="border: 1px solid rgb(187, 187, 187); float: left; -moz-border-radius: 5px 5px 5px 5px; margin: 0 8px 0 0; padding: 5px 5px 5px 3px; white-space: nowrap;">'.
253253 Xml::radio( 'card_type', 'cc1', $this->form_data['card_type'] == 'cc1', array( 'id' => 'cc1radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-visa.png" ) ). '</label>' .
254254 '&#160;<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-mastercard.png" ) ). '</label>' .
255255 '&#160;<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-amex.png" ) ). '</label>' .
256 - '&#160;<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-discover.png" ) ). '</label>' .
 256+ '&#160;<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-discover.png" ) ). '</label>' .
257257 '</p>'.
258258 '<p style="border: 1px solid transparent; float: left; -moz-border-radius: 5px 5px 5px 5px; margin: 0; padding: 5px 5px 5px 3px; white-space: nowrap;">'.
259259 Xml::radio( 'card_type', 'pp', $this->form_data['card_type'] == 'pp', array( 'id' => 'ppradio', 'onclick' => 'switchToPayPal()' ) ) . '<label for="ppradio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-paypal.png" ) ) . '</label>' .
260260 '</p>'.
261261 '</td>';
262262 $form .= '</tr>';
263 -
 263+
264264 $form .= '</table>';
265 -
 265+
266266 if ( $this->form_data['card_type'] == 'cc1' || $this->form_data['card_type'] == 'cc2' || $this->form_data['card_type'] == 'cc3' || $this->form_data['card_type'] == 'cc4' ) {
267267 $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-cc' ) );
268268 } else {
269269 $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-cc', 'style' => 'display: none;' ) );
270270 }
271 -
 271+
272272 $form .= '<tr>';
273 - $form .= '<td colspan="2"><h3 class="cc_header">' . wfMsg( 'payflowpro_gateway-cc-form-header-personal' ) .
 273+ $form .= '<td colspan="2"><h3 class="cc_header">' . wfMsg( 'payflowpro_gateway-cc-form-header-personal' ) .
274274 Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/padlock.gif", 'style' => 'vertical-align:baseline;margin-left:8px;' ) ) . '</h3></td>';
275275 $form .= '</tr>';
276 -
 276+
277277 // card number
278278 $form .= $this->getCardNumberField();
279279
@@ -281,7 +281,7 @@
282282 $form .= '<td class="label">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-expiration' ), 'expiration' ) . '</td>';
283283 $form .= '<td>' . $this->generateExpiryMonthDropdown() . ' / ' . $this->generateExpiryYearDropdown() . '</td>';
284284 $form .= '</tr>';
285 -
 285+
286286 // cvv
287287 $form .= $this->getCvvField();
288288
@@ -331,7 +331,7 @@
332332 $form .= '<td>' . $this->generateCountryDropdown() . '</td>';
333333 $form .= '</tr>';
334334 */
335 -
 335+
336336 // email
337337 $form .= '<tr>';
338338 $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['emailAdd'] . '</span></td>';
@@ -358,7 +358,7 @@
359359
360360 public function generateFormSubmit() {
361361 global $wgScriptPath;
362 -
 362+
363363 // cc submit button
364364 if ( $this->form_data['card_type'] == 'cc1' || $this->form_data['card_type'] == 'cc2' || $this->form_data['card_type'] == 'cc3' || $this->form_data['card_type'] == 'cc4' ) {
365365 $form = Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit' ) );
@@ -372,7 +372,7 @@
373373 Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/padlock.gif", 'style' => 'vertical-align:baseline;margin-right:4px;' ) ) . 'Your donation will be securely processed.';
374374 $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-donate-submessage
375375 $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-form-submit
376 -
 376+
377377 // paypal submit button
378378 if ( $this->form_data['card_type'] == 'cc1' || $this->form_data['card_type'] == 'cc2' || $this->form_data['card_type'] == 'cc3' || $this->form_data['card_type'] == 'cc4' ) {
379379 $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit-paypal', 'style' => 'display: none;' ) );
@@ -410,9 +410,7 @@
411411 }
412412
413413 public function generateDonationFooter() {
414 - global $wgScriptPath;
415 - $form = '';
416 - $form .= Xml::openElement( 'div', array( 'class' => 'payflow-cc-form-section', 'id' => 'payflowpro_gateway-donate-addl-info' ) );
 414+ $form = Xml::openElement( 'div', array( 'class' => 'payflow-cc-form-section', 'id' => 'payflowpro_gateway-donate-addl-info' ) );
417415 $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-donate-addl-info-text' ) );
418416 $form .= Xml::tags( 'div', array( 'style' => 'text-align:center;' ), '* * *' );
419417 $form .= Xml::tags( 'div', array( 'class' => '' ), wfMsg( 'payflowpro_gateway-credit-storage-processing' ) );
@@ -422,7 +420,7 @@
423421 $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-donate-addl-info
424422 return $form;
425423 }
426 -
 424+
427425 public function generateStateDropdown() {
428426 require_once( dirname( __FILE__ ) . '/../includes/stateAbbreviations.inc' );
429427
Index: trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremium.php
@@ -13,7 +13,7 @@
1414 }
1515
1616 public function generateFormStart() {
17 - global $wgOut, $wgRequest, $wgScriptPath;
 17+ global $wgRequest, $wgScriptPath;
1818
1919 $form = parent::generateBannerHeader();
2020
@@ -143,7 +143,7 @@
144144
145145 // country
146146 $form .= $this->getCountryField( $this->form_data[ 'country2' ] );
147 -
 147+
148148 /*
149149 $form .= '<tr>';
150150 $form .= '<td colspan="2"><span class="creditcard-error-msg"></span></td>';
@@ -151,7 +151,7 @@
152152 $form .= '<tr>';
153153 $form .= '<td colspan="2"><label for="shipping"><input id="shipping" name="shipping" type="checkbox" checked="checked"/> '.wfMsg( 'payflowpro_gateway-shipping-address-same' ).'</label></td>';
154154 $form .= '</tr>';
155 -
 155+
156156 $form .= '<tr>';
157157 $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['country2'] . '</span></td>';
158158 $form .= '</tr>';
@@ -174,7 +174,7 @@
175175 foreach ( $hidden_fields as $field => $value ) {
176176 $form .= Html::hidden( $field, $value );
177177 }
178 -
 178+
179179 // Temporary
180180 $form .= Html::hidden( 'country2', $this->form_data[ 'country2' ] );
181181
Index: trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumn.php
@@ -3,8 +3,6 @@
44 class Gateway_Form_TwoStepTwoColumn extends Gateway_Form {
55
66 public function __construct( &$form_data, &$form_errors, &$gateway ) {
7 - global $wgOut;
8 -
97 parent::__construct( $form_data, $form_errors, $gateway );
108 // load validation and placeholder JS
119 $this->loadValidateJs();
Index: trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter3.php
@@ -11,7 +11,7 @@
1212 $this->loadvalidateJs();
1313 parent::__construct( $form_data, $form_errors, $gateway );
1414 }
15 -
 15+
1616 public function loadPlaceholders() {
1717 global $wgOut;
1818 // form placeholder values
@@ -68,7 +68,7 @@
6969 output += payflowproGatewayErrorMsgJs + ' ' + currField + '.\\r\\n';
7070 }
7171 }
72 -
 72+
7373 if (document.getElementById('fname').value == '$first') {
7474 output += payflowproGatewayErrorMsgJs + ' first name.\\r\\n';
7575 }
@@ -84,7 +84,7 @@
8585 if (document.getElementById('zip').value == '$zip') {
8686 output += payflowproGatewayErrorMsgJs + ' zip code.\\r\\n';
8787 }
88 -
 88+
8989 var stateField = document.getElementById( 'state' );
9090 if( stateField.options[stateField.selectedIndex].value == '' ) {
9191 output += payflowproGatewayErrorMsgJs + ' ' + window['payflowproGatewayErrorMsgState'] + '.\\r\\n';
@@ -97,7 +97,7 @@
9898 if( apos < 1 || dotpos-apos < 2 ) {
9999 output += payflowproGatewayErrorMsgEmail;
100100 }
101 -
 101+
102102 if( output ) {
103103 alert( output );
104104 return false;
@@ -155,17 +155,17 @@
156156 $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-personal-info' ) );
157157 $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-donor' ) );
158158 $form .= $this->generateBillingFields();
159 -
 159+
160160 return $form;
161161 }
162 -
 162+
163163 public function generateFormSubmit() {
164164 global $wgScriptPath;
165 -
 165+
166166 $form = '<tr>';
167167 $form .= '<td class="label"> </td>';
168168 $form .= '<td>';
169 -
 169+
170170 // submit button
171171 $form .= Xml::openElement( 'div', array( 'id' => 'mw-donate-submit-button' ) );
172172 // $form .= Xml::submitButton( wfMsg( 'payflowpro_gateway-submit-button' ));
@@ -174,7 +174,7 @@
175175 $form .= Xml::openElement( 'div', array( 'class' => 'mw-donate-submessage', 'id' => 'payflowpro_gateway-donate-submessage' ) ) .
176176 Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/padlock.gif", 'style' => 'vertical-align:baseline;margin-right:4px;' ) ) . 'Your credit / debit card will be securely processed.';
177177 $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-donate-submessage
178 -
 178+
179179 $form .= '</td>';
180180 $form .= '</tr>';
181181 return $form;
@@ -192,7 +192,7 @@
193193 global $wgScriptPath;
194194
195195 $form = '';
196 -
 196+
197197 // amount
198198 $form .= '<tr>';
199199 $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>';
@@ -207,19 +207,19 @@
208208 $form .= '</tr>';
209209 $form .= '<tr>';
210210 $form .= '<td class="amount_data">'.wfMsg( 'payflowpro_gateway-donation' ).'</td>';
211 - $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->form_data['amount'] .
212 - Html::hidden( 'amount', $this->form_data['amount'] ) .
 211+ $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->form_data['amount'] .
 212+ Html::hidden( 'amount', $this->form_data['amount'] ) .
213213 '</td>';
214214 $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->form_data[ 'currency' ] .
215 - Html::hidden( 'currency_code', $this->form_data['currency'] ) .
 215+ Html::hidden( 'currency_code', $this->form_data['currency'] ) .
216216 '</td>';
217217 $form .= '</tr>';
218218 $form .= '</table>';
219219 $form .= '</td>';
220220 $form .= '</tr>';
221 -
 221+
222222 $form .= '<tr>';
223 - $form .= '<td colspan="2"><h3 class="cc_header">' . wfMsg( 'payflowpro_gateway-cc-form-header-personal' ) .
 223+ $form .= '<td colspan="2"><h3 class="cc_header">' . wfMsg( 'payflowpro_gateway-cc-form-header-personal' ) .
224224 Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/padlock.gif", 'style' => 'vertical-align:baseline;margin-left:8px;' ) ) . '</h3></td>';
225225 $form .= '</tr>';
226226
@@ -232,7 +232,7 @@
233233 $form .= '<td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos3.gif" ) ) . '</td>';
234234 }
235235 $form .= '</tr>';
236 -
 236+
237237 // card number
238238 $card_num = ( $this->gateway->getGlobal( "Test" ) ) ? $this->form_data[ 'card_num' ] : '';
239239 $form .= '';
@@ -257,7 +257,7 @@
258258 $form .= '<td class="label">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-expiration' ), 'expiration' ) . '</td>';
259259 $form .= '<td>' . $this->generateExpiryMonthDropdown() . ' / ' . $this->generateExpiryYearDropdown() . '</td>';
260260 $form .= '</tr>';
261 -
 261+
262262 // cvv
263263 $form .= $this->getCvvField();
264264
@@ -307,7 +307,7 @@
308308 $form .= '<td>' . $this->generateCountryDropdown() . '</td>';
309309 $form .= '</tr>';
310310 */
311 -
 311+
312312 // email
313313 $form .= '<tr>';
314314 $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['emailAdd'] . '</span></td>';
@@ -339,11 +339,9 @@
340340 $form .= Xml::closeElement( 'table' );
341341 return $form;
342342 }
343 -
 343+
344344 public function generateDonationFooter() {
345 - global $wgScriptPath;
346 - $form = '';
347 - $form .= Xml::openElement( 'div', array( 'class' => 'payflow-cc-form-section', 'id' => 'payflowpro_gateway-donate-addl-info' ) );
 345+ $form = Xml::openElement( 'div', array( 'class' => 'payflow-cc-form-section', 'id' => 'payflowpro_gateway-donate-addl-info' ) );
348346 $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-donate-addl-info-text' ) );
349347 $form .= Xml::tags( 'div', array( 'style' => 'text-align:center;' ), '* * *' );
350348 $form .= Xml::tags( 'div', array( 'class' => '' ), wfMsg( 'payflowpro_gateway-credit-storage-processing' ) );
@@ -353,7 +351,7 @@
354352 $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-donate-addl-info
355353 return $form;
356354 }
357 -
 355+
358356 public function generateStateDropdown() {
359357 require_once( dirname( __FILE__ ) . '/includes/stateAbbreviations.inc' );
360358
Index: trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremiumUS.php
@@ -11,7 +11,7 @@
1212
1313 parent::__construct( $form_data, $form_errors, $gateway );
1414 }
15 -
 15+
1616 public function loadPlaceholders() {
1717 global $wgOut;
1818 // form placeholder values
@@ -72,7 +72,7 @@
7373 output += payflowproGatewayErrorMsgJs + ' ' + currField + '.\\r\\n';
7474 }
7575 }
76 -
 76+
7777 if (document.getElementById('fname').value == '$first') {
7878 output += payflowproGatewayErrorMsgJs + ' first name.\\r\\n';
7979 }
@@ -88,7 +88,7 @@
8989 if (document.getElementById('zip').value == '$zip') {
9090 output += payflowproGatewayErrorMsgJs + ' zip code.\\r\\n';
9191 }
92 -
 92+
9393 var stateField = document.getElementById( 'state' );
9494 if( stateField.options[stateField.selectedIndex].value == '' ) {
9595 output += payflowproGatewayErrorMsgJs + ' ' + window['payflowproGatewayErrorMsgState'] + '.\\r\\n';
@@ -101,7 +101,7 @@
102102 if( apos < 1 || dotpos-apos < 2 ) {
103103 output += payflowproGatewayErrorMsgEmail;
104104 }
105 -
 105+
106106 if( output ) {
107107 alert( output );
108108 return false;
@@ -113,7 +113,7 @@
114114 }
115115
116116 public function generateFormStart() {
117 - global $wgOut, $wgRequest, $wgScriptPath;
 117+ global $wgRequest, $wgScriptPath;
118118
119119 $form = parent::generateBannerHeader();
120120
@@ -177,7 +177,7 @@
178178 global $wgScriptPath;
179179
180180 $form = '';
181 -
 181+
182182 // amount
183183 $form .= '<tr>';
184184 $form .= '<td colspan="2">';
@@ -189,19 +189,19 @@
190190 $form .= '</tr>';
191191 $form .= '<tr>';
192192 $form .= '<td class="amount_data">'.wfMsg( 'payflowpro_gateway-donation' ).'</td>';
193 - $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->form_data['amount'] .
194 - Html::hidden( 'amount', $this->form_data['amount'] ) .
 193+ $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->form_data['amount'] .
 194+ Html::hidden( 'amount', $this->form_data['amount'] ) .
195195 '</td>';
196196 $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->form_data[ 'currency' ] .
197 - Html::hidden( 'currency_code', $this->form_data['currency'] ) .
 197+ Html::hidden( 'currency_code', $this->form_data['currency'] ) .
198198 '</td>';
199199 $form .= '</tr>';
200200 $form .= '</table>';
201201 $form .= '</td>';
202202 $form .= '</tr>';
203 -
 203+
204204 $form .= '<tr>';
205 - $form .= '<td colspan="2"><h3 class="cc_header">' . wfMsg( 'payflowpro_gateway-cc-form-header-personal' ) .
 205+ $form .= '<td colspan="2"><h3 class="cc_header">' . wfMsg( 'payflowpro_gateway-cc-form-header-personal' ) .
206206 Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/padlock.gif", 'style' => 'vertical-align:baseline;margin-left:8px;' ) ) . '</h3></td>';
207207 $form .= '</tr>';
208208
@@ -214,7 +214,7 @@
215215 $form .= '<td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos3.gif" ) ) . '</td>';
216216 }
217217 $form .= '</tr>';
218 -
 218+
219219 // card number
220220 $card_num = ( $this->gateway->getGlobal( "Test" ) ) ? $this->form_data[ 'card_num' ] : '';
221221 $form .= '';
@@ -239,7 +239,7 @@
240240 $form .= '<td class="label">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-expiration' ), 'expiration' ) . '</td>';
241241 $form .= '<td>' . $this->generateExpiryMonthDropdown() . ' / ' . $this->generateExpiryYearDropdown() . '</td>';
242242 $form .= '</tr>';
243 -
 243+
244244 // cvv
245245 $form .= $this->getCvvField();
246246
@@ -287,7 +287,7 @@
288288 $form .= '<td class="label"> </td>';
289289 $form .= '<td>' . $this->generateCountryDropdown( $this->form_data['country2'] ) . '</td>';
290290 $form .= '</tr>';
291 -
 291+
292292 // email
293293 $form .= '<tr>';
294294 $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['emailAdd'] . '</span></td>';
@@ -319,11 +319,9 @@
320320 $form .= Xml::closeElement( 'table' );
321321 return $form;
322322 }
323 -
 323+
324324 public function generateDonationFooter() {
325 - global $wgScriptPath;
326 - $form = '';
327 - $form .= Xml::openElement( 'div', array( 'class' => 'payflow-cc-form-section', 'id' => 'payflowpro_gateway-donate-addl-info' ) );
 325+ $form = Xml::openElement( 'div', array( 'class' => 'payflow-cc-form-section', 'id' => 'payflowpro_gateway-donate-addl-info' ) );
328326 $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-donate-addl-info-text' ) );
329327 $form .= Xml::tags( 'div', array( 'style' => 'text-align:center;' ), '* * *' );
330328 $form .= Xml::tags( 'div', array( 'class' => '' ), wfMsg( 'payflowpro_gateway-credit-storage-processing' ) );
@@ -333,7 +331,7 @@
334332 $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-donate-addl-info
335333 return $form;
336334 }
337 -
 335+
338336 public function generateStateDropdown() {
339337 require_once( dirname( __FILE__ ) . '/../includes/stateAbbreviations.inc' );
340338
Index: trunk/extensions/DonationInterface/gateway_forms/OneStepTwoColumn.php
@@ -4,8 +4,6 @@
55 public $paypal = false; // true for paypal only version
66
77 public function __construct( &$form_data, &$form_errors, &$gateway ) {
8 - global $wgOut;
9 -
108 parent::__construct( $form_data, $form_errors, $gateway );
119
1210 // update the list of hidden fields we need to use in this form.
@@ -18,7 +16,7 @@
1917
2018 $this->loadPlaceholders();
2119 }
22 -
 20+
2321 public function loadPlaceholders() {
2422 global $wgOut;
2523 // form placeholder values
@@ -55,14 +53,14 @@
5654 i,
5755 output = '',
5856 currField = '';
59 -
 57+
6058 var doCheck = true;
6159 if( typeof( document.payment.PaypalRedirect.value ) !== 'undefined' ) {
6260 if( document.payment.PaypalRedirect.value == 1 ) {
6361 doCheck = false;
6462 }
6563 }
66 -
 64+
6765 if( doCheck ) {
6866 for( i = 0; i < numFields; i++ ) {
6967 if( document.getElementById( fields[i] ).value == '' ) {
@@ -70,23 +68,23 @@
7169 output += payflowproGatewayErrorMsgJs + ' ' + currField + '.\\r\\n';
7270 }
7371 }
74 -
 72+
7573 if (document.getElementById('fname').value == '$first') {
7674 output += payflowproGatewayErrorMsgJs + ' first name.\\r\\n';
7775 }
7876 if (document.getElementById('lname').value == '$last') {
7977 output += payflowproGatewayErrorMsgJs + ' last name.\\r\\n';
8078 }
81 -
 79+
8280 // validate email address
8381 var apos = document.payment.emailAdd.value.indexOf("@");
8482 var dotpos = document.payment.emailAdd.value.lastIndexOf(".");
85 -
 83+
8684 if( apos < 1 || dotpos-apos < 2 ) {
8785 output += payflowproGatewayErrorMsgEmail;
8886 }
8987 }
90 -
 88+
9189 if( output ) {
9290 alert( output );
9391 return false;
Index: trunk/extensions/DonationInterface/gateway_common/donation.api.php
@@ -7,12 +7,10 @@
88 class DonationApi extends ApiBase {
99 var $donationData, $gateway;
1010 public function execute() {
11 - global $wgRequest, $wgParser;
12 -
1311 $this->donationData = $this->extractRequestParams();
14 -
 12+
1513 $this->gateway = $this->donationData['gateway'];
16 -
 14+
1715 // If you want to test with fake data, pass a 'test' param set to true.
1816 // You still have to set the gateway you are testing though.
1917 // It looks like this only works if the Test global variable for that gateway is true.
@@ -21,9 +19,9 @@
2220 } else {
2321 // If we need to do any local data munging do it here.
2422 }
25 -
 23+
2624 $method = $this->donationData['payment_method'];
27 -
 25+
2826 if ( $this->gateway == 'payflowpro' ) {
2927 $gatewayObj = new PayflowProAdapter();
3028 switch ( $method ) {
@@ -44,12 +42,12 @@
4543 } else {
4644 $this->dieUsage( "Invalid gateway <<<$gateway>>> passed to Donation API.", 'unknown_gateway' );
4745 }
48 -
 46+
4947 //$normalizedData = $gatewayObj->getData();
5048 $outputResult = array();
5149 $outputResult['message'] = $result['message'];
5250 $outputResult['status'] = $result['status'];
53 -
 51+
5452 if ( array_key_exists( 'data', $result ) ) {
5553 if ( array_key_exists( 'PAYMENT', $result['data'] )
5654 && array_key_exists( 'RETURNURL', $result['data']['PAYMENT'] ) )
@@ -66,12 +64,12 @@
6765 if ( $result['errors'] ) {
6866 $outputResult['errors'] = $result['errors'];
6967 }
70 -
 68+
7169 if ( $this->donationData ) {
7270 $this->getResult()->addValue( null, 'request', $this->donationData );
7371 }
7472 $this->getResult()->addValue( null, 'result', $outputResult );
75 -
 73+
7674 /*
7775 $this->getResult()->setIndexedTagName( $result, 'response' );
7876 $this->getResult()->addValue( 'data', 'result', $result );
@@ -101,7 +99,7 @@
102100 'language' => $this->defineParam( false ),
103101 );
104102 }
105 -
 103+
106104 private function defineParam( $required = false, $type = 'string' ) {
107105 if ( $required ) {
108106 $param = array( ApiBase::PARAM_TYPE => $type, ApiBase::PARAM_REQUIRED => true );
@@ -110,7 +108,7 @@
111109 }
112110 return $param;
113111 }
114 -
 112+
115113 private function populateTestData() {
116114 $this->donationData = array(
117115 'gateway' => $this->gateway,
Index: trunk/extensions/DonationInterface/gateway_common/DonationData.php
@@ -25,7 +25,7 @@
2626 $this->populateData_Test( $testdata );
2727 } else {
2828 $this->normalized = array(
29 - 'posted' => 'true', //moderately sneaky.
 29+ 'posted' => 'true', //moderately sneaky.
3030 'amount' => $wgRequest->getText( 'amount', null ),
3131 'amountGiven' => $wgRequest->getText( 'amountGiven', null ),
3232 'amountOther' => $wgRequest->getText( 'amountOther', null ),
@@ -71,7 +71,7 @@
7272 'comment-option' => $wgRequest->getText( 'comment-option' ),
7373 'comment' => $wgRequest->getText( 'comment' ),
7474 'email-opt' => $wgRequest->getText( 'email-opt' ),
75 - // test_string has been disabled - may no longer be needed.
 75+ // test_string has been disabled - may no longer be needed.
7676 //'test_string' => $wgRequest->getText( 'process' ), // for showing payflow string during testing
7777 '_cache_' => $wgRequest->getText( '_cache_', null ),
7878 'token' => $wgRequest->getText( 'token', null ),
@@ -163,7 +163,7 @@
164164 'comment-option' => $wgRequest->getText( 'comment-option' ),
165165 'comment' => $wgRequest->getText( 'comment' ),
166166 'email-opt' => $wgRequest->getText( 'email-opt' ),
167 - // test_string has been disabled - may no longer be needed.
 167+ // test_string has been disabled - may no longer be needed.
168168 //'test_string' => $wgRequest->getText( 'process' ),
169169 'token' => '',
170170 'contribution_tracking_id' => $wgRequest->getText( 'contribution_tracking_id' ),
@@ -228,17 +228,17 @@
229229 }
230230
231231 function setOwaRefId() {
232 - //Our data should already be pulled and whatever.
 232+ //Our data should already be pulled and whatever.
233233 if ( $this->isSomething( 'owa_ref' ) && !is_numeric( $this->normalized['owa_ref'] ) ) {
234234 $owa_ref = $this->get_owa_ref_id( $owa_ref );
235235 }
236236 }
237237
238238 function setNormalizedOrderIDs() {
239 - //basically, we need a new order_id every time we come through here, but if there's an internal already there,
240 - //we want to use that one internally. So.
241 - //Exception: If we pass in an order ID in the querystring: Don't mess with it.
242 - //TODO: I'm pretty sure I'm not supposed to do this directly.
 239+ //basically, we need a new order_id every time we come through here, but if there's an internal already there,
 240+ //we want to use that one internally. So.
 241+ //Exception: If we pass in an order ID in the querystring: Don't mess with it.
 242+ //TODO: I'm pretty sure I'm not supposed to do this directly.
243243 if ( array_key_exists( 'order_id', $_GET ) ) {
244244 $this->setVal( 'order_id', $_GET['order_id'] );
245245 $this->setVal( 'i_order_id', $_GET['order_id'] );
@@ -252,7 +252,7 @@
253253 }
254254
255255 /**
256 - * Generate an order id exactly once for this go-round.
 256+ * Generate an order id exactly once for this go-round.
257257 */
258258 function generateOrderId() {
259259 static $order_id = null;
@@ -264,9 +264,9 @@
265265
266266 /**
267267 * Sanitize user input
268 - *
 268+ *
269269 * Intended to be used with something like array_walk
270 - *
 270+ *
271271 * @param $value The value of the array
272272 * @param $key The key of the array
273273 * @param $flags The flag constant for htmlspecialchars
@@ -282,7 +282,7 @@
283283 $c::log( $message, $log_level );
284284 }
285285 }
286 -
 286+
287287 function getGatewayIdentifier() {
288288 $c = $this->getAdapterClass();
289289 if ( $c && is_callable( array( $c, 'getIdentifier' ) ) ){
@@ -291,7 +291,7 @@
292292 return 'DonationData';
293293 }
294294 }
295 -
 295+
296296 function getGatewayGlobal( $varname ) {
297297 $c = $this->getAdapterClass();
298298 if ( $c && is_callable( array( $c, 'getGlobal' ) ) ){
@@ -308,13 +308,11 @@
309309 }
310310
311311 function doCacheStuff() {
312 - //TODO: Wow, name.
313 - global $wgRequest;
314 -
 312+ //TODO: Wow, name.
315313 // if _cache_ is requested by the user, do not set a session/token; dynamic data will be loaded via ajax
316314 if ( $this->isSomething( '_cache_' ) ) {
317315 self::log( $this->getAnnoyingOrderIDLogLinePrefix() . ' Cache requested', LOG_DEBUG );
318 - $this->cache = true; //TODO: If we don't need this, kill it in the face.
 316+ $this->cache = true; //TODO: If we don't need this, kill it in the face.
319317 $this->setVal( 'token', 'cache' );
320318
321319 // if we have squid caching enabled, set the maxage
@@ -326,12 +324,12 @@
327325 $wgOut->setSquidMaxage( $maxAge );
328326 }
329327 } else {
330 - $this->cache = false; //TODO: Kill this one in the face, too. (see above)
 328+ $this->cache = false; //TODO: Kill this one in the face, too. (see above)
331329 }
332330 }
333331
334332 function getAnnoyingOrderIDLogLinePrefix() {
335 - //TODO: ...aww. But it's so descriptive.
 333+ //TODO: ...aww. But it's so descriptive.
336334 return $this->getVal( 'order_id' ) . ' ' . $this->getVal( 'i_order_id' ) . ': ';
337335 }
338336
@@ -403,7 +401,7 @@
404402 */
405403 function unsetEditToken() {
406404 $gateway_ident = $this->gatewayID;
407 -
 405+
408406 if ( isset( $_SESSION ) && isset( $_SESSION[$gateway_ident . 'EditToken'] ) ){
409407 unset( $_SESSION[$gateway_ident . 'EditToken'] );
410408 }
@@ -440,7 +438,7 @@
441439 $this->log( $this->getAnnoyingOrderIDLogLinePrefix() . ' editToken: ' . $token, LOG_DEBUG );
442440
443441 // match token
444 - $token_check = ( $this->isSomething( 'token' ) ) ? $this->getVal( 'token' ) : $token; //TODO: does this suck as much as it looks like it does?
 442+ $token_check = ( $this->isSomething( 'token' ) ) ? $this->getVal( 'token' ) : $token; //TODO: does this suck as much as it looks like it does?
445443 $match = $this->matchEditToken( $token_check, $salt );
446444 if ( $wgRequest->wasPosted() ) {
447445 $this->log( $this->getAnnoyingOrderIDLogLinePrefix() . ' Submitted edit token: ' . $this->getVal( 'token' ), LOG_DEBUG );
@@ -522,8 +520,8 @@
523521 * because the form elements for comment anonymization and email opt-out
524522 * are backwards (they are really opt-in) relative to contribution_tracking
525523 * (which is opt-out), we need to reverse the values.
526 - * NOTE: If you prune here, and there is a paypal redirect, you will have
527 - * problems with the email-opt/optout and comment-option/anonymous.
 524+ * NOTE: If you prune here, and there is a paypal redirect, you will have
 525+ * problems with the email-opt/optout and comment-option/anonymous.
528526 */
529527 function setNormalizedOptOuts( $prune = false ) {
530528 $optout['optout'] = ( $this->isSomething( 'email-opt' ) && $this->getVal( 'email-opt' ) == "1" ) ? '0' : '1';
@@ -543,7 +541,7 @@
544542 * Compares tracking data array to list of valid tracking fields and
545543 * removes any extra tracking fields/data. Also sets empty values to
546544 * 'null' values.
547 - * @param bool $clean_opouts
 545+ * @param bool $clean_opouts
548546 */
549547 public function getCleanTrackingData() {
550548
@@ -572,7 +570,7 @@
573571 }
574572
575573 //if ( !empty($data) && ( $data[ 'numAttempt' ] == '0' && ( !$wgRequest->getText( 'utm_source_id', false ) || $wgRequest->getText( '_nocache_' ) == 'true' ) ) ) {
576 - //so, basically, if this is the first attempt. This seems to get called nowhere else.
 574+ //so, basically, if this is the first attempt. This seems to get called nowhere else.
577575 function saveContributionTracking() {
578576
579577 $tracked_contribution = $this->getCleanTrackingData();
@@ -620,9 +618,9 @@
621619 * @param array $data Form data
622620 * @param bool $force If set to true, will ensure that contribution tracking is updated
623621 */
624 - //Looks like two places: Either right before a paypal redirect (if that's still a thing) or
625 - //just prior to curling something up to some server somewhere.
626 - //I took care of the one just prior to curling.
 622+ //Looks like two places: Either right before a paypal redirect (if that's still a thing) or
 623+ //just prior to curling something up to some server somewhere.
 624+ //I took care of the one just prior to curling.
627625 public function updateContributionTracking( $force = false ) {
628626 // ony update contrib tracking if we're coming from a single-step landing page
629627 // which we know with cc# in utm_source or if force=true or if contribution_tracking_id is not set
@@ -678,9 +676,9 @@
679677 }
680678
681679 /**
682 - * TODO: Consider putting all the session data for a gateway under something like
 680+ * TODO: Consider putting all the session data for a gateway under something like
683681 * $_SESSION[$gateway_identifier]
684 - * so we can kill it all with one stroke.
 682+ * so we can kill it all with one stroke.
685683 */
686684 public function unsetAllDDSessionData() {
687685 unset( $_SESSION['Donor'] );
@@ -709,7 +707,7 @@
710708 }
711709 }
712710 }
713 -
 711+
714712 function getAdapterClass(){
715713 if ( class_exists( $this->boss ) ) {
716714 return $this->boss;
Index: trunk/extensions/DonationInterface/gateway_common/GatewayForm.php
@@ -72,7 +72,7 @@
7373 $me = get_called_class();
7474 parent::__construct( $me );
7575 $this->errors = $this->getPossibleErrors();
76 - $this->setFormClass();
 76+ $this->setFormClass();
7777 }
7878
7979 /**
@@ -84,7 +84,7 @@
8585 * @param array $error Reference to the error messages of the form
8686 * @param array $options
8787 * OPTIONAL - You may require certain field groups to be validated
88 - * - address - Validates: street, city, state, zip
 88+ * - address - Validates: street, city, state, zip
8989 * - amount - Validates: amount
9090 * - creditCard - Validates: card_num, cvv, expiration and sets the card
9191 * - email - Validates: email
@@ -313,7 +313,7 @@
314314 * The message at the top of the form can be edited in the payflow_gateway.i18n.php file
315315 */
316316 public function displayForm( &$data, &$error ) {
317 - global $wgOut, $wgRequest;
 317+ global $wgOut;
318318
319319 $form_class = $this->getFormClass();
320320 $form_obj = new $form_class( $data, $error, $this->adapter );
@@ -344,7 +344,7 @@
345345 }
346346 $this->form_class = $class_name;
347347
348 - //this should... maybe replace the other thing? I need it in the adapter so reCaptcha can get to it.
 348+ //this should... maybe replace the other thing? I need it in the adapter so reCaptcha can get to it.
349349 $this->adapter->setFormClass( $class_name );
350350 }
351351
@@ -436,17 +436,17 @@
437437
438438 /**
439439 * Convert an amount for a particular currency to an amount in USD
440 - *
 440+ *
441441 * This is grosley rudimentary and likely wildly inaccurate.
442442 * This mimicks the hard-coded values used by the WMF to convert currencies
443443 * for validatoin on the front-end on the first step landing pages of their
444444 * donation process - the idea being that we can get a close approximation
445445 * of converted currencies to ensure that contributors are not going above
446446 * or below the price ceiling/floor, even if they are using a non-US currency.
447 - *
 447+ *
448448 * In reality, this probably ought to use some sort of webservice to get real-time
449449 * conversion rates.
450 - *
 450+ *
451451 * @param $currency_code
452452 * @param $amount
453453 * @return unknown_type

Status & tagging log