Mwalker has uploaded a new change for review. https://gerrit.wikimedia.org/r/109119
Change subject: Initial commit on the REL1_22 fundraising branch ...................................................................... Initial commit on the REL1_22 fundraising branch * submodules are the same as in fundraising/1.22 * gitreview file points to this branch * imported DonationInterfaceFormSettings.php from fundraising/1.22 Change-Id: Ic2d11ad1ddd34066f80775d5f2ff8c8d8292d968 --- A .gitmodules M .gitreview A DonationInterfaceFormSettings.php M extensions/.gitignore A extensions/ContributionTracking A extensions/DonationEmailUnsubscribe A extensions/DonationInterface A extensions/ParserFunctions A extensions/cldr 9 files changed, 515 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/19/109119/1 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..4f7c624 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,15 @@ +[submodule "extensions/DonationInterface"] + path = extensions/DonationInterface + url = https://gerrit.wikimedia.org/r/p/mediawiki/extensions/DonationInterface.git +[submodule "extensions/ContributionTracking"] + path = extensions/ContributionTracking + url = https://gerrit.wikimedia.org/r/p/mediawiki/extensions/ContributionTracking.git +[submodule "extensions/ParserFunctions"] + path = extensions/ParserFunctions + url = https://gerrit.wikimedia.org/r/p/mediawiki/extensions/ParserFunctions.git +[submodule "extensions/DonationEmailUnsubscribe"] + path = extensions/DonationEmailUnsubscribe + url = https://gerrit.wikimedia.org/r/p/mediawiki/extensions/FundraisingEmailUnsubscribe.git +[submodule "extensions/cldr"] + path = extensions/cldr + url = https://gerrit.wikimedia.org/r/p/mediawiki/extensions/cldr.git diff --git a/.gitreview b/.gitreview index bb83fd3..7266e3b 100644 --- a/.gitreview +++ b/.gitreview @@ -2,5 +2,5 @@ host=gerrit.wikimedia.org port=29418 project=mediawiki/core.git -defaultbranch=REL1_22 +defaultbranch=fundraising/REL1_22 defaultrebase=0 diff --git a/DonationInterfaceFormSettings.php b/DonationInterfaceFormSettings.php new file mode 100644 index 0000000..49323ec --- /dev/null +++ b/DonationInterfaceFormSettings.php @@ -0,0 +1,499 @@ +<?php + +/** + * Some setup vars to make our lives a little easier. + * These are unset at the end of the file. + */ +$forms_whitelist = array(); +$form_dirs = array( + 'default' => $wgDonationInterfaceHtmlFormDir, + 'gc' => $wgGlobalCollectGatewayHtmlFormDir, + 'paypal' => $wgPaypalGatewayHtmlFormDir, + 'amazon' => $wgAmazonGatewayHtmlFormDir, +// 'pfp' => $wgPayflowProGatewayHtmlFormDir, +); + +// If it's not enabled we don't ever set this variable. +if ( $wgDonationInterfaceEnableAdyen === true ) { + $form_dirs['adyen'] = $wgAdyenGatewayHtmlFormDir; +} + +/********** + * Amazon * + **********/ +$forms_whitelist['amazon'] = array( + 'file' => $form_dirs['amazon'] . '/amazon.html', + 'gateway' => 'amazon', + 'countries' => array( '+' => 'US',), + 'currencies' => array( '+' => 'USD',), + 'payment_methods' => array('amazon' => 'ALL'), + 'redirect', +); + +$forms_whitelist['amazon-recurring'] = array( + 'file' => $form_dirs['amazon'] . '/amazon-recurring.html', + 'gateway' => 'amazon', + 'countries' => array( '+' => 'US',), + 'currencies' => array( '+' => 'USD',), + 'payment_methods' => array('amazon' => 'ALL'), + 'redirect', + 'recurring', +); + +/**************************** + * Bank Transfer - Two-Step * + ****************************/ + +$forms_whitelist['bt'] = array( + 'file' => $form_dirs['gc'] . '/bt/bt.html', + 'gateway' => 'globalcollect', + 'countries' => array( + '-' => 'VN', + ), + 'currencies' => array( + '+' => array('AED', 'BGN', 'BHD', 'CAD', 'CLP', 'CZK', 'DKK', 'EEK', 'EGP', 'EUR', 'HRK', + 'HUF', 'IDR', 'JPY', 'LBP', 'MXN', 'MYR', 'NOK', 'NZD', 'PEN', 'PLN', + 'QAR', 'RON', 'RUB', 'SEK', 'THB', 'TRY', 'TWD', 'USD', 'ZAR'), + ), + 'payment_methods' => array('bt' => 'ALL') +); + + +/**************** + * Direct Debit * + ****************/ +$forms_whitelist['dd'] = array( + 'file' => $form_dirs['gc'] . '/dd/dd.html', + 'gateway' => 'globalcollect', + 'countries' => array( + '+' => array('AT', 'DE', 'ES', 'NL'), + ), + 'payment_methods' => array('dd' => 'ALL') +); + +$forms_whitelist['dd-recurring'] = array_merge( + $forms_whitelist['dd'], + array( + 'file' => $form_dirs['gc'] . '/dd/dd-recurring.html', + 'recurring', + ) +); + +/********************* + * Electronic Wallet * + *********************/ + +$forms_whitelist['ew-webmoney'] = array( + 'file' => $form_dirs['gc'] . '/ew/ew-webmoney.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('ew' => 'ew_webmoney'), + 'countries' => array( '+' => array( 'FI', 'RU' ), ), + 'currencies' => array( '+' => array( 'EUR', 'RUB' ), ), +); + +$forms_whitelist['ew-yandex'] = array( + 'file' => $form_dirs['gc'] . '/ew/ew-yandex.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('ew' => 'ew_yandex'), + 'countries' => array( '+' => array( 'RU', ), ), + 'currencies' => array( '+' => array( 'RUB', ), ), +); + + +/******************************* + * RealTime Banking - Two Step * + *******************************/ + +$forms_whitelist['rtbt-sofo'] = array( + 'file' => $form_dirs['gc'] . '/rtbt/rtbt-sofo.html', + 'gateway' => 'globalcollect', + 'countries' => array( + '+' => array( 'AT', 'BE', 'CH', 'DE' ), + '-' => 'GB' + ), + 'currencies' => array( '+' => 'EUR' ), + 'payment_methods' => array('rtbt' => 'rtbt_sofortuberweisung'), +); + +$forms_whitelist['rtbt-sofo-GB'] = array( + 'file' => $form_dirs['gc'] . '/rtbt/rtbt-sofo-GB.html', + 'gateway' => 'globalcollect', + 'countries' => array( '+' => 'GB' ), + 'currencies' => array( '+' => 'GBP' ), + 'payment_methods' => array('rtbt' => 'rtbt_sofortuberweisung') +); + +$forms_whitelist['rtbt-ideal'] = array( + 'file' => $form_dirs['gc'] . '/rtbt/rtbt-ideal.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('rtbt' => 'rtbt_ideal'), + 'countries' => array( '+' => 'NL' ), + 'currencies' => array( '+' => 'EUR' ), +); + +$forms_whitelist['rtbt-enets'] = array( + 'file' => $form_dirs['gc'] . '/rtbt/rtbt-enets.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('rtbt' => 'rtbt_enets'), + 'countries' => array( '+' => 'SG' ), + 'currencies' => array( '+' => 'SGD' ), +); + +/* +$forms_whitelist['rtbt-eps'] = array( + 'file' => $form_dirs['gc'] . '/rtbt/rtbt-eps.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('rtbt' => 'rtbt_eps') +); +*/ + +$forms_whitelist['rtbt-ideal-noadd'] = array( + 'file' => $form_dirs['gc'] . '/rtbt/rtbt-ideal-noadd.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('rtbt' => 'rtbt_ideal'), + 'countries' => array( '+' => 'NL' ), + 'currencies' => array( '+' => 'EUR' ), +); + + +/******** + * BPAY * + ********/ + +$forms_whitelist['obt-bpay'] = array( + 'file' => $form_dirs['gc'] . '/obt/obt-bpay.html', + 'gateway' => 'globalcollect', + 'countries' => array( '+' => 'AU'), + 'currencies' => array( '+' => 'AUD'), + 'payment_methods' => array('obt' => 'bpay') +); + +/***************************** + * Credit Card - Single Step * + *****************************/ +/* +$forms_whitelist['webitects_2_3step'] = array( + 'file' => $form_dirs['gc'] . '/webitects_2_3step.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('cc' => array( 'visa', 'mc' )) +); + +$forms_whitelist['webitects_2_3step-CA'] = array( + 'file' => $form_dirs['gc'] . '/webitects_2_3step-CA.html', + 'gateway' => 'globalcollect', + 'countries' => array( '+' => 'CA' ), + 'payment_methods' => array('cc' => array( 'visa', 'mc' )) +); + +$forms_whitelist['webitects_2_3stepB-US'] = array( + 'file' => $form_dirs['gc'] . '/webitects_2_3stepB-US.html', + 'gateway' => 'globalcollect', + 'countries' => array( '+' => 'US' ), + 'payment_methods' => array('cc' => array( 'visa', 'mc' )) +); +*/ + + +/************************** + * Credit Card - Two Step * + **************************/ + +$forms_whitelist['webitects2nd'] = array( + 'file' => $form_dirs['gc'] . '/webitects2nd.html', + 'gateway' => 'globalcollect', +// 'payment_methods' => array('cc' => array( 'visa', 'mc' )) +); + +$forms_whitelist['webitects2nd-US'] = array( + 'file' => $form_dirs['gc'] . '/webitects2nd-US.html', + 'gateway' => 'globalcollect', +// 'payment_methods' => array('cc' => array( 'visa', 'mc' )) +); + +$forms_whitelist['webitects2nd_green-US'] = array( + 'file' => $form_dirs['gc'] . '/webitects2nd_green-US.html', + 'gateway' => 'globalcollect', +// 'payment_methods' => array('cc' => array( 'visa', 'mc' )) +); + +$forms_whitelist['webitects2nd-amex'] = array( + 'file' => $form_dirs['gc'] . '/webitects2nd-amex.html', + 'gateway' => 'globalcollect', +// 'payment_methods' => array('cc' => array( 'visa', 'mc', 'amex' )) +); + + +/********************** + * Credit Card - Misc * + **********************/ + +$forms_whitelist['cc-vmad'] = array( + 'file' => $form_dirs['gc'] . '/cc/cc-vmad.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('cc' => array( 'visa', 'mc', 'amex', 'discover' )), + 'countries' => array( + '+' => array( 'US', ), + ), +); + +$forms_whitelist['cc-vmaj'] = array( + 'file' => $form_dirs['gc'] . '/cc/cc-vmaj.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('cc' => array( 'visa', 'mc', 'amex', 'jcb' )), + 'countries' => array( + '+' => array( 'AD', 'AT', 'AU', 'BE', 'BH', 'DE', 'EC', 'ES', 'FI', 'FR', 'GB', + 'GF', 'GR', 'HK', 'IE', 'IT', 'JP', 'KR', 'LU', 'MY', 'NL', 'PR', + 'PT', 'SG', 'SI', 'SK', 'TH', 'TW', ), + ), +); + +$forms_whitelist['cc-vmd'] = array( + 'file' => $form_dirs['gc'] . '/cc/cc-vmd.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('cc' => array( 'visa', 'mc', 'discover' )), + 'countries' => array( + // Array merge with cc-vmad as fallback in case 'a' goes down + '+' => array_merge( + $forms_whitelist['cc-vmad']['countries']['+'], + array() // as of right now, nothing specific here + ), + ), +); + +$forms_whitelist['cc-vmj'] = array( + 'file' => $form_dirs['gc'] . '/cc/cc-vmj.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('cc' => array( 'visa', 'mc', 'jcb' )), + 'countries' => array( + // Array merge with cc-vmaj as fallback in case 'a' goes down + '+' => array_merge( + $forms_whitelist['cc-vmaj']['countries']['+'], + array( 'BR', 'ID', 'PH', ) + ), + ), +); + +$forms_whitelist['cc-vma'] = array( + 'file' => $form_dirs['gc'] . '/cc/cc-vma.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('cc' => array( 'visa', 'mc', 'amex' )), + 'countries' => array( + // Array merge with cc-vmaj as fallback in case 'j' goes down + // Array merge with cc-vmad as fallback in case 'd' goes down + '+' => array_merge( + $forms_whitelist['cc-vmaj']['countries']['+'], + $forms_whitelist['cc-vmad']['countries']['+'], + array( 'AE', 'AL', 'AN', 'AR', 'BG', 'CA', 'CH', 'CN', 'CR', 'CY', 'CZ', 'DK', + 'DZ', 'EE', 'EG', 'JO', 'KE', 'HR', 'HU', 'IL', 'KW', 'KZ', 'LB', 'LI', + 'LK', 'LT', 'LV', 'MA', 'MT', 'NO', 'NZ', 'OM', 'PK', 'PL', 'QA', 'RO', + 'RU', 'SA', 'SE', 'TN', 'TR', 'UA', ) + ) + ), +); + +$forms_whitelist['cc-vm'] = array( + 'file' => $form_dirs['gc'] . '/cc/cc-vm.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('cc' => array( 'visa', 'mc' )), + 'countries' => array( + // Array merge with cc-vmj as fallback in case 'j' goes down + // Array merge with cc-vmd as fallback in case 'd' goes down + '+' => array_merge( + $forms_whitelist['cc-vmj']['countries']['+'], + $forms_whitelist['cc-vmd']['countries']['+'], + array( 'AG', 'AM', 'AO', 'AS', 'AW', 'AZ', 'BA', 'BB', 'BD', 'BF', 'BI', 'BJ', + 'BM', 'BN', 'BO', 'BS', 'BW', 'BY', 'BZ', 'CF', 'CG', 'CI', 'CK', 'CL', + 'CM', 'CO', 'CV', 'DJ', 'DM', 'DO', 'ER', 'ET', 'FJ', 'FM', 'FO', 'GA', + 'GD', 'GE', 'GL', 'GM', 'GT', 'GU', 'HN', 'IN', 'IQ', 'IS', 'JM', 'KH', + 'KI', 'KM', 'KN', 'KP', 'LC', 'LR', 'LY', 'MC', 'MD', 'ME', 'MG', 'MH', + 'MK', 'ML', 'MO', 'MP', 'MR', 'MV', 'MW', 'MX', 'MZ', 'NA', 'NE', 'NG', + 'NI', 'NR', 'PA', 'PE', 'PG', 'PS', 'PW', 'PY', 'RE', 'RS', 'SB', 'SC', + 'SD', 'SM', 'SN', 'SR', 'TD', 'TG', 'TM', 'TO', 'TP', 'TT', 'TZ', 'UY', + 'UZ', 'VA', 'VC', 'VE', 'VI', 'VU', 'YE', 'ZA', 'ZM', 'ZW', ) + ), + ), +); + +$forms_whitelist['cc-a'] = array( + 'file' => $form_dirs['gc'] . '/cc/cc-a.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('cc' => array( 'amex' )), + 'countries' => array( + '+' => array_merge( + $forms_whitelist['cc-vma']['countries']['+'], + array() // as of right now, nothing specific here + ) + ), +); + +$forms_whitelist['cc'] = array( + 'file' => $form_dirs['gc'] . '/cc/cc.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('cc' => 'ALL'), + 'countries' => array('-' => 'VN') +); + +/* Special case for Vietnam while GC is still having problems. + * In the meantime: Visa & Mastercard, USD-only. + */ +$forms_whitelist['cc-vietnam'] = array ( + 'file' => $form_dirs['gc'] . '/cc/cc-vm.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array ( 'cc' => array ( 'visa', 'mc' ) ), + 'countries' => array ( '+' => 'VN' ), + 'currencies' => array ( '+' => 'USD' ), +); + + +/**************************** + * Name and Email-Only Test * + ****************************/ + +$forms_whitelist['email-cc-vmaj'] = $forms_whitelist['cc-vmaj']; +$forms_whitelist['email-cc-vma'] = $forms_whitelist['cc-vma']; +$forms_whitelist['email-cc-vm'] = $forms_whitelist['cc-vm']; + +/************************* + * Recurring Credit Card * + *************************/ + +$forms_whitelist['rcc-vmad'] = array( + 'file' => $form_dirs['gc'] . '/rcc/rcc-vmad.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('cc' => array( 'visa', 'mc', 'amex', 'discover' )), + 'recurring', + 'countries' => array( + '+' => $forms_whitelist['cc-vmad']['countries']['+'] + ) +); + +$forms_whitelist['rcc-vmaj'] = array( + 'file' => $form_dirs['gc'] . '/rcc/rcc-vmaj.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('cc' => array( 'visa', 'mc', 'amex', 'jcb' )), + 'recurring', + 'countries' => array( + '+' => $forms_whitelist['cc-vmaj']['countries']['+'] + ) +); + +$forms_whitelist['rcc-vmd'] = array( + 'file' => $form_dirs['gc'] . '/rcc/rcc-vmd.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('cc' => array( 'visa', 'mc', 'discover' )), + 'recurring', + 'countries' => array( + '+' => $forms_whitelist['cc-vmd']['countries']['+'] + ) +); + +$forms_whitelist['rcc-vmj'] = array( + 'file' => $form_dirs['gc'] . '/rcc/rcc-vmj.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('cc' => array( 'visa', 'mc', 'jcb' )), + 'recurring', + 'countries' => array( + '+' => $forms_whitelist['cc-vmj']['countries']['+'] + ) +); + +$forms_whitelist['rcc-vma'] = array( + 'file' => $form_dirs['gc'] . '/rcc/rcc-vma.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('cc' => array( 'visa', 'mc', 'amex' )), + 'recurring', + 'countries' => array( + '+' => $forms_whitelist['cc-vma']['countries']['+'] + ) +); + +$forms_whitelist['rcc-vm'] = array( + 'file' => $form_dirs['gc'] . '/rcc/rcc-vm.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('cc' => array( 'visa', 'mc' )), + 'recurring', + 'countries' => array( + '+' => $forms_whitelist['cc-vm']['countries']['+'] + ) +); + +$forms_whitelist['rcc'] = array( + 'file' => $form_dirs['gc'] . '/rcc/rcc.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('cc' => 'ALL'), + 'recurring' +); + +/************************* + * Boletos + *************************/ + +$forms_whitelist['boletos'] = array( + 'file' => $form_dirs['gc'] . '/cash/boletos.html', + 'gateway' => 'globalcollect', + 'payment_methods' => array('cash' => 'boleto'), + 'countries' => array( + '+' => array('BR'), + ), + 'currencies' => array( + '+' => array('BRL'), + ), +); + +/************************* + * Paypal + *************************/ + +$forms_whitelist['paypal'] = array( + 'file' => $form_dirs['paypal'] . '/paypal.html', + 'gateway' => 'paypal', + 'payment_methods' => array('paypal' => 'ALL'), +); + +$forms_whitelist['paypal-recurring'] = array( + 'file' => $form_dirs['paypal'] . '/paypal-recurring.html', + 'gateway' => 'paypal', + 'payment_methods' => array('paypal' => 'ALL'), + 'recurring', +); + +/********** + * Adyen * + **********/ +// This is at the bottom so that we prefer GC over adyen +if ( $wgDonationInterfaceEnableAdyen === true ) { + $forms_whitelist['adyen'] = array( + 'file' => $form_dirs['adyen'] . '/adyen.html', + 'gateway' => 'adyen', + 'countries' => array( '+' => 'US',), + 'currencies' => array( '+' => 'USD',), + 'payment_methods' => array('cc' => array( 'visa', 'mc', 'amex', 'discover' )), + 'selection_weight' => 0 + ); +} + +/* * *********** + * Error Pages * + * *********** */ + +$forms_whitelist['error-default'] = array ( + 'file' => $form_dirs['default'] . '/error-cc.html', + 'gateway' => array ( 'globalcollect', 'adyen', 'amazon', 'paypal' ), + 'special_type' => 'error', //buuuurble +); + +$forms_whitelist['error-cc'] = array ( + 'file' => $form_dirs['default'] . '/error-cc.html', + 'gateway' => array ( 'globalcollect', 'adyen' ), + 'payment_methods' => array ( 'cc' => 'ALL' ), + 'special_type' => 'error', +); + +//Yes: We definitely want to blow away everything that didn't come from this file. +$wgDonationInterfaceAllowedHtmlForms = $forms_whitelist; +$wgDonationInterfaceFormDirs = $form_dirs; + +unset( $forms_whitelist ); +unset( $form_dirs ); +unset( $wgGlobalCollectGatewayAllowedHtmlForms ); +unset( $wgPayflowProGatewayAllowedHtmlForms ); diff --git a/extensions/.gitignore b/extensions/.gitignore index f847620..e69de29 100644 --- a/extensions/.gitignore +++ b/extensions/.gitignore @@ -1,3 +0,0 @@ -* -!README -!.gitignore diff --git a/extensions/ContributionTracking b/extensions/ContributionTracking new file mode 160000 index 0000000..d46ba7d --- /dev/null +++ b/extensions/ContributionTracking +Subproject commit d46ba7de8b8975d282ea297b48532e416b5090fe diff --git a/extensions/DonationEmailUnsubscribe b/extensions/DonationEmailUnsubscribe new file mode 160000 index 0000000..73eabca --- /dev/null +++ b/extensions/DonationEmailUnsubscribe +Subproject commit 73eabca5edb9f578ebf299ac222d3a3613784e53 diff --git a/extensions/DonationInterface b/extensions/DonationInterface new file mode 160000 index 0000000..d94607f --- /dev/null +++ b/extensions/DonationInterface +Subproject commit d94607fbc6816a18b711f7a03194c53a132c9584 diff --git a/extensions/ParserFunctions b/extensions/ParserFunctions new file mode 160000 index 0000000..913be0c --- /dev/null +++ b/extensions/ParserFunctions +Subproject commit 913be0c55634fce538ff0884c1c06587179a46e9 diff --git a/extensions/cldr b/extensions/cldr new file mode 160000 index 0000000..3d0bed0 --- /dev/null +++ b/extensions/cldr +Subproject commit 3d0bed0537a96f02255c8484540e0e460fc999fa -- To view, visit https://gerrit.wikimedia.org/r/109119 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic2d11ad1ddd34066f80775d5f2ff8c8d8292d968 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_22 Gerrit-Owner: Mwalker <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
