Index: trunk/extensions/DonationInterface/tests/Adapter/GlobalCollect/GlobalCollectTestCase.php |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | $var_map = array( |
56 | 56 | 'ORDERID' => 'order_id', |
57 | 57 | 'AMOUNT' => 'amount', |
58 | | - 'CURRENCYCODE' => 'currency', |
| 58 | + 'CURRENCYCODE' => 'currency_code', |
59 | 59 | 'LANGUAGECODE' => 'language', |
60 | 60 | 'COUNTRYCODE' => 'country', |
61 | 61 | 'MERCHANTREFERENCE' => 'order_id', |
Index: trunk/extensions/DonationInterface/tests/DonationDataTestCase.php |
— | — | @@ -60,7 +60,7 @@ |
61 | 61 | 'card_type' => 'visa', |
62 | 62 | 'expiration' => '1138', |
63 | 63 | 'cvv' => '665', |
64 | | - 'currency' => 'USD', |
| 64 | + 'currency_code' => 'USD', |
65 | 65 | 'payment_method' => '', |
66 | 66 | 'i_order_id' => '1234567890', |
67 | 67 | 'numAttempt' => '5', |
— | — | @@ -119,7 +119,7 @@ |
120 | 120 | 'card_type' => '', |
121 | 121 | 'expiration' => '', |
122 | 122 | 'cvv' => '', |
123 | | - 'currency' => '', |
| 123 | + 'currency_code' => '', |
124 | 124 | 'payment_method' => '', |
125 | 125 | 'numAttempt' => '0', |
126 | 126 | 'referrer' => '', |
— | — | @@ -175,7 +175,7 @@ |
176 | 176 | 'card_type' => 'american', |
177 | 177 | 'expiration' => '1012', |
178 | 178 | 'cvv' => '001', |
179 | | - 'currency' => 'USD', |
| 179 | + 'currency_code' => 'USD', |
180 | 180 | 'payment_method' => '', |
181 | 181 | 'i_order_id' => '1234567890', |
182 | 182 | 'numAttempt' => '0', |
Index: trunk/extensions/DonationInterface/tests/DonationInterfaceTestCase.php |
— | — | @@ -193,7 +193,7 @@ |
194 | 194 | 'zip' => $zip, |
195 | 195 | 'country' => $country, |
196 | 196 | //'size' => 'small', |
197 | | - 'currency' => $currency, |
| 197 | + 'currency_code' => $currency, |
198 | 198 | //'order_id' => '5038287830', |
199 | 199 | //'i_order_id' => '1234567890', |
200 | 200 | 'numAttempt' => 0, |
— | — | @@ -262,7 +262,7 @@ |
263 | 263 | $options['state'] = 'XX'; |
264 | 264 | $options['zip'] = ''; |
265 | 265 | $options['country'] = 'ES'; |
266 | | - $options['currency'] = 'EUR'; |
| 266 | + $options['currency_code'] = 'EUR'; |
267 | 267 | |
268 | 268 | return $this->getGatewayAdapterTestData( $options ); |
269 | 269 | } |
— | — | @@ -285,7 +285,7 @@ |
286 | 286 | $expected .= '<ORDER>'; |
287 | 287 | $expected .= '<ORDERID>' . $orderId . '</ORDERID>'; |
288 | 288 | $expected .= '<AMOUNT>' . $options['testData']['amount'] * 100 . '</AMOUNT>'; |
289 | | - $expected .= '<CURRENCYCODE>' . $options['testData']['currency'] . '</CURRENCYCODE>'; |
| 289 | + $expected .= '<CURRENCYCODE>' . $options['testData']['currency_code'] . '</CURRENCYCODE>'; |
290 | 290 | $expected .= '<LANGUAGECODE>' . $options['testData']['language'] . '</LANGUAGECODE>'; |
291 | 291 | $expected .= '<COUNTRYCODE>' . $options['testData']['country'] . '</COUNTRYCODE>'; |
292 | 292 | $expected .= '<MERCHANTREFERENCE>' . $orderId . '</MERCHANTREFERENCE>'; |
— | — | @@ -293,7 +293,7 @@ |
294 | 294 | $expected .= '<PAYMENT>'; |
295 | 295 | $expected .= '<PAYMENTPRODUCTID>' . $optionsForTestData['payment_product_id'] . '</PAYMENTPRODUCTID>'; |
296 | 296 | $expected .= '<AMOUNT>' . $options['testData']['amount'] * 100 . '</AMOUNT>'; |
297 | | - $expected .= '<CURRENCYCODE>' . $options['testData']['currency'] . '</CURRENCYCODE>'; |
| 297 | + $expected .= '<CURRENCYCODE>' . $options['testData']['currency_code'] . '</CURRENCYCODE>'; |
298 | 298 | $expected .= '<LANGUAGECODE>' . $options['testData']['language'] . '</LANGUAGECODE>'; |
299 | 299 | $expected .= '<COUNTRYCODE>' . $options['testData']['country'] . '</COUNTRYCODE>'; |
300 | 300 | $expected .= '<HOSTEDINDICATOR>1</HOSTEDINDICATOR>'; |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro.adapter.php |
— | — | @@ -43,11 +43,11 @@ |
44 | 44 | 'ZIP' => 'zip', |
45 | 45 | 'INVNUM' => 'order_id', |
46 | 46 | 'CVV2' => 'cvv', |
47 | | - 'CURRENCY' => 'currency', |
| 47 | + 'CURRENCY' => 'currency_code', |
48 | 48 | 'CUSTIP' => 'user_ip', |
49 | 49 | // 'ORDERID' => 'order_id', |
50 | 50 | // 'AMOUNT' => 'amount', |
51 | | -// 'CURRENCYCODE' => 'currency', |
| 51 | +// 'CURRENCYCODE' => 'currency_code', |
52 | 52 | // 'LANGUAGECODE' => 'language', |
53 | 53 | // 'COUNTRYCODE' => 'country', |
54 | 54 | // 'MERCHANTREFERENCE' => 'order_id', |
Index: trunk/extensions/DonationInterface/extras/minfraud/minfraud.body.php |
— | — | @@ -89,7 +89,7 @@ |
90 | 90 | public function log_query( $minfraud_query, $action ) { |
91 | 91 | if ( $this->log_fh ) { |
92 | 92 | $log_message = '"' . addslashes( $this->gateway_adapter->getData_Raw( 'comment' ) ) . '"'; |
93 | | - $log_message .= "\t" . '"' . addslashes( $this->gateway_adapter->getData_Raw( 'amount' ) . ' ' . $this->gateway_adapter->getData_Raw( 'currency' ) ) . '"'; |
| 93 | + $log_message .= "\t" . '"' . addslashes( $this->gateway_adapter->getData_Raw( 'amount' ) . ' ' . $this->gateway_adapter->getData_Raw( 'currency_code' ) ) . '"'; |
94 | 94 | $log_message .= "\t" . '"' . addslashes( json_encode( $minfraud_query ) ) . '"'; |
95 | 95 | $log_message .= "\t" . '"' . addslashes( json_encode( $this->minfraud_response ) ) . '"'; |
96 | 96 | $log_message .= "\t" . '"' . addslashes( $action ) . '"'; |
Index: trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter.php |
— | — | @@ -99,7 +99,7 @@ |
100 | 100 | $form .= '</tr>'; |
101 | 101 | |
102 | 102 | // card logos |
103 | | - if ( $this->form_data[ 'currency' ] == 'USD' ) { |
| 103 | + if ( $this->form_data[ 'currency_code' ] == 'USD' ) { |
104 | 104 | $form .= '<tr id="four_cards" style="display:table-row;">'; |
105 | 105 | $form .= '<td class="label"> </td><td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos.gif" ) ) . '</td>'; |
106 | 106 | $form .= '</tr>'; |
Index: trunk/extensions/DonationInterface/gateway_forms/rapidhtml/js/lightbox1.js |
— | — | @@ -187,7 +187,7 @@ |
188 | 188 | error = ( amount == null || isNaN( amount ) || amount.value <= 0 ); |
189 | 189 | // Check amount is at least the minimum |
190 | 190 | var currency = 'USD'; // hard-coded for these forms and tests |
191 | | - $( "input[name='currency']" ).val( currency ); |
| 191 | + $( "input[name='currency_code']" ).val( currency ); |
192 | 192 | if ( typeof( wgCurrencyMinimums[currency] ) == 'undefined' ) { |
193 | 193 | wgCurrencyMinimums[currency] = 1; |
194 | 194 | } |
Index: trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetterCA.php |
— | — | @@ -99,7 +99,7 @@ |
100 | 100 | $form .= '</tr>'; |
101 | 101 | |
102 | 102 | // card logos |
103 | | - if ( $this->form_data[ 'currency' ] == 'USD' ) { |
| 103 | + if ( $this->form_data[ 'currency_code' ] == 'USD' ) { |
104 | 104 | $form .= '<tr id="four_cards" style="display:table-row;">'; |
105 | 105 | $form .= '<td class="label"> </td><td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos.gif" ) ) . '</td>'; |
106 | 106 | $form .= '</tr>'; |
Index: trunk/extensions/DonationInterface/gateway_forms/Form.php |
— | — | @@ -366,8 +366,8 @@ |
367 | 367 | $availableCurrencies = $this->gateway->getCurrencies(); |
368 | 368 | |
369 | 369 | // If a currency has already been posted, use that, otherwise use the default. |
370 | | - if ( $this->form_data['currency'] ) { |
371 | | - $selectedCurrency = $this->form_data['currency']; |
| 370 | + if ( $this->form_data['currency_code'] ) { |
| 371 | + $selectedCurrency = $this->form_data['currency_code']; |
372 | 372 | } else { |
373 | 373 | $selectedCurrency = $defaultCurrencyCode; |
374 | 374 | } |
Index: trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremium.php |
— | — | @@ -105,7 +105,7 @@ |
106 | 106 | $form .= '</tr>'; |
107 | 107 | |
108 | 108 | // card logos |
109 | | - if ( $this->form_data[ 'currency' ] == 'USD' ) { |
| 109 | + if ( $this->form_data[ 'currency_code' ] == 'USD' ) { |
110 | 110 | $form .= '<tr id="four_cards" style="display:table-row;">'; |
111 | 111 | $form .= '<td class="label"> </td><td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos.gif" ) ) . '</td>'; |
112 | 112 | $form .= '</tr>'; |
Index: trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter3.php |
— | — | @@ -208,8 +208,8 @@ |
209 | 209 | $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->form_data['amount'] . |
210 | 210 | Html::hidden( 'amount', $this->form_data['amount'] ) . |
211 | 211 | '</td>'; |
212 | | - $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->form_data[ 'currency' ] . |
213 | | - Html::hidden( 'currency_code', $this->form_data['currency'] ) . |
| 212 | + $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->form_data[ 'currency_code' ] . |
| 213 | + Html::hidden( 'currency_code', $this->form_data['currency_code'] ) . |
214 | 214 | '</td>'; |
215 | 215 | $form .= '</tr>'; |
216 | 216 | $form .= '</table>'; |
— | — | @@ -224,7 +224,7 @@ |
225 | 225 | // card logos |
226 | 226 | $form .= '<tr>'; |
227 | 227 | $form .= '<td class="label"> </td>'; |
228 | | - if ( $this->form_data[ 'currency' ] == 'USD' ) { |
| 228 | + if ( $this->form_data[ 'currency_code' ] == 'USD' ) { |
229 | 229 | $form .= '<td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos.gif" ) ) . '</td>'; |
230 | 230 | } else { |
231 | 231 | $form .= '<td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos3.gif" ) ) . '</td>'; |
Index: trunk/extensions/DonationInterface/gateway_forms/RapidHtml.php |
— | — | @@ -31,7 +31,7 @@ |
32 | 32 | '@card_type', // => $wgRequest->getText( 'card_type' ), |
33 | 33 | '@expiration', // => $wgRequest->getText( 'mos' ) . substr( $wgRequest->getText( 'year' ), 2, 2 ), |
34 | 34 | '@cvv', // => $wgRequest->getText( 'cvv' ), |
35 | | - '@currency_code', //'currency' => $wgRequest->getText( 'currency_code' ), |
| 35 | + '@currency_code', //'currency_code' => $wgRequest->getText( 'currency_code' ), |
36 | 36 | '@payment_method', // => $wgRequest->getText( 'payment_method' ), |
37 | 37 | '@order_id', // => $order_id, |
38 | 38 | '@numAttempt', // => $numAttempt, |
— | — | @@ -169,7 +169,6 @@ |
170 | 170 | foreach ( $this->data_tokens as $token ) { |
171 | 171 | $key = substr( $token, 1, strlen( $token )); //get the token string w/o the '@' |
172 | 172 | if ( $key == 'emailAdd' ) $key = 'email'; |
173 | | - if ( $key == 'currency_code' ) $key = 'currency'; |
174 | 173 | if ( array_key_exists( $key, $this->form_data )) { |
175 | 174 | $replace = $this->form_data[ $key ]; |
176 | 175 | } else { |
— | — | @@ -270,7 +269,7 @@ |
271 | 270 | // currency code |
272 | 271 | $start = strpos( $html, 'name="currency_code"' ); |
273 | 272 | if ( $start ) { |
274 | | - $currency_code = $this->form_data['currency']; |
| 273 | + $currency_code = $this->form_data['currency_code']; |
275 | 274 | $end = strpos( $html, '</select>', $start ); |
276 | 275 | $str = substr( $html, $start, ( $end - $start ) ); |
277 | 276 | $str = str_replace( 'value="' . $currency_code . '"', 'value="' . $currency_code . '" selected="selected"', $str ); |
Index: trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremiumUS.php |
— | — | @@ -192,8 +192,8 @@ |
193 | 193 | $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->form_data['amount'] . |
194 | 194 | Html::hidden( 'amount', $this->form_data['amount'] ) . |
195 | 195 | '</td>'; |
196 | | - $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->form_data[ 'currency' ] . |
197 | | - Html::hidden( 'currency_code', $this->form_data['currency'] ) . |
| 196 | + $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->form_data[ 'currency_code' ] . |
| 197 | + Html::hidden( 'currency_code', $this->form_data['currency_code'] ) . |
198 | 198 | '</td>'; |
199 | 199 | $form .= '</tr>'; |
200 | 200 | $form .= '</table>'; |
— | — | @@ -208,7 +208,7 @@ |
209 | 209 | // card logos |
210 | 210 | $form .= '<tr>'; |
211 | 211 | $form .= '<td class="label"> </td>'; |
212 | | - if ( $this->form_data[ 'currency' ] == 'USD' ) { |
| 212 | + if ( $this->form_data[ 'currency_code' ] == 'USD' ) { |
213 | 213 | $form .= '<td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos.gif" ) ) . '</td>'; |
214 | 214 | } else { |
215 | 215 | $form .= '<td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos3.gif" ) ) . '</td>'; |
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/lightbox1.js |
— | — | @@ -144,7 +144,7 @@ |
145 | 145 | var sendData = { |
146 | 146 | 'action': 'donate', |
147 | 147 | 'gateway': 'globalcollect', |
148 | | - 'currency': 'USD', |
| 148 | + 'currency_code': 'USD', |
149 | 149 | 'amount': $( "input[name='amount']" ).val(), |
150 | 150 | 'fname': $( "input[name='fname']" ).val(), |
151 | 151 | 'lname': $( "input[name='lname']" ).val(), |
— | — | @@ -221,7 +221,7 @@ |
222 | 222 | error = ( amount == null || isNaN( amount ) || amount.value <= 0 ); |
223 | 223 | // Check amount is at least the minimum |
224 | 224 | var currency = 'USD'; // hard-coded for these forms and tests |
225 | | - $( "input[name='currency']" ).val( currency ); |
| 225 | + $( "input[name='currency_code']" ).val( currency ); |
226 | 226 | if ( typeof( wgCurrencyMinimums[currency] ) == 'undefined' ) { |
227 | 227 | wgCurrencyMinimums[currency] = 1; |
228 | 228 | } |
Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php |
— | — | @@ -79,7 +79,7 @@ |
80 | 80 | 'CUSTOMERBANKNUMBER'=> 'customer_bank_number', // dd |
81 | 81 | 'CUSTOMERBANKZIP' => 'customer_bank_zip', // dd |
82 | 82 | 'CREDITCARDNUMBER' => 'card_num', |
83 | | - 'CURRENCYCODE' => 'currency', |
| 83 | + 'CURRENCYCODE' => 'currency_code', |
84 | 84 | 'CVV' => 'cvv', |
85 | 85 | 'DATECOLLECT' => 'date_collect', |
86 | 86 | 'DIRECTDEBITTEXT' => 'direct_debit_text', |
Index: trunk/extensions/DonationInterface/gateway_common/gateway.adapter.php |
— | — | @@ -238,7 +238,7 @@ |
239 | 239 | $this->postdatadefaults = array( |
240 | 240 | 'order_id' => '112358' . rand(), |
241 | 241 | 'amount' => '11.38', |
242 | | - 'currency' => 'USD', |
| 242 | + 'currency_code' => 'USD', |
243 | 243 | 'language' => 'en', |
244 | 244 | 'country' => 'US', |
245 | 245 | 'returnto' => $returnTo, |
— | — | @@ -1476,7 +1476,7 @@ |
1477 | 1477 | } |
1478 | 1478 | |
1479 | 1479 | function getPaypalRedirectURL() { |
1480 | | - $currency = $this->getData_Raw( 'currency' ); |
| 1480 | + $currency = $this->getData_Raw( 'currency_code' ); |
1481 | 1481 | |
1482 | 1482 | // update the utm source to set the payment instrument to pp rather than cc |
1483 | 1483 | $data['payment_method'] = 'pp'; |
Index: trunk/extensions/DonationInterface/gateway_common/DonationData.php |
— | — | @@ -57,7 +57,7 @@ |
58 | 58 | 'card_type' => $wgRequest->getText( 'card_type' ), |
59 | 59 | 'expiration' => $wgRequest->getText( 'mos' ) . substr( $wgRequest->getText( 'year' ), 2, 2 ), |
60 | 60 | 'cvv' => $wgRequest->getText( 'cvv' ), |
61 | | - //Leave both of these here. |
| 61 | + //Leave both of the currencies here, in case something external didn't get the memo. |
62 | 62 | 'currency' => $wgRequest->getVal( 'currency' ), |
63 | 63 | 'currency_code' => $wgRequest->getVal( 'currency_code' ), |
64 | 64 | 'payment_method' => $wgRequest->getText( 'payment_method', 'cc' ), |
— | — | @@ -187,7 +187,7 @@ |
188 | 188 | 'card_type' => $cards[$card_index], |
189 | 189 | 'expiration' => date( 'my', strtotime( '+1 year 1 month' ) ), |
190 | 190 | 'cvv' => '001', |
191 | | - 'currency' => 'USD', |
| 191 | + 'currency_code' => 'USD', |
192 | 192 | 'payment_method' => 'cc', |
193 | 193 | 'payment_submethod' => '', //cards have no payment submethods. |
194 | 194 | 'issuer_id' => '', |
— | — | @@ -265,7 +265,7 @@ |
266 | 266 | 'anonymous', |
267 | 267 | 'language', |
268 | 268 | 'contribution_tracking_id', //sort of... |
269 | | - 'currency' |
| 269 | + 'currency_code', |
270 | 270 | ); |
271 | 271 | return $fields; |
272 | 272 | } |
— | — | @@ -323,17 +323,15 @@ |
324 | 324 | $currency = $this->getVal( 'currency_code' ); |
325 | 325 | } elseif ( $this->isSomething( 'currency' ) ) { |
326 | 326 | $currency = $this->getVal( 'currency' ); |
| 327 | + $this->expunge( 'currency' ); |
327 | 328 | } |
328 | 329 | |
329 | 330 | if ( $currency ){ |
330 | | - //set them both. |
331 | 331 | $this->setVal( 'currency_code', $currency ); |
332 | | - $this->setVal( 'currency', $currency ); |
333 | 332 | } 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' ); |
| 333 | + //we want this set tu null if neither of them was anything, so |
| 334 | + //things using this data know to use their own defaults. |
| 335 | + $this->setVal( 'currency_code', null ); |
338 | 336 | } |
339 | 337 | } |
340 | 338 | |
— | — | @@ -940,7 +938,7 @@ |
941 | 939 | 'gateway', |
942 | 940 | 'gateway_txn_id', |
943 | 941 | 'response', |
944 | | - 'currency', |
| 942 | + 'currency_code', |
945 | 943 | 'amount', |
946 | 944 | 'date', |
947 | 945 | ); |
Index: trunk/extensions/DonationInterface/gateway_common/GatewayForm.php |
— | — | @@ -194,8 +194,8 @@ |
195 | 195 | $priceFloor = $this->adapter->getGlobal( 'PriceFloor' ); |
196 | 196 | $priceCeiling = $this->adapter->getGlobal( 'PriceCeiling' ); |
197 | 197 | if ( !preg_match( '/^\d+(\.(\d+)?)?$/', $data['amount'] ) || |
198 | | - ( ( float ) $this->convert_to_usd( $data['currency'], $data['amount'] ) < ( float ) $priceFloor || |
199 | | - ( float ) $this->convert_to_usd( $data['currency'], $data['amount'] ) > ( float ) $priceCeiling ) ) { |
| 198 | + ( ( float ) $this->convert_to_usd( $data['currency_code'], $data['amount'] ) < ( float ) $priceFloor || |
| 199 | + ( float ) $this->convert_to_usd( $data['currency_code'], $data['amount'] ) > ( float ) $priceCeiling ) ) { |
200 | 200 | |
201 | 201 | $error['invalidamount'] = wfMsg( 'donate_interface-error-msg-invalid-amount' ); |
202 | 202 | |
Index: trunk/extensions/DonationInterface/activemq_stomp/activemq_stomp.php |
— | — | @@ -166,8 +166,8 @@ |
167 | 167 | 'gateway' => $transaction['gateway'], |
168 | 168 | 'gateway_txn_id' => $transaction['gateway_txn_id'], |
169 | 169 | 'response' => $transaction['response'], |
170 | | - 'currency' => $transaction['currency'], |
171 | | - 'original_currency' => $transaction['currency'], |
| 170 | + 'currency' => $transaction['currency_code'], |
| 171 | + 'original_currency' => $transaction['currency_code'], |
172 | 172 | 'original_gross' => $transaction['amount'], |
173 | 173 | 'fee' => '0', |
174 | 174 | 'gross' => $transaction['amount'], |