MediaWiki fundraising/REL1_35
adyen_checkout_gateway.body.php
Go to the documentation of this file.
1<?php
2
3use SmashPig\Core\Helpers\CurrencyRoundingHelper;
4
11
17
19
20 protected function addGatewaySpecificResources( $out ): void {
21 $script = $this->adapter->getAccountConfig( 'Script' );
22 $css = $this->adapter->getAccountConfig( 'Css' );
23 if ( $this->adapter->getPaymentMethod() == 'google' ) {
24 $googleScript = $this->adapter->getAccountConfig( 'GoogleScript' );
25 $out->addLink(
26 [
27 'src' => $googleScript,
28 'rel' => 'preload',
29 'as' => 'script',
30 ]
31 );
32 }
33 // We preload the Adyen script here, but add the actual script tag in our adyen.js
34 // so we can follow its loading using onload and onerror attributes.
35 $out->addLink(
36 [
37 'src' => $script['src'],
38 'integrity' => $script['integrity'],
39 'rel' => 'preload',
40 'as' => 'script',
41 'crossorigin' => 'anonymous',
42 ]
43 );
44 $out->addLink(
45 [
46 'rel' => 'stylesheet',
47 'href' => $css['src'],
48 'integrity' => $css['integrity'],
49 'crossorigin' => 'anonymous'
50 ]
51 );
52 }
53
54 public function setClientVariables( &$vars ) {
55 parent::setClientVariables( $vars );
56 $vars['adyenConfiguration'] = $this->adapter->getCheckoutConfiguration();
57 $failPage = GatewayChooser::buildGatewayPageUrl(
58 'adyen',
59 [ 'showError' => true ],
60 $this->getConfig()
61 );
62 $vars['DonationInterfaceFailUrl'] = $failPage;
63 $vars['DonationInterfaceThankYouPage'] = ResultPages::getThankYouPage( $this->adapter );
64 $vars['DonationInterfaceThreeDecimalCurrencies'] = CurrencyRoundingHelper::$threeDecimalCurrencies;
65 $vars['DonationInterfaceNoDecimalCurrencies'] = CurrencyRoundingHelper::$noDecimalCurrencies;
66 $vars['DonationInterfaceOtherWaysURL'] = $this->adapter->localizeGlobal( 'OtherWaysURL' );
67 }
68
76 public function showSubmethodButtons() {
77 return false;
78 }
79
87 public function showContinueButton() {
88 return false;
89 }
90}
showContinueButton()
Overrides parent function to return false.
showSubmethodButtons()
Overrides parent function to return false.
bool $supportsMonthlyConvert
flag for setting Monthly Convert modal on template
setClientVariables(&$vars)
MakeGlobalVariablesScript handler, sends settings to Javascript.
GatewayPage This class is the generic unlisted special page in charge of actually displaying the form...
static getThankYouPage(GatewayType $adapter, $extraParams=[])
Get the URL for a page to show donors after a successful donation, with the country code appended as ...