Extension:ContributionTracking
|
ContributionTracking Release status: unknown |
|||
|---|---|---|---|
| Implementation | Special page | ||
| Description | Contribution tracking for the Wikimedia fundraiser | ||
| Author(s) | David Strauss, Katie Horn (Khorn (WMF)talk) | ||
| Last version | SVN | ||
| License | No license specified | ||
| Download | |||
|
|||
| Check usage and version matrix; stats | |||
ContributionTracking provides contribution tracking for the Wikimedia fundraiser.
It includes two unlisted special pages: Special:ContributionTracking and Special:ContributionTrackingTester (sysop only).
It supports two payment gateways, w:PayPal and w:Moneybookers (largely deprecated).
Setup[edit]
Download the extension, put
require_once( "$IP/extensions/ContributionTracking/ContributionTracking.php" );
into your LocalSettings.php file, then run
alter table <prefix>contribution_tracking modify anonymous tinyint(1) unsigned default null, modify optout tinyint(1) unsigned default null;
on your database. Be sure to replace <prefix> with your wiki's database table prefix.
API[edit]
The purpose of the ContributionTracking API is to remove the interstitial page between the user-facing donate button, and the remote gateway. Instead of posting the whole transaction to a page, the form data is sent to the API via ajax. The API records the tracking data, and returns a json object that can be used to build a hidden form, and immediately repost that hidden form to the remote gateway.
For a working end-to-end demonstration of this technique, see Special:ContributionTrackingTester. The available form fields are pulled dynamically from the API's AllowedParams, so it will always show all available field options. (Note: Any additional fields posted to the API will be summarily ignored)
As on the ContributionTrackingTester page, all that is necessary to use the API to remove the interstitial page between a gateway form and the remote gateway, are the two following changes: To add the jquery.contributionTracking module which handles the ajax and hidden repost form, add the following line to the php form's execute method:
$wgOut->addModules( 'jquery.contributionTracking' );
Then, add the class "ajax_me" to the relevant form's submit button. Once that is done, the button's parent form will be under the control of the included jquery.contributionTracking module.
See also[edit]
| This extension is being used on one or more Wikimedia projects. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia's CommonSettings.php and InitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki's Special:Version page. |