Context: This is part of the Form Chooser refactor because we want to get rid of the ffname data object and the error form configuration in DonationInterfaceFormSettings.
Passing around ffname shouldn't be necessary - move logic from the error page config in DonationInterfaceFormSettings and FormChooser::getBestErrorForm to MustacheErrorForm
A good first step in this ticket would be to make MustacheErrorForm::addMessageParameters not depend on ffname. It can instead use a series of if tests of e.g. $this->adapter->getFinalStatus() to determine which string to show. Note that the 'noform' string is likely unreachable at that point, as the MustacheErrorForm needs a gateway object to be rendered. The 'maintenance' form should be shown when $wgDonationInterfaceFundraiserMaintenance is set to true.
While we are refactoring the fail pages, we can also simplify them a bit so our dev sites always work the same as production.
There has historically been a 'RapidFail' global that when true instructs DI to render error pages as mustache forms in the current request. When false, DI consults the 'FailPage' global and assumes that is the title of a wiki page to redirect donors to on error.
This refactor should remove the 'RapidFail' global and always render a mustache form. The DonationInterfaceFailPage global should be removed.
Other functions that will need changes, with suggestions:
GatewayPage::displayFailPage: if $this->adapter does exist, call $this->adapter->addRequestData( [ 'showError' => true ] ); rather than ResultPages::getFailPage. When the adapter does not exist, call $this->getOutput()->showErrorPage with the default error message, similar to what we already do in GatewayFormChooser when there is no form chosen.
GatewayAdapter::getFormClass: stop looking at ffname substrings - if the showError request parameter is true, return MustacheErrorForm, otherwise Gateway_Form_Mustache
Anywhere we are calling ResultPages::getFailPage to get a fail page URL to use from client-side logic (i.e. Adyen Checkout), make a simple boolean querystring value (e.g. showError=1) trigger showing the error page instead of a payments form. This way the client-side logic doesn't need to consult a mwConfig value for the url - it can just reload the existing page with that extra querystring value appended.