1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Ipag\Sdk\Support\Credentials\PaymentMethods; |
4
|
|
|
|
5
|
|
|
use Ipag\Sdk\Model\Model; |
6
|
|
|
use Ipag\Sdk\Model\Schema\Schema; |
7
|
|
|
use Ipag\Sdk\Model\Schema\SchemaBuilder; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* GlobalPaymentsCredentials Class |
11
|
|
|
* |
12
|
|
|
* Classe responsável pela credencial da identidade `GlobalPayments`. |
13
|
|
|
*/ |
14
|
|
|
final class GlobalPaymentsCredentials extends Model |
15
|
|
|
{ |
16
|
|
|
/** |
17
|
|
|
* @param array $data |
18
|
|
|
* array de dados da credencial da GlobalPayments. |
19
|
|
|
* |
20
|
|
|
* + [`'terminal'`] string (opcional). |
21
|
|
|
* + [`'merchant_id'`] string (opcional). |
22
|
|
|
* + [`'merchant_key'`] string (opcional). |
23
|
|
|
* |
24
|
|
|
*/ |
25
|
|
|
public function __construct(?array $data = []) |
26
|
|
|
{ |
27
|
|
|
parent::__construct($data); |
28
|
|
|
} |
29
|
|
|
public function schema(SchemaBuilder $schema): Schema |
30
|
|
|
{ |
31
|
|
|
$schema->string('terminal')->nullable(); |
32
|
|
|
$schema->string('merchant_id')->nullable(); |
33
|
|
|
$schema->string('merchant_key')->nullable(); |
34
|
|
|
|
35
|
|
|
return $schema->build(); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* Retorna o valor da propriedade `terminal`. |
40
|
|
|
* |
41
|
|
|
* @return string|null |
42
|
|
|
*/ |
43
|
|
|
public function getTerminal(): ?string |
44
|
|
|
{ |
45
|
|
|
return $this->get('terminal'); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* Seta o valor da propriedade `terminal`. |
50
|
|
|
* |
51
|
|
|
* @param string|null $terminal |
52
|
|
|
* @return self |
53
|
|
|
*/ |
54
|
|
|
public function setTerminal(?string $terminal = null): self |
55
|
|
|
{ |
56
|
|
|
$this->set('terminal', $terminal); |
57
|
|
|
return $this; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* Retorna o valor da propriedade `merchant_id`. |
62
|
|
|
* |
63
|
|
|
* @return string|null |
64
|
|
|
*/ |
65
|
|
|
public function getMerchantId(): ?string |
66
|
|
|
{ |
67
|
|
|
return $this->get('merchant_id'); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* Seta o valor da propriedade `merchant_id`. |
72
|
|
|
* |
73
|
|
|
* @param string|null $merchantId |
74
|
|
|
* @return self |
75
|
|
|
*/ |
76
|
|
|
public function setMerchantId(?string $merchantId = null): self |
77
|
|
|
{ |
78
|
|
|
$this->set('merchant_id', $merchantId); |
79
|
|
|
return $this; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* Retorna o valor da propriedade `merchant_key`. |
84
|
|
|
* |
85
|
|
|
* @return string|null |
86
|
|
|
*/ |
87
|
|
|
public function getMerchantKey(): ?string |
88
|
|
|
{ |
89
|
|
|
return $this->get('merchant_key'); |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* Seta o valor da propriedade `merchant_key`. |
94
|
|
|
* |
95
|
|
|
* @param string|null $merchantKey |
96
|
|
|
* @return self |
97
|
|
|
*/ |
98
|
|
|
public function setMerchantKey(?string $merchantKey = null): self |
99
|
|
|
{ |
100
|
|
|
$this->set('merchant_key', $merchantKey); |
101
|
|
|
return $this; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
} |