-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathService.php
117 lines (104 loc) · 2.85 KB
/
Service.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
namespace App\Services\Universal;
use App\Models\Order;
use App\Models\Package;
class Service
{
protected static $key = 'universal';
public function __construct(Order $order)
{
$this->order = $order;
}
/**
* Returns the meta data about this Server/Service
*/
public static function metaData(): object
{
return (object)
[
'display_name' => 'Universal',
'autor' => 'WemX',
'version' => '1.0.0',
'wemx_version' => ['*'],
];
}
/**
* Define the default configuration values required to setup this service
* i.e host, api key, or other values. Use Laravel validation rules for
*
* Laravel validation rules: https://laravel.com/docs/10.x/validation
*/
public static function setConfig(): array
{
return [];
}
/**
* Define the default package configuration values required when creatig
* new packages. i.e maximum ram usage, allowed databases and backups etc.
*
* Laravel validation rules: https://laravel.com/docs/10.x/validation
*/
public static function setPackageConfig(Package $package): array
{
return [];
}
/**
* Define the checkout config that is required at checkout and is fillable by
* the client. Its important to properly sanatize all inputted data with rules
*
* Laravel validation rules: https://laravel.com/docs/10.x/validation
*/
public static function setCheckoutConfig(Package $package): array
{
return [];
}
/**
* Define buttons shown at order management page
*/
public static function setServiceButtons(Order $order): array
{
return [];
}
/**
* This function is responsible for creating an instance of the
* service. This can be anything such as a server, vps or any other instance.
*
* @return Renderable
*/
public function create(array $data = [])
{
return [];
}
/**
* This function is responsible for suspending an instance of the
* service. This method is called when a order is expired or
* suspended by an admin
*
* @return Renderable
*/
public function suspend(array $data = [])
{
return [];
}
/**
* This function is responsible for unsuspending an instance of the
* service. This method is called when a order is activated or
* unsuspended by an admin
*
* @return Renderable
*/
public function unsuspend(array $data = [])
{
return [];
}
/**
* This function is responsible for deleting an instance of the
* service. This can be anything such as a server, vps or any other instance.
*
* @return Renderable
*/
public function terminate(array $data = [])
{
return [];
}
}