r101962 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101961‎ | r101962 | r101963 >
Date:06:07, 4 November 2011
Author:pgehres
Status:ok
Tags:
Comment:
Adding CAD to js validation
Modified paths:
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects_2_3step.js (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/js/webitects_2_3step.js (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/js/webitects_2_3step.js
@@ -177,8 +177,11 @@
178178 $( "#change-amount" ).show();
179179 }
180180 function validateAmount() {
 181+
 182+ // TODO: THIS NEEDS TO BE REPLACED WITH KALDARI'S CURRENCIES
181183 var minimums = {
182 - 'USD' : 1
 184+ 'USD' : 1,
 185+ 'CAD' : 1
183186 };
184187 var error = true;
185188 var amount = $( 'input[name="amount"]' ).val(); // get the amount
@@ -192,8 +195,7 @@
193196 error = ( amount == null || isNaN( amount ) || amount.value <= 0 );
194197
195198 // Check amount is at least the minimum
196 - var currency_code = 'USD'; // hard-coded for these forms and tests
197 - $( 'input[name="currency_code"]' ).val( currency_code );
 199+ var currency_code = $( 'input[name="currency_code"]' ).val();
198200 if ( typeof( minimums[currency_code] ) == 'undefined' ) {
199201 minimums[currency_code] = 1;
200202 }
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects_2_3step.js
@@ -252,8 +252,11 @@
253253 $( "#change-amount" ).show();
254254 }
255255 function validateAmount() {
 256+
 257+ // TODO: THIS NEEDS TO BE REPLACED WITH KALDARI'S CURRENCIES
256258 var minimums = {
257 - 'USD' : 1
 259+ 'USD' : 1,
 260+ 'CAD' : 1
258261 };
259262 var error = true;
260263 var amount = $( 'input[name="amount"]' ).val(); // get the amount
@@ -267,8 +270,7 @@
268271 error = ( amount == null || isNaN( amount ) || amount.value <= 0 );
269272
270273 // Check amount is at least the minimum
271 - var currency_code = 'USD'; // hard-coded for these forms and tests
272 - $( 'input[name="currency_code"]' ).val( currency_code );
 274+ var currency_code = $( 'input[name="currency_code"]' ).val();
273275 if ( typeof( minimums[currency_code] ) == 'undefined' ) {
274276 minimums[currency_code] = 1;
275277 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r102001MFT r101962awjrichards15:33, 4 November 2011

Status & tagging log