r102188 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102187‎ | r102188 | r102189 >
Date:20:01, 6 November 2011
Author:kaldari
Status:ok
Tags:
Comment:
adding currency minimums to webitects js validation
Modified paths:
  • /trunk/extensions/DonationInterface/gateway_common/currencyRates.inc (modified) (history)
  • /trunk/extensions/DonationInterface/gateway_common/us-states.i18n.php (modified) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects.js (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects.js
@@ -73,13 +73,96 @@
7474 }
7575 window.validateAmount = function() {
7676
77 - // TODO: THIS NEEDS TO BE REPLACED WITH KALDARI'S CURRENCIES
 77+ // If you change these, also change in currencyRates.inc.
7878 var minimums = {
79 - 'USD' : 1,
80 - 'CAD' : 1
 79+ 'AED': 4,
 80+ 'ARS': 4,
 81+ 'AUD': 1,
 82+ 'BBD': 2,
 83+ 'BDT': 76,
 84+ 'BGN': 1.4,
 85+ 'BHD': 0.4,
 86+ 'BMD': 1,
 87+ 'BND': 1.3,
 88+ 'BOB': 7,
 89+ 'BRL': 1.7,
 90+ 'BSD': 1,
 91+ 'BZD': 2,
 92+ 'CAD': 1,
 93+ 'CHF': 0.9,
 94+ 'CLP': 494,
 95+ 'CNY': 6,
 96+ 'COP': 1910,
 97+ 'CRC': 512,
 98+ 'CZK': 18,
 99+ 'DKK': 5,
 100+ 'DOP': 38,
 101+ 'DZD': 73,
 102+ 'EEK': 11,
 103+ 'EGP': 6,
 104+ 'EUR': 0.7,
 105+ 'GBP': 0.6,
 106+ 'GTQ': 7.8,
 107+ 'HKD': 7.7,
 108+ 'HNL': 19,
 109+ 'HRK': 5,
 110+ 'HUF': 219,
 111+ 'IDR': 8960,
 112+ 'ILS': 3.6,
 113+ 'INR': 49,
 114+ 'JMD': 85,
 115+ 'JOD': 0.7,
 116+ 'JPY': 78,
 117+ 'KES': 97,
 118+ 'KRW': 1127,
 119+ 'KYD': 0.8,
 120+ 'KZT': 147,
 121+ 'LBP': 1500,
 122+ 'LKR': 110,
 123+ 'LTL': 2.5,
 124+ 'LVL': 0.5,
 125+ 'MAD': 8.1,
 126+ 'MKD': 45,
 127+ 'MUR': 29,
 128+ 'MVR': 15,
 129+ 'MXN': 13,
 130+ 'MYR': 3,
 131+ 'NOK': 5.5,
 132+ 'NZD': 1.2,
 133+ 'OMR': 0.3,
 134+ 'PAB': 1,
 135+ 'PEN': 2.7,
 136+ 'PHP': 43,
 137+ 'PKR': 86,
 138+ 'PLN': 3,
 139+ 'PYG': 4190,
 140+ 'QAR': 3.6,
 141+ 'RON': 3.1,
 142+ 'RUB': 30,
 143+ 'SAR': 3.7,
 144+ 'SEK': 6.5,
 145+ 'SGD': 1.2,
 146+ 'SVC': 8.7,
 147+ 'THB': 30,
 148+ 'TJS': 4.7,
 149+ 'TND': 1.4,
 150+ 'TRY': 1.7,
 151+ 'TTD': 6,
 152+ 'TWD': 30,
 153+ 'UAH': 8,
 154+ 'USD': 1,
 155+ 'UYU': 19,
 156+ 'UZS': 1760,
 157+ 'VND': 21000,
 158+ 'XAF': 470,
 159+ 'XCD': 2.7,
 160+ 'XOF': 476,
 161+ 'ZAR': 7.8
81162 };
82163 var error = true;
83164 var amount = $( 'input[name="amount"]' ).val(); // get the amount
 165+ // Normalize weird amount formats.
 166+ // Don't mess with these unless you know what you're doing.
84167 amount = amount.replace( /[,.](\d)$/, '\:$10' );
85168 amount = amount.replace( /[,.](\d)(\d)$/, '\:$1$2' );
86169 amount = amount.replace( /[,.]/g, '' );
Index: trunk/extensions/DonationInterface/gateway_common/currencyRates.inc
@@ -5,6 +5,7 @@
66 * Last updated November 3, 2011 (rounded down)
77 */
88 function getCurrencyRates() {
 9+ // If you change these, make sure to also update any JS validation scripts
910 $currencyRates = array(
1011 'AED' => '4',
1112 'ARS' => '4',
Index: trunk/extensions/DonationInterface/gateway_common/us-states.i18n.php
@@ -65,7 +65,7 @@
6666 'donate_interface-state-dropdown-WI' => 'Wisconsin',
6767 'donate_interface-state-dropdown-WV' => 'West Virginia',
6868 'donate_interface-state-dropdown-WY' => 'Wyoming',
69 - 'donate_interface-state-dropdown-AA' => 'AA',
70 - 'donate_interface-state-dropdown-AE' => 'AE',
71 - 'donate_interface-state-dropdown-AP' => 'AP',
 69+ 'donate_interface-state-dropdown-AA' => 'AA (Military)',
 70+ 'donate_interface-state-dropdown-AE' => 'AE (Military)',
 71+ 'donate_interface-state-dropdown-AP' => 'AP (Military)',
7272 );

Follow-up revisions

RevisionCommit summaryAuthorDate
r102236MFT r90286, r100671, r100837, r100950, r101060, r101063, r101064, r101073, r1......khorn03:06, 7 November 2011
r102237MFT r90286, r100671, r100837, r100950, r101060, r101063, r101064, r101073, r1......khorn03:07, 7 November 2011
r102609MFT r102188, r102195, r102323, r102438, r102563awjrichards00:20, 10 November 2011

Status & tagging log