MediaWiki  fundraising/REL1_31
extensions/DonationInterface/README.txt File Reference

Functions

preferably for a single gateway When log verbose cURL output (including IPs resolved) at info level. $wgDonationInterfaceCurlVerboseLog
 

Variables

All of this extension s globals can be overridden on a per gateway basis by adding a setting with the same but with DonationInterface replaced with the gateway s name To override $wgDonationInterfaceUseSyslog just for add $wgAdyenGatewayUseSyslog = true
 
preferably for a single gateway When log verbose cURL also log the json blob gateway forms will try to convert amounts in unsupported currencies to the fallback instead of just showing an unsupported currency error $wgDonationInterfaceFallbackCurrency
 
preferably for a single gateway When log verbose cURL also log the json blob gateway forms will try to convert amounts in unsupported currencies to the fallback instead of just showing an unsupported currency error you can instead set this variable to true to make gateway forms use an appropriate fallback currency for the selected country $wgDonationInterfaceFallbackCurrencyByCountry
 
preferably for a single gateway When log verbose cURL also log the json blob $wgDonationInterfaceLogCompleted
 
The full URL for Javascript disabled credit card form redirect $wgDonationInterfaceNoScriptRedirect
 
preferably for a single gateway When log verbose cURL also log the json blob gateway forms will try to convert amounts in unsupported currencies to the fallback instead of just showing an unsupported currency error you can instead set this variable to true to make gateway forms use an appropriate fallback currency for the selected country we show an interstitial page notifying the user of the conversion before sending the donation to the gateway $wgDonationInterfaceNotifyOnConvert
 
to LocalSettings php Some configuration options and default values follow To change the add a line to LocalSettings php with the new value Set these to true to enable each payment processor do it this number of times $wgDonationInterfaceRetryLoopCount
 
preferably for a single gateway When log verbose cURL also log the json blob gateway forms will try to convert amounts in unsupported currencies to the fallback instead of just showing an unsupported currency error you can instead set this variable to true to make gateway forms use an appropriate fallback currency for the selected country we show an interstitial page notifying the user of the conversion before sending the donation to the gateway and a donor has provided their email address and opted in to receive send a message to the opt in queue even on payment failure $wgDonationInterfaceSendOptInOnFailure
 
to LocalSettings php Some configuration options and default values follow To change the add a line to LocalSettings php with the new value Set these to true to enable each payment processor do it this number of times alters various behavior $wgDonationInterfaceTest
 
All of this extension s globals can be overridden on a per gateway basis by adding a setting with the same but with DonationInterface replaced with the gateway s name To override $wgDonationInterfaceUseSyslog just for Adyen
 
to LocalSettings php Some configuration options and default values follow To change the add a line to LocalSettings php with the new value Set these to true to enable each payment processor do it this number of times alters various behavior add this to your SmashPig configuration under key please see DonationInterfaceFormSettings php Title to transclude in form template as
 
to LocalSettings php Some configuration options and default values follow To change the add a line to LocalSettings php with the new value Set these to true to enable each payment processor do it this number of times alters various behavior add this to your SmashPig configuration under key cache
 
to LocalSettings php Some configuration options and default values follow To change the add a line to LocalSettings php with the new value Set these to true to enable each payment processor do it this number of times alters various behavior Caching
 
to LocalSettings php Some configuration options and default values follow To change the defaults
 
preferably for a single gateway When log verbose cURL also log the json blob gateway forms will try to convert amounts in unsupported currencies to the fallback instead of just showing an unsupported currency error you can instead set this variable to true to make gateway forms use an appropriate fallback currency for the selected country we show an interstitial page notifying the user of the conversion before sending the donation to the gateway and a donor has provided their email address and opted in to receive emails
 
Donation Interface To install the DonationInterface extension
 
to LocalSettings php Some configuration options and default values follow To change the add a line to LocalSettings php with the new value Set these to true to enable each payment processor do it this number of times alters various behavior add this to your SmashPig configuration under key please see DonationInterfaceFormSettings php Title to transclude in form template FIXME
 
to LocalSettings php Some configuration options and default values follow To change the add a line to LocalSettings php with the new value Set these to true to enable each payment processor integration
 
All of this extension s globals can be overridden on a per gateway basis by adding a setting with the same name
 
Donation Interface To install the DonationInterface put the following line in LocalSettings php
 
preferably for a single gateway When true
 

Function Documentation

◆ output()

preferably for a single gateway When log verbose cURL output ( including IPs  resolved)

Variable Documentation

◆ $wgAdyenGatewayUseSyslog

All of this extension s globals can be overridden on a per gateway basis by adding a setting with the same but with DonationInterface replaced with the gateway s name To override $wgDonationInterfaceUseSyslog just for add $wgAdyenGatewayUseSyslog = true

Definition at line 10 of file README.txt.

◆ $wgDonationInterfaceFallbackCurrency

preferably for a single gateway When log verbose cURL also log the json blob gateway forms will try to convert amounts in unsupported currencies to the fallback instead of just showing an unsupported currency error $wgDonationInterfaceFallbackCurrency
Initial value:
= false
For a gateway that has exactly one valid currency per supported country
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global then executing the whole list after the page is displayed We don t do anything smart like collating updates to the same table or such because the list is almost always going to have just one item on if that
Definition: deferred.txt:13
</source > ! result< div class="mw-highlight mw-content-ltr" dir="ltr">< pre >< span ></span >< span class="kd"> var</span >< span class="nx"> a</span >< span class="p"></span ></pre ></div > ! end ! test Multiline< source/> in lists !input *< source > a b</source > *foo< source > a b</source > ! html< ul >< li >< div class="mw-highlight mw-content-ltr" dir="ltr">< pre > a b</pre ></div ></li ></ul >< ul >< li > foo< div class="mw-highlight mw-content-ltr" dir="ltr">< pre > a b</pre ></div ></li ></ul > ! html tidy< ul >< li >< div class="mw-highlight mw-content-ltr" dir="ltr">< pre > a b</pre ></div ></li ></ul >< ul >< li > foo< div class="mw-highlight mw-content-ltr" dir="ltr">< pre > a b</pre ></div ></li ></ul > ! end ! test Custom attributes !input< source lang="javascript" id="foo" class="bar" dir="rtl" style="font-size: larger;"> var a
Definition: parserTests.txt:89

Definition at line 203 of file README.txt.

◆ $wgDonationInterfaceFallbackCurrencyByCountry

preferably for a single gateway When log verbose cURL also log the json blob gateway forms will try to convert amounts in unsupported currencies to the fallback instead of just showing an unsupported currency error you can instead set this variable to true to make gateway forms use an appropriate fallback currency for the selected country $wgDonationInterfaceFallbackCurrencyByCountry
Initial value:
= false
When this is true and an unsupported currency has been converted to the
fallback (see above)
within a display generated by the Derivative if and wherever such third party notices normally appear The contents of the NOTICE file are for informational purposes only and do not modify the License You may add Your own attribution notices within Derivative Works that You alongside or as an addendum to the NOTICE text from the provided that such additional attribution notices cannot be construed as modifying the License You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for or distribution of Your or for any such Derivative Works as a provided Your and distribution of the Work otherwise complies with the conditions stated in this License Submission of Contributions Unless You explicitly state any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this without any additional terms or conditions Notwithstanding the above
and(b) You must cause any modified files to carry prominent notices stating that You changed the files
Some information about database access in MediaWiki By Tim January Database layout For information about the MediaWiki database such as a description of the tables and their please see
Definition: database.txt:18
We use the convention $dbr for read and $dbw for write to help you keep track of whether the database object is a the world will explode Or to be a subsequent write query which succeeded on the master may fail when replicated to the slave due to a unique key collision Replication on the slave will stop and it may take hours to repair the database and get it back online Setting read_only in my cnf on the slave will avoid this but given the dire we prefer to have as many checks as possible We provide a but the wrapper functions like please read the documentation for except in special pages derived from QueryPage It s a common pitfall for new developers to submit code containing SQL queries which examine huge numbers of rows Remember that COUNT * is(N), counting rows in atable is like counting beans in a bucket.------------------------------------------------------------------------ Replication------------------------------------------------------------------------The largest installation of MediaWiki, Wikimedia, uses a large set ofslave MySQL servers replicating writes made to a master MySQL server. Itis important to understand the issues associated with this setup if youwant to write code destined for Wikipedia.It 's often the case that the best algorithm to use for a given taskdepends on whether or not replication is in use. Due to our unabashedWikipedia-centrism, we often just use the replication-friendly version, but if you like, you can use wfGetLB() ->getServerCount() > 1 tocheck to see if replication is in use.===Lag===Lag primarily occurs when large write queries are sent to the master.Writes on the master are executed in parallel, but they are executed inserial when they are replicated to the slaves. The master writes thequery to the binlog when the transaction is committed. The slaves pollthe binlog and start executing the query as soon as it appears. They canservice reads while they are performing a write query, but will not readanything more from the binlog and thus will perform no more writes. Thismeans that if the write query runs for a long time, the slaves will lagbehind the master for the time it takes for the write query to complete.Lag can be exacerbated by high read load. MediaWiki 's load balancer willstop sending reads to a slave when it is lagged by more than 30 seconds.If the load ratios are set incorrectly, or if there is too much loadgenerally, this may lead to a slave permanently hovering around 30seconds lag.If all slaves are lagged by more than 30 seconds, MediaWiki will stopwriting to the database. All edits and other write operations will berefused, with an error returned to the user. This gives the slaves achance to catch up. Before we had this mechanism, the slaves wouldregularly lag by several minutes, making review of recent editsdifficult.In addition to this, MediaWiki attempts to ensure that the user seesevents occurring on the wiki in chronological order. A few seconds of lagcan be tolerated, as long as the user sees a consistent picture fromsubsequent requests. This is done by saving the master binlog positionin the session, and then at the start of each request, waiting for theslave to catch up to that position before doing any reads from it. Ifthis wait times out, reads are allowed anyway, but the request isconsidered to be in "lagged slave mode". Lagged slave mode can bechecked by calling wfGetLB() ->getLaggedSlaveMode(). The onlypractical consequence at present is a warning displayed in the pagefooter.===Lag avoidance===To avoid excessive lag, queries which write large numbers of rows shouldbe split up, generally to write one row at a time. Multi-row INSERT ...SELECT queries are the worst offenders should be avoided altogether.Instead do the select first and then the insert.===Working with lag===Despite our best efforts, it 's not practical to guarantee a low-lagenvironment. Lag will usually be less than one second, but mayoccasionally be up to 30 seconds. For scalability, it 's very importantto keep load on the master low, so simply sending all your queries tothe master is not the answer. So when you have a genuine need forup-to-date data, the following approach is advised:1) Do a quick query to the master for a sequence number or timestamp 2) Run the full query on the slave and check if it matches the data you gotfrom the master 3) If it doesn 't, run the full query on the masterTo avoid swamping the master every time the slaves lag, use of thisapproach should be kept to a minimum. In most cases you should just readfrom the slave and let the user deal with the delay.------------------------------------------------------------------------ Lock contention------------------------------------------------------------------------Due to the high write rate on Wikipedia(and some other wikis), MediaWiki developers need to be very careful to structure their writesto avoid long-lasting locks. By default, MediaWiki opens a transactionat the first query, and commits it before the output is sent. Locks willbe held from the time when the query is done until the commit. So youcan reduce lock time by doing as much processing as possible before youdo your write queries.Often this approach is not good enough, and it becomes necessary toenclose small groups of queries in their own transaction. Use thefollowing syntax:$dbw=wfGetDB(DB_MASTER

Definition at line 208 of file README.txt.

◆ $wgDonationInterfaceLogCompleted

preferably for a single gateway When log verbose cURL also log the json blob $wgDonationInterfaceLogCompleted
Initial value:
= false
==== Currency and amounts ====
Configure price ceiling and floor for valid contribution amount. Values
should be in USD.
$wgDonationInterfacePriceFloor = 1.00
$wgDonationInterfacePriceCeiling = 10000.00
If set to a currency code
and how to run hooks for an and one after Each event has a preferably in CamelCase For ArticleDelete hook A clump of code and data that should be run when an event happens This can be either a function and a chunk of or an object and a method hook function The function part of a third party developers and administrators to define code that will be run at certain points in the mainline code
Definition: hooks.txt:28
null for the wiki Added in
Definition: hooks.txt:1591

Definition at line 190 of file README.txt.

◆ $wgDonationInterfaceNoScriptRedirect

The full URL for Javascript disabled credit card form redirect $wgDonationInterfaceNoScriptRedirect
Initial value:
= null
Dummy email address associated with donation if donor does not provide one
$wgDonationInterfaceDefaultEmail = 'nobody@wikimedia.org'
$wgDonationInterfaceRapidFail = false
$wgDonationInterfaceThankYouPage = 'Donate-thanks'
$wgDonationInterfaceFailPage = 'Donate-error'
$wgDonationInterfaceCancelPage = 'Donate-error'
$wgDonationInterfaceLocalConfigurationDirectory = false
$wgDonationInterfaceVariantConfigurationDirectory = false
$wgDonationInterfaceLogoOverride = []

Definition at line 109 of file README.txt.

◆ $wgDonationInterfaceNotifyOnConvert

preferably for a single gateway When log verbose cURL also log the json blob gateway forms will try to convert amounts in unsupported currencies to the fallback instead of just showing an unsupported currency error you can instead set this variable to true to make gateway forms use an appropriate fallback currency for the selected country we show an interstitial page notifying the user of the conversion before sending the donation to the gateway $wgDonationInterfaceNotifyOnConvert
Initial value:
= true
When this is true

Definition at line 213 of file README.txt.

◆ $wgDonationInterfaceRetryLoopCount

to LocalSettings php Some configuration options and default values follow To change the add a line to LocalSettings php with the new value Set these to true to enable each payment processor do it this number of times $wgDonationInterfaceRetryLoopCount
Initial value:
= 3
Number of seconds to wait for a response from processor API endpoints
$wgDonationInterfaceTimeout = 5
Test mode flag
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation and configuration files Object form shall mean any form resulting from mechanical transformation or translation of a Source including but not limited to compiled object generated and conversions to other media types Work shall mean the work of whether in Source or Object made available under the as indicated by a copyright notice that is included in or attached to the whether in Source or Object that is based or other modifications as a an original work of authorship For the purposes of this Derivative Works shall not include works that remain separable from
globals txt Globals are evil The original MediaWiki code relied on globals for processing context far too often MediaWiki development since then has been a story of slowly moving context out of global variables and into objects Storing processing context in object member variables allows those objects to be reused in a much more flexible way Consider the elegance of
database rows
Definition: globals.txt:10

Definition at line 32 of file README.txt.

◆ $wgDonationInterfaceSendOptInOnFailure

preferably for a single gateway When log verbose cURL also log the json blob gateway forms will try to convert amounts in unsupported currencies to the fallback instead of just showing an unsupported currency error you can instead set this variable to true to make gateway forms use an appropriate fallback currency for the selected country we show an interstitial page notifying the user of the conversion before sending the donation to the gateway and a donor has provided their email address and opted in to receive send a message to the opt in queue even on payment failure $wgDonationInterfaceSendOptInOnFailure
Initial value:
= false
==== Processors and accounts ====
$wgGlobalCollectGatewayTestingURL = 'https:
$wgGlobalCollectGatewayURL = 'https:
$wgGlobalCollectGatewayCvvMap = [
'M' => true
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at https
Definition: design.txt:12

Definition at line 218 of file README.txt.

◆ $wgDonationInterfaceTest

to LocalSettings php Some configuration options and default values follow To change the add a line to LocalSettings php with the new value Set these to true to enable each payment processor do it this number of times alters various behavior $wgDonationInterfaceTest
Initial value:
= false
$wgDonationInterfaceEnableFormChooser = false
$wgDonationInterfaceSalt = $wgSecretKey
$wgDonationInterface3DSRules = [
'INR' => []
$wgSecretKey
This should always be customised in LocalSettings.php.

Definition at line 38 of file README.txt.

Referenced by DonationInterface::registerExtension().

◆ Adyen

All of this extension s globals can be overridden on a per gateway basis by adding a setting with the same but with DonationInterface replaced with the gateway s name To override $wgDonationInterfaceUseSyslog just for Adyen

Definition at line 9 of file README.txt.

◆ as

to LocalSettings php Some configuration options and default values follow To change the add a line to LocalSettings php with the new value Set these to true to enable each payment processor do it this number of times alters various behavior add this to your SmashPig configuration under key please see DonationInterfaceFormSettings php Title to transclude in form template as
Initial value:
{{{ appeal_text }}}.
$appeal and $language will be substituted before transclusion
$wgDonationInterfaceAppealWikiTemplate = 'LanguageSwitch|2011FR/$appeal/text|$language'
Used as the value for $appeal when nothing is given in query string
$wgDonationInterfaceDefaultAppeal = 'JimmyQuote'
$language and $country will be substituted in the next four URLs
URL of a page for donors who encounter problems
$wgDonationInterfaceProblemsURL = 'https:
URL of a page listing alternate ways to give.
$wgDonationInterfaceOtherWaysURL = 'https:
URL of your organizations FAQ page for donors
target page
</td >< td > &</td >< td > t want your writing to be edited mercilessly and redistributed at will
For a write query
Definition: database.txt:26
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add in any and then calling but I prefer the flexibility This should also do the output encoding The system allocates a global one in $wgOut Title Represents the title of an and does all the work of translating among various forms such as plain URL
Definition: design.txt:26
to LocalSettings php Some configuration options and default values follow To change the add a line to LocalSettings php with the new value Set these to true to enable each payment processor do it this number of times alters various behavior add this to your SmashPig configuration under key please see DonationInterfaceFormSettings php Title to transclude in form template as
Definition: README.txt:77

Definition at line 77 of file README.txt.

◆ cache

to LocalSettings php Some configuration options and default values follow To change the add a line to LocalSettings php with the new value Set these to true to enable each payment processor do it this number of times alters various behavior add this to your SmashPig configuration under key cache

Definition at line 64 of file README.txt.

◆ Caching

to LocalSettings php Some configuration options and default values follow To change the add a line to LocalSettings php with the new value Set these to true to enable each payment processor do it this number of times alters various behavior Caching

Definition at line 62 of file README.txt.

◆ defaults

to LocalSettings php Some configuration options and default values follow To change the defaults

Definition at line 14 of file README.txt.

◆ emails

preferably for a single gateway When log verbose cURL also log the json blob gateway forms will try to convert amounts in unsupported currencies to the fallback instead of just showing an unsupported currency error you can instead set this variable to true to make gateway forms use an appropriate fallback currency for the selected country we show an interstitial page notifying the user of the conversion before sending the donation to the gateway and a donor has provided their email address and opted in to receive emails

Definition at line 216 of file README.txt.

◆ extension

◆ FIXME

to LocalSettings php Some configuration options and default values follow To change the add a line to LocalSettings php with the new value Set these to true to enable each payment processor do it this number of times alters various behavior add this to your SmashPig configuration under key please see DonationInterfaceFormSettings php Title to transclude in form template FIXME

Definition at line 93 of file README.txt.

Referenced by GlobalTest::testDebugFunctionTest().

◆ integration

to LocalSettings php Some configuration options and default values follow To change the add a line to LocalSettings php with the new value Set these to true to enable each payment processor integration

Definition at line 17 of file README.txt.

◆ name

All of this extension s globals can be overridden on a per gateway basis by adding a setting with the same name

Definition at line 7 of file README.txt.

◆ php

Donation Interface To install the DonationInterface put the following line in LocalSettings php

Definition at line 3 of file README.txt.

◆ true

preferably for a single gateway When true

Definition at line 183 of file README.txt.