r79263 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79262‎ | r79263 | r79264 >
Date:16:56, 30 December 2010
Author:awjrichards
Status:deferred
Tags:
Comment:
Fixed mindless mistake in currency 'conversion' method to divide by the divisors, not multiply by them, in order to convert from non-usd currency -> usd
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
@@ -1285,55 +1285,55 @@
12861286 public function convert_to_usd( $currency_code, $amount ) {
12871287 switch ( strtoupper( $currency_code ) ) {
12881288 case 'USD':
1289 - $usd_amount = $amount * 1;
 1289+ $usd_amount = $amount / 1;
12901290 break;
12911291 case 'GBP':
1292 - $usd_amount = $amount * 1;
 1292+ $usd_amount = $amount / 1;
12931293 break;
12941294 case 'EUR':
1295 - $usd_amount = $amount * 1;
 1295+ $usd_amount = $amount / 1;
12961296 break;
12971297 case 'AUD':
1298 - $usd_amount = $amount * 2;
 1298+ $usd_amount = $amount / 2;
12991299 break;
13001300 case 'CAD':
1301 - $usd_amount = $amount * 1;
 1301+ $usd_amount = $amount / 1;
13021302 break;
13031303 case 'CHF':
1304 - $usd_amount = $amount * 1;
 1304+ $usd_amount = $amount / 1;
13051305 break;
13061306 case 'CZK':
1307 - $usd_amount = $amount * 20;
 1307+ $usd_amount = $amount / 20;
13081308 break;
13091309 case 'DKK':
1310 - $usd_amount = $amount * 5;
 1310+ $usd_amount = $amount / 5;
13111311 break;
13121312 case 'HKD':
1313 - $usd_amount = $amount * 10;
 1313+ $usd_amount = $amount / 10;
13141314 break;
13151315 case 'HUF':
1316 - $usd_amount = $amount * 200;
 1316+ $usd_amount = $amount / 200;
13171317 break;
13181318 case 'JPY':
1319 - $usd_amount = $amount * 100;
 1319+ $usd_amount = $amount / 100;
13201320 break;
13211321 case 'NZD':
1322 - $usd_amount = $amount * 2;
 1322+ $usd_amount = $amount / 2;
13231323 break;
13241324 case 'NOK':
1325 - $usd_amount = $amount * 10;
 1325+ $usd_amount = $amount / 10;
13261326 break;
13271327 case 'PLN':
1328 - $usd_amount = $amount * 5;
 1328+ $usd_amount = $amount / 5;
13291329 break;
13301330 case 'SGD':
1331 - $usd_amount = $amount * 2;
 1331+ $usd_amount = $amount / 2;
13321332 break;
13331333 case 'SEK':
1334 - $usd_amount = $amount * 10;
 1334+ $usd_amount = $amount / 10;
13351335 break;
13361336 case 'ILS':
1337 - $usd_amount = $amount * 5;
 1337+ $usd_amount = $amount / 5;
13381338 break;
13391339 default:
13401340 $usd_amount = $amount;

Status & tagging log