Page MenuHomePhabricator

Clean up parameters passed from donatewiki forms
Closed, ResolvedPublic

Description

Donatewiki forms currently pass various unneeded and/or empty URL parameters to payments. We should clean these up similar to how we did for banners.

Example url from donatewiki:

https://payments.wikimedia.org/index.php/Special:GatewayFormChooser
?utm_source=fr-redir.default%7Edefault%7Edefault%7Edefault%7Econtrol.cc
&utm_medium=spontaneous
&utm_campaign=spontaneous
&utm_key=
&referrer=
&language=en
&country=US
&payment_method=cc
&payment_submethod=
&recurring=false
&gateway=
&ffname=
&amountGiven=
&currency_code=USD
&frequency=onetime
&amount=3

Example url from a banner:

https://payments.wikimedia.org/index.php/Special:GatewayFormChooser
?payment_method=cc
&recurring=false
&currency_code=USD
&uselang=en
&country=US
&amount=3
&utm_medium=sitenotice
&utm_campaign=test
&utm_source=B1819_0701_mlWW_dsk_p1_lg_template.no-LP.cc
&utm_key=0

Event Timeline

Note that doing this properly means decoupling the parameters sent from the form inputs, as we did for banners.

This comment was removed by Pcoombe.

At last, this is done! DonationForm.js diff (includes some other minor cleanup), removal of hidden inputs diff. The only remaining hidden input is for currency_code in Template:2012FR/Form-section/Radiobuttons/Default, since the currency is chosen by wikitext templates.

Sample URL from donatewiki now:

https://payments.wikimedia.org/index.php/Special:GatewayFormChooser
?payment_method=cc
&recurring=false
&currency_code=USD
&country=US
&uselang=en
&amount=3
&utm_medium=spontaneous
&utm_campaign=spontaneous
&utm_source=fr-redir.default~default~default~default~control.cc
&utm_key=vw_1440.vh_766.otherAmt_1.time_14

Much cleaner! And the code is significantly closer to what's used in banners now, so should be easier to maintain.