Awight has uploaded a new change for review.
https://gerrit.wikimedia.org/r/178966
Change subject: Use currency codes from DonationInterface without copypasta
......................................................................
Use currency codes from DonationInterface without copypasta
Change-Id: I65543342b4f2a9b8ace5d9624ff18d4f181505c9
---
M sites/all/modules/wmf_audit/worldpay/worldpay_audit.module
1 file changed, 1 insertion(+), 125 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm
refs/changes/66/178966/1
diff --git a/sites/all/modules/wmf_audit/worldpay/worldpay_audit.module
b/sites/all/modules/wmf_audit/worldpay/worldpay_audit.module
index a4d09bb..b727962 100644
--- a/sites/all/modules/wmf_audit/worldpay/worldpay_audit.module
+++ b/sites/all/modules/wmf_audit/worldpay/worldpay_audit.module
@@ -538,132 +538,8 @@
*/
function worldpay_audit_get_currency_code_from_stupid_number($number) {
static $flipped = array();
- //This mega-array was straight-up copied from DonationInterface.
- //Not even bothering to reformat, because that will make it harder to update
later.
if (empty($flipped)) {
- $CURRENCY_CODES = array(
- 'AED' => 784,
- 'ALL' => 8,
- 'ANG' => 532,
- 'ARS' => 32,
- 'AUD' => 36,
- 'AWG' => 533,
- 'AZN' => 944,
- 'BAM' => 977,
- 'BBD' => 52,
- 'BDT' => 50,
- 'BGN' => 975,
- 'BHD' => 48,
- 'BMD' => 60,
- 'BND' => 96,
- 'BOB' => 68,
- 'BRL' => 986,
- 'BSD' => 44,
- 'BWP' => 72,
- 'BZD' => 84,
- 'CAD' => 124,
- 'CHF' => 756,
- 'CLP' => 152,
- 'CNY' => 156,
- 'COP' => 170,
- 'CRC' => 188,
- 'CUP' => 192,
- 'CZK' => 203,
- 'DJF' => 262,
- 'DKK' => 208,
- 'DOP' => 214,
- 'DZD' => 12,
- 'EGP' => 818,
- 'ERN' => 232,
- 'ETB' => 230,
- 'EUR' => 978,
- 'FJD' => 242,
- 'GBP' => 826,
- 'GEL' => 981,
- 'GIP' => 292,
- 'GTQ' => 320,
- 'GYD' => 328,
- 'HKD' => 344,
- 'HNL' => 340,
- 'HRK' => 191,
- 'HTG' => 332,
- 'HUF' => 348,
- 'IDR' => 360,
- 'ILS' => 376,
- 'INR' => 356,
- 'IQD' => 368,
- 'JMD' => 388,
- 'JOD' => 400,
- 'JPY' => 392,
- 'KES' => 404,
- 'KHR' => 116,
- 'KRW' => 410,
- 'KWD' => 414,
- 'KYD' => 136,
- 'KZT' => 398,
- 'LBP' => 422,
- 'LKR' => 144,
- 'LSL' => 426,
- 'LTL' => 440,
- 'LVL' => 428,
- 'MAD' => 504,
- 'MKD' => 807,
- 'MNT' => 496,
- 'MOP' => 446,
- 'MRO' => 478,
- 'MUR' => 480,
- 'MVR' => 462,
- 'MWK' => 454,
- 'MXN' => 484,
- 'MYR' => 458,
- 'MZN' => 943,
- 'NAD' => 516,
- 'NGN' => 566,
- 'NIO' => 558,
- 'NOK' => 578,
- 'NPR' => 524,
- 'NZD' => 554,
- 'OMR' => 512,
- 'PAB' => 590,
- 'PEN' => 604,
- 'PGK' => 598,
- 'PHP' => 608,
- 'PKR' => 586,
- 'PLN' => 985,
- 'PYG' => 600,
- 'QAR' => 634,
- 'RON' => 946,
- 'RSD' => 941,
- 'RUB' => 643,
- 'RWF' => 646,
- 'SAR' => 682,
- 'SCR' => 690,
- 'SEK' => 752,
- 'SGD' => 702,
- 'SLL' => 694,
- 'SVC' => 222,
- 'SYP' => 760,
- 'SZL' => 748,
- 'THB' => 764,
- 'TND' => 788,
- 'TRY' => 949,
- 'TTD' => 780,
- 'TWD' => 901,
- 'TZS' => 834,
- 'UAH' => 980,
- 'USD' => 840,
- 'UYU' => 858,
- 'UZS' => 860,
- 'VEF' => 937,
- 'XAF' => 950,
- 'XCD' => 951,
- 'XOF' => 952,
- 'XPF' => 953,
- 'YER' => 886,
- 'ZAR' => 710,
- 'ZMK' => 894,
- );
- $flipped = array_flip($CURRENCY_CODES);
+ $flipped = array_flip(WorldPayAdapter::$CURRENCY_CODES);
}
if (array_key_exists($number, $flipped)) {
return $flipped[$number];
--
To view, visit https://gerrit.wikimedia.org/r/178966
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I65543342b4f2a9b8ace5d9624ff18d4f181505c9
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits