1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Class Config |
4
|
|
|
* @package Wesleydeveloper\Hotmart\Support |
5
|
|
|
* @author Wesley Silva <[email protected]> |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
|
9
|
|
|
namespace Wesleydeveloper\Hotmart\Support; |
10
|
|
|
|
11
|
|
|
|
12
|
|
|
class Config |
13
|
|
|
{ |
14
|
|
|
protected $access_token; |
15
|
|
|
protected $client_id; |
16
|
|
|
protected $client_secret; |
17
|
|
|
protected $basic; |
18
|
|
|
private $data; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* @param string|null $client_id |
22
|
|
|
* @param string|null $client_secret |
23
|
|
|
* @param string|null $basic |
24
|
|
|
*/ |
25
|
|
|
public function __construct($client_id = null, $client_secret = null, $basic = null) |
26
|
|
|
{ |
27
|
|
|
$this->setClientId($client_id); |
28
|
|
|
$this->setClientSecret($client_secret); |
29
|
|
|
$this->setBasic($basic); |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @return mixed |
34
|
|
|
*/ |
35
|
|
|
public function getData() |
36
|
|
|
{ |
37
|
|
|
return $this->data; |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @param object|array|string $data |
42
|
|
|
*/ |
43
|
|
|
public function setData($data) |
44
|
|
|
{ |
45
|
|
|
$this->data = $data; |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @return string |
50
|
|
|
*/ |
51
|
|
|
public function getAccessToken() |
52
|
|
|
{ |
53
|
|
|
return $this->access_token; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @param string $access_token |
58
|
|
|
*/ |
59
|
|
|
public function setAccessToken($access_token): void |
60
|
|
|
{ |
61
|
|
|
$this->access_token = $access_token; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @return string |
66
|
|
|
*/ |
67
|
|
|
public function getClientId() |
68
|
|
|
{ |
69
|
|
|
return $this->client_id; |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* @return string |
74
|
|
|
*/ |
75
|
|
|
public function getBasic() |
76
|
|
|
{ |
77
|
|
|
return $this->basic; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* @param string $basic |
82
|
|
|
*/ |
83
|
|
|
public function setBasic($basic): void |
84
|
|
|
{ |
85
|
|
|
$this->basic = $basic; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* @param string $client_id |
90
|
|
|
*/ |
91
|
|
|
public function setClientId($client_id): void |
92
|
|
|
{ |
93
|
|
|
$this->client_id = $client_id; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @return string |
98
|
|
|
*/ |
99
|
|
|
public function getClientSecret() |
100
|
|
|
{ |
101
|
|
|
return $this->client_secret; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @param string $client_secret |
106
|
|
|
*/ |
107
|
|
|
public function setClientSecret($client_secret): void |
108
|
|
|
{ |
109
|
|
|
$this->client_secret = $client_secret; |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
|
113
|
|
|
} |