r102307 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102306‎ | r102307 | r102308 >
Date:18:58, 7 November 2011
Author:kaldari
Status:ok
Tags:
Comment:
using currency_code instead of currency since this is what DonationData is expecting
Modified paths:
  • /trunk/extensions/DonationInterface/gateway_common/donation.api.php (modified) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/lightbox1.html (modified) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects.js (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/html/lightbox1.html (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/js/lightbox1.js (modified) (history)

Diff [purge]

Index: trunk/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: trunk/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 }
Index: trunk/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: trunk/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: trunk/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

Follow-up revisions

RevisionCommit summaryAuthorDate
r102309Changes the way the currency code is pulled from the source data, to prevent ...khorn19:22, 7 November 2011
r102311MFT r102307, r102308, r102309awjrichards19:28, 7 November 2011

Status & tagging log