-
Notifications
You must be signed in to change notification settings - Fork 0
/
RockMollie.module.php
57 lines (50 loc) · 1.88 KB
/
RockMollie.module.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
namespace ProcessWire;
use Mollie\Api\MollieApiClient;
/**
* @author Bernhard Baumrock, 14.08.2020
* @license Licensed under MIT
* @link https://www.baumrock.com
*/
class RockMollie extends WireData implements Module, ConfigurableModule
{
public $api = false;
/**
* Get mollie api instance
*/
public function api(): MollieApiClient
{
if ($this->api) return $this->api;
require_once("vendor/autoload.php");
$api = new \Mollie\Api\MollieApiClient();
$api->setApiKey(wire()->config->mollieApiKey);
return $this->api = $api;
}
/**
* Config inputfields
* @param InputfieldWrapper $inputfields
*/
public function getModuleConfigInputfields($inputfields)
{
$name = strtolower($this);
$inputfields->add([
'type' => 'markup',
'label' => 'Documentation & Updates',
'icon' => 'life-ring',
'value' => "<p>Hey there, coding rockstars! 👋</p>
<ul>
<li><a class=uk-text-bold href=https://www.baumrock.com/modules/$name/docs>Read the docs</a> and level up your coding game! 🚀💻😎</li>
<li><a class=uk-text-bold href=https://www.baumrock.com/rock-monthly>Sign up now for our monthly newsletter</a> and receive the latest updates and exclusive offers right to your inbox! 🚀💻📫</li>
<li><a class=uk-text-bold href=https://github.com/baumrock/$name>Show some love by starring the project</a> and keep me motivated to build more awesome stuff for you! 🌟💻😊</li>
<li><a class=uk-text-bold href=https://paypal.me/baumrockcom>Support my work with a donation</a>, and together, we'll keep rocking the coding world! 💖💻💰</li>
</ul>",
]);
$inputfields->add([
'type' => 'markup',
'label' => 'Setup',
'icon' => 'code',
'value' => 'Set $config->mollieApiKey = ... in your site config.php',
]);
return $inputfields;
}
}