1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Ticketpark\SaferpayJson\Request\Transaction; |
6
|
|
|
|
7
|
|
|
use JMS\Serializer\Annotation\SerializedName; |
8
|
|
|
use Ticketpark\SaferpayJson\Request\Container\Authentication; |
9
|
|
|
use Ticketpark\SaferpayJson\Request\Container\Payment; |
10
|
|
|
use Ticketpark\SaferpayJson\Request\Container\TransactionReference; |
11
|
|
|
use Ticketpark\SaferpayJson\Request\Request; |
12
|
|
|
use Ticketpark\SaferpayJson\Request\RequestCommonsTrait; |
13
|
|
|
use Ticketpark\SaferpayJson\Request\RequestConfig; |
14
|
|
|
use Ticketpark\SaferpayJson\Response\Transaction\AuthorizeReferencedResponse; |
15
|
|
|
|
16
|
|
|
final class AuthorizeReferencedRequest extends Request |
17
|
|
|
{ |
18
|
|
|
use RequestCommonsTrait; |
19
|
|
|
public const API_PATH = '/Payment/v1/Transaction/AuthorizeReferenced'; |
20
|
|
|
public const RESPONSE_CLASS = AuthorizeReferencedResponse::class; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* @var string |
24
|
|
|
* @SerializedName("TerminalId") |
25
|
|
|
*/ |
26
|
|
|
private $terminalId; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var Payment |
30
|
|
|
* @SerializedName("Payment") |
31
|
|
|
*/ |
32
|
|
|
private $payment; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @var TransactionReference |
36
|
|
|
* @SerializedName("TransactionReference") |
37
|
|
|
*/ |
38
|
|
|
private $transactionReference; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @var Authentication|null |
42
|
|
|
* @SerializedName("Authentication") |
43
|
|
|
*/ |
44
|
|
|
private $authentication; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @var bool|null |
48
|
|
|
* @SerializedName("SuppressDcc") |
49
|
|
|
*/ |
50
|
|
|
private $suppressDcc; |
51
|
|
|
|
52
|
|
|
public function __construct( |
53
|
|
|
RequestConfig $requestConfig, |
54
|
|
|
string $terminalId, |
55
|
|
|
Payment $payment, |
56
|
|
|
TransactionReference $transactionReference |
57
|
|
|
) { |
58
|
|
|
$this->terminalId = $terminalId; |
59
|
|
|
$this->payment = $payment; |
60
|
|
|
$this->transactionReference = $transactionReference; |
61
|
|
|
|
62
|
|
|
parent::__construct($requestConfig); |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
public function getTerminalId(): string |
66
|
|
|
{ |
67
|
|
|
return $this->terminalId; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
public function setTerminalId(string $terminalId): self |
71
|
|
|
{ |
72
|
|
|
$this->terminalId = $terminalId; |
73
|
|
|
|
74
|
|
|
return $this; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
public function getPayment(): Payment |
78
|
|
|
{ |
79
|
|
|
return $this->payment; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
public function setPayment(Payment $payment): self |
83
|
|
|
{ |
84
|
|
|
$this->payment = $payment; |
85
|
|
|
|
86
|
|
|
return $this; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
public function getTransactionReference(): TransactionReference |
90
|
|
|
{ |
91
|
|
|
return $this->transactionReference; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
public function setTransactionReference(TransactionReference $transactionReference): self |
95
|
|
|
{ |
96
|
|
|
$this->transactionReference = $transactionReference; |
97
|
|
|
|
98
|
|
|
return $this; |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
public function getAuthentication(): ?Authentication |
102
|
|
|
{ |
103
|
|
|
return $this->authentication; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
public function setAuthentication(?Authentication $authentication): self |
107
|
|
|
{ |
108
|
|
|
$this->authentication = $authentication; |
109
|
|
|
|
110
|
|
|
return $this; |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
public function isSuppressDcc(): ?bool |
114
|
|
|
{ |
115
|
|
|
return $this->suppressDcc; |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
public function setSuppressDcc(?bool $suppressDcc): self |
119
|
|
|
{ |
120
|
|
|
$this->suppressDcc = $suppressDcc; |
121
|
|
|
|
122
|
|
|
return $this; |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
public function execute(): AuthorizeReferencedResponse |
126
|
|
|
{ |
127
|
|
|
/** @var AuthorizeReferencedResponse $response */ |
128
|
|
|
$response = $this->doExecute(); |
129
|
|
|
|
130
|
|
|
return $response; |
131
|
|
|
} |
132
|
|
|
} |
133
|
|
|
|