r102311 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102310‎ | r102311 | r102312 >
Date:19:28, 7 November 2011
Author:awjrichards
Status:ok
Tags:fundraising 
Comment:
Modified paths:
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/DonationData.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/donation.api.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/RapidHtml.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/html/bt/bt-CA.html (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/html/bt/bt-US.html (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/html/bt/bt.html (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/html/lightbox1.html (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/html/webitects2nd.html (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/html/webitects_2_3step-CA.html (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/html/webitects_2_3step.html (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects.js (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/forms (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/forms/html/lightbox1.html (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/forms/js/lightbox1.js (modified) (history)

Diff [purge]

Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/forms/html/lightbox1.html
@@ -108,7 +108,7 @@
109109 <input type="hidden" value="@amount" name="amount" />
110110 <input type="hidden" value="@country" name="country" id="country" />
111111 <input type="hidden" value="@expiration" name="expiration" />
112 - <input type="hidden" value="@currency_code" name="currency" />
 112+ <input type="hidden" value="@currency_code" name="currency_code" />
113113 <input type="hidden" value="@utm_source" name="utm_source"/>
114114 <input type="hidden" value="@utm_medium" name="utm_medium"/>
115115 <input type="hidden" value="@utm_campaign" name="utm_campaign"/>
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/forms/js/lightbox1.js
@@ -153,7 +153,7 @@
154154 var sendData = {
155155 'action': 'donate',
156156 'gateway': 'payflowpro',
157 - 'currency': 'USD',
 157+ 'currency_code': 'USD',
158158 'amount': $( "input[name='amount']" ).val(),
159159 'fname': $( "input[name='fname']" ).val(),
160160 'lname': $( "input[name='lname']" ).val(),
@@ -234,7 +234,7 @@
235235 error = ( amount == null || isNaN( amount ) || amount.value <= 0 );
236236 // Check amount is at least the minimum
237237 var currency = 'USD'; // hard-coded for these forms and tests
238 - $( "input[name='currency']" ).val( currency );
 238+ $( "input[name='currency_code']" ).val( currency );
239239 if ( typeof( wgCurrencyMinimums[currency] ) == 'undefined' ) {
240240 wgCurrencyMinimums[currency] = 1;
241241 }
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/forms
___________________________________________________________________
Modified: svn:mergeinfo
242242 Merged /trunk/extensions/DonationInterface/payflowpro_gateway/forms:r102307
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway
___________________________________________________________________
Modified: svn:mergeinfo
243243 Merged /trunk/extensions/DonationInterface/payflowpro_gateway:r102307
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/RapidHtml.php
@@ -156,8 +156,8 @@
157157
158158 // handle the appeal and appeal header
159159 // TODO: determine and set variables for the default templates
160 - $appeal_title_name = $this->make_safe( $wgRequest->getText( 'appeal-title', 'jimmy-appeal-title' ) );
161 - $appeal_name = $this->make_safe( $wgRequest->getText( 'appeal', 'jimmy-appeal' ) );
 160+ $appeal_title_name = $this->make_safe( $wgRequest->getText( 'appeal-title', 'Appeal-default' ) );
 161+ $appeal_name = $this->make_safe( $wgRequest->getText( 'appeal', 'Appeal-default' ) );
162162
163163 $form = str_replace( "@appeal-title", $appeal_title_name, $form );
164164 $form = str_replace( "@appeal", $appeal_name, $form );
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms
___________________________________________________________________
Modified: svn:mergeinfo
165165 Merged /trunk/extensions/DonationInterface/gateway_forms:r102308
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/html/webitects2nd.html
@@ -31,8 +31,8 @@
3232 <td>
3333 <div id="appeal">
3434 <div id="appeal-content">
35 - <h2 id="appeal-head"> <span class="mw-headline">{{LanguageSwitch|2011FR/@appeal-title|@language}}</span></h2>
36 - <div id="appeal-body" class="plainlinks">{{LanguageSwitch|2011FR/@appeal|@language}}</div>
 35+ <h2 id="appeal-head"> <span class="mw-headline">{{LanguageSwitch|2011FR/@appeal/title|@language}}</span></h2>
 36+ <div id="appeal-body" class="plainlinks">{{LanguageSwitch|2011FR/@appeal/text|@language}}</div>
3737 </div>
3838 </div>
3939 </td>
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/html/lightbox1.html
@@ -108,7 +108,7 @@
109109 <input type="hidden" value="@amount" name="amount" />
110110 <input type="hidden" value="@country" name="country" id="country" />
111111 <input type="hidden" value="@expiration" name="expiration" />
112 - <input type="hidden" value="@currency_code" name="currency" />
 112+ <input type="hidden" value="@currency_code" name="currency_code" />
113113 <input type="hidden" value="@utm_source" name="utm_source"/>
114114 <input type="hidden" value="@utm_medium" name="utm_medium"/>
115115 <input type="hidden" value="@utm_campaign" name="utm_campaign"/>
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/html/bt/bt.html
@@ -31,8 +31,8 @@
3232 <td>
3333 <div id="appeal">
3434 <div id="appeal-content">
35 - <h2 id="appeal-head"> <span class="mw-headline">{{LanguageSwitch|2011FR/@appeal-title|@language}}</span></h2>
36 - <div id="appeal-body" class="plainlinks">{{LanguageSwitch|2011FR/@appeal|@language}}</div>
 35+ <h2 id="appeal-head"> <span class="mw-headline">{{LanguageSwitch|2011FR/@appeal/title|@language}}</span></h2>
 36+ <div id="appeal-body" class="plainlinks">{{LanguageSwitch|2011FR/@appeal/text|@language}}</div>
3737 </div>
3838 </div>
3939 </td>
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/html/bt/bt-CA.html
@@ -31,8 +31,8 @@
3232 <td>
3333 <div id="appeal">
3434 <div id="appeal-content">
35 - <h2 id="appeal-head"> <span class="mw-headline">{{LanguageSwitch|2011FR/@appeal-title|@language}}</span></h2>
36 - <div id="appeal-body" class="plainlinks">{{LanguageSwitch|2011FR/@appeal|@language}}</div>
 35+ <h2 id="appeal-head"> <span class="mw-headline">{{LanguageSwitch|2011FR/@appeal/title|@language}}</span></h2>
 36+ <div id="appeal-body" class="plainlinks">{{LanguageSwitch|2011FR/@appeal/text|@language}}</div>
3737 </div>
3838 </div>
3939 </td>
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/html/bt/bt-US.html
@@ -31,8 +31,8 @@
3232 <td>
3333 <div id="appeal">
3434 <div id="appeal-content">
35 - <h2 id="appeal-head"> <span class="mw-headline">{{LanguageSwitch|2011FR/@appeal-title|@language}}</span></h2>
36 - <div id="appeal-body" class="plainlinks">{{LanguageSwitch|2011FR/@appeal|@language}}</div>
 35+ <h2 id="appeal-head"> <span class="mw-headline">{{LanguageSwitch|2011FR/@appeal/title|@language}}</span></h2>
 36+ <div id="appeal-body" class="plainlinks">{{LanguageSwitch|2011FR/@appeal/text|@language}}</div>
3737 </div>
3838 </div>
3939 </td>
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/html/webitects_2_3step.html
@@ -31,8 +31,8 @@
3232 <td>
3333 <div id="appeal">
3434 <div id="appeal-content">
35 - <h2 id="appeal-head"> <span class="mw-headline">{{LanguageSwitch|2011FR/@appeal-title|@language}}</span></h2>
36 - <div id="appeal-body" class="plainlinks">{{LanguageSwitch|2011FR/@appeal|@language}}</div>
 35+ <h2 id="appeal-head"> <span class="mw-headline">{{LanguageSwitch|2011FR/@appeal/title|@language}}</span></h2>
 36+ <div id="appeal-body" class="plainlinks">{{LanguageSwitch|2011FR/@appeal/text|@language}}</div>
3737 </div>
3838 </div>
3939 </td>
@@ -136,13 +136,19 @@
137137 </div>
138138 </div>
139139 <p id="informationsharing">%donate_interface-informationsharing|url%</p>
140 - <!-- TODO: links inside the message or not? -->
141 - <ul id="moreinfolinks">
142 - <li><a href="http://wikimediafoundation.org/wiki/Monthly_donations/en/US">%donate_interface-monthly-donation%</a></li><!-- TODO: localize the link -->
143 - <li>%donate_interface-otherways-short|url%</li><!-- TODO: localize the link -->
144 - <li><a href="http://wikimediafoundation.org/wiki/FAQ/en">%donate_interface-faqs%</a></li><!-- TODO: localize the link -->
145 - <!--<li><a href="">%donate_interface-tax-info%</a></li>--><!-- TODO: localize the link -->
146 - </ul>
 140+ <table>
 141+ <tr>
 142+ <td>
 143+ <ul id="moreinfolinks">
 144+ <li><a href="http://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=Monthly_donations&language=@language&uselang=@language&country=@country">%donate_interface-monthly-donation%</a></li>
 145+ <li><a href="http://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=Ways_to_Give&language=@language&uselang=@language&country=@country">%donate_interface-otherways-short%</a></li>
 146+ <li><a href="http://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=FAQ&language=@language&uselang=@language&country=@country">%donate_interface-faqs%</a></li>
 147+ <!--<li><a href="">%donate_interface-tax-info%</a></li>--><!-- TODO: localize the link -->
 148+ </ul>
 149+ </td>
 150+ <td>@verisign_logo</td>
 151+ </tr>
 152+ </table>
147153 </div>
148154 </td>
149155 </tr>
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/html/webitects_2_3step-CA.html
@@ -31,8 +31,8 @@
3232 <td>
3333 <div id="appeal">
3434 <div id="appeal-content">
35 - <h2 id="appeal-head"> <span class="mw-headline">{{LanguageSwitch|2011FR/@appeal-title|@language}}</span></h2>
36 - <div id="appeal-body" class="plainlinks">{{LanguageSwitch|2011FR/@appeal|@language}}</div>
 35+ <h2 id="appeal-head"> <span class="mw-headline">{{LanguageSwitch|2011FR/@appeal/title|@language}}</span></h2>
 36+ <div id="appeal-body" class="plainlinks">{{LanguageSwitch|2011FR/@appeal/text|@language}}</div>
3737 </div>
3838 </div>
3939 </td>
@@ -135,13 +135,19 @@
136136 </div>
137137 </div>
138138 <p id="informationsharing">%donate_interface-informationsharing|url%</p>
139 - <!-- TODO: links inside the message or not? -->
140 - <ul id="moreinfolinks">
141 - <li><a href="http://wikimediafoundation.org/wiki/Monthly_donations/en/US">%donate_interface-monthly-donation%</a></li><!-- TODO: localize the link -->
142 - <li>%donate_interface-otherways-short|url%</li><!-- TODO: localize the link -->
143 - <li><a href="http://wikimediafoundation.org/wiki/FAQ/en">%donate_interface-faqs%</a></li><!-- TODO: localize the link -->
144 - <!--<li><a href="">%donate_interface-tax-info%</a></li>--><!-- TODO: localize the link -->
145 - </ul>
 139+ <table>
 140+ <tr>
 141+ <td>
 142+ <ul id="moreinfolinks">
 143+ <li><a href="http://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=Monthly_donations&language=@language&uselang=@language&country=@country">%donate_interface-monthly-donation%</a></li>
 144+ <li><a href="http://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=Ways_to_Give&language=@language&uselang=@language&country=@country">%donate_interface-otherways-short%</a></li>
 145+ <li><a href="http://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=FAQ&language=@language&uselang=@language&country=@country">%donate_interface-faqs%</a></li>
 146+ <!--<li><a href="">%donate_interface-tax-info%</a></li>--><!-- TODO: localize the link -->
 147+ </ul>
 148+ </td>
 149+ <td>@verisign_logo</td>
 150+ </tr>
 151+ </table>
146152 </div>
147153 </td>
148154 </tr>
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects.js
@@ -11,11 +11,11 @@
1212 }
1313
1414 var currencyField = document.getElementById( 'input_currency_code' );
15 - var currency = '';
 15+ var currency_code = '';
1616 if ( currencyField && currencyField.type == 'select-one' ) { // currency is a dropdown select
17 - currency = $( 'select#input_currency_code option:selected' ).val();
 17+ currency_code = $( 'select#input_currency_code option:selected' ).val();
1818 } else {
19 - currency = $( "input[name='currency_code']" ).val();
 19+ currency_code = $( "input[name='currency_code']" ).val();
2020 }
2121
2222 var stateField = document.getElementById( 'state' );
@@ -37,7 +37,7 @@
3838 var sendData = {
3939 'action': 'donate',
4040 'gateway': 'globalcollect',
41 - 'currency': currency,
 41+ 'currency_code': currency_code,
4242 'amount': $( "input[name='amount']" ).val(),
4343 'fname': $( "input[name='fname']" ).val(),
4444 'lname': $( "input[name='lname']" ).val(),
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/donation.api.php
@@ -89,7 +89,7 @@
9090 'gateway' => $this->defineParam( true ),
9191 'test' => $this->defineParam( false ),
9292 'amount' => $this->defineParam( false ),
93 - 'currency' => $this->defineParam( false ),
 93+ 'currency_code' => $this->defineParam( false ),
9494 'fname' => $this->defineParam( false ),
9595 'mname' => $this->defineParam( false ),
9696 'lname' => $this->defineParam( false ),
@@ -128,7 +128,7 @@
129129 $this->donationData = array(
130130 'gateway' => $this->gateway,
131131 'amount' => "35",
132 - 'currency' => 'USD',
 132+ 'currency_code' => 'USD',
133133 'fname' => 'Tester',
134134 'mname' => 'T.',
135135 'lname' => 'Testington',
@@ -157,7 +157,7 @@
158158 'gateway' => 'Which payment gateway to use - payflowpro, globalcollect, etc.',
159159 'test' => 'Set to true if you want to use bogus test data instead of supplying your own',
160160 'amount' => 'The amount donated',
161 - 'currency' => 'Currency code',
 161+ 'currency_code' => 'Currency code',
162162 'fname' => 'First name',
163163 'mname' => 'Middle name',
164164 'lname' => 'Last name',
@@ -192,7 +192,7 @@
193193
194194 public function getExamples() {
195195 return array(
196 - 'api.php?action=donate&gateway=payflowpro&amount=2.00&currency=USD',
 196+ 'api.php?action=donate&gateway=payflowpro&amount=2.00&currency_code=USD',
197197 );
198198 }
199199
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/DonationData.php
@@ -57,7 +57,9 @@
5858 'card_type' => $wgRequest->getText( 'card_type' ),
5959 'expiration' => $wgRequest->getText( 'mos' ) . substr( $wgRequest->getText( 'year' ), 2, 2 ),
6060 'cvv' => $wgRequest->getText( 'cvv' ),
61 - 'currency' => $wgRequest->getVal( 'currency_code' ),
 61+ //Leave both of these here.
 62+ 'currency' => $wgRequest->getVal( 'currency' ),
 63+ 'currency_code' => $wgRequest->getVal( 'currency_code' ),
6264 'payment_method' => $wgRequest->getText( 'payment_method', 'cc' ),
6365 'payment_submethod' => $wgRequest->getText( 'payment_submethod', null ), // Used by GlobalCollect for payment types
6466 'issuer_id' => $wgRequest->getText( 'issuer_id' ),
@@ -312,12 +314,27 @@
313315 */
314316 function setCurrencyCode() {
315317 global $wgRequest;
316 - if ( !$this->isSomething('currency') ){
317 - $code = $wgRequest->getVal('currency', null);
318 - if (!is_null($code)){
319 - $this->setVal('currency', $code);
320 - }
 318+
 319+ //at this point, we can have either currency, or currency_code.
 320+ //-->>currency_code has the authority!<<--
 321+ $currency = false;
 322+
 323+ if ( $this->isSomething( 'currency_code' ) ) {
 324+ $currency = $this->getVal( 'currency_code' );
 325+ } elseif ( $this->isSomething( 'currency' ) ) {
 326+ $currency = $this->getVal( 'currency' );
321327 }
 328+
 329+ if ( $currency ){
 330+ //set them both.
 331+ $this->setVal( 'currency_code', $currency );
 332+ $this->setVal( 'currency', $currency );
 333+ } else {
 334+ //we want these unset if neither of them was anything, so things
 335+ //using this data know to use their own defaults.
 336+ $this->expunge( 'currency_code' );
 337+ $this->expunge( 'currency' );
 338+ }
322339 }
323340
324341 /**
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/DonationData.php
___________________________________________________________________
Modified: svn:mergeinfo
325342 Merged /trunk/extensions/DonationInterface/gateway_common/DonationData.php:r102309
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface
___________________________________________________________________
Modified: svn:mergeinfo
326343 Merged /trunk/extensions/DonationInterface:r102307-102309

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r102307using currency_code instead of currency since this is what DonationData is ex...kaldari18:58, 7 November 2011
r102308Switching out appeal and appeal title as well as setting the correct defaultpgehres19:09, 7 November 2011
r102309Changes the way the currency code is pulled from the source data, to prevent ...khorn19:22, 7 November 2011

Status & tagging log