1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Ticketpark\SaferpayJson\Request\SecureCardData; |
6
|
|
|
|
7
|
|
|
use JMS\Serializer\Annotation\SerializedName; |
8
|
|
|
use JMS\Serializer\Annotation\Type; |
9
|
|
|
use Ticketpark\SaferpayJson\Request\Container\CardForm; |
10
|
|
|
use Ticketpark\SaferpayJson\Request\Container\Check; |
11
|
|
|
use Ticketpark\SaferpayJson\Request\Container\PaymentMeans; |
12
|
|
|
use Ticketpark\SaferpayJson\Request\Container\RegisterAlias; |
13
|
|
|
use Ticketpark\SaferpayJson\Request\Container\ReturnUrls; |
14
|
|
|
use Ticketpark\SaferpayJson\Request\Container\Styling; |
15
|
|
|
use Ticketpark\SaferpayJson\Request\Request; |
16
|
|
|
use Ticketpark\SaferpayJson\Request\RequestCommonsTrait; |
17
|
|
|
use Ticketpark\SaferpayJson\Request\RequestConfig; |
18
|
|
|
use Ticketpark\SaferpayJson\Response\SecureCardData\AliasInsertResponse; |
19
|
|
|
|
20
|
|
|
final class AliasInsertRequest extends Request |
21
|
|
|
{ |
22
|
|
|
use RequestCommonsTrait; |
23
|
|
|
public const API_PATH = '/Payment/v1/Alias/Insert'; |
24
|
|
|
public const RESPONSE_CLASS = AliasInsertResponse::class; |
25
|
|
|
|
26
|
|
|
public const PAYMENT_METHOD_AMEX = "AMEX"; |
27
|
|
|
public const PAYMENT_METHOD_BANCONTACT = "BANCONTACT"; |
28
|
|
|
public const PAYMENT_METHOD_BONUS = "BONUS"; |
29
|
|
|
public const PAYMENT_METHOD_DINERS = "DINERS"; |
30
|
|
|
public const PAYMENT_METHOD_DIRECTDEBIT = "DIRECTDEBIT"; |
31
|
|
|
public const PAYMENT_METHOD_JCB = "JCB"; |
32
|
|
|
public const PAYMENT_METHOD_MAESTRO = "MAESTRO"; |
33
|
|
|
public const PAYMENT_METHOD_MASTERCARD = "MASTERCARD"; |
34
|
|
|
public const PAYMENT_METHOD_MYONE = "MYONE"; |
35
|
|
|
public const PAYMENT_METHOD_SAFERPAYTEST = "SAFERPAYTEST"; |
36
|
|
|
public const PAYMENT_METHOD_UNIONPAY = "UNIONPAY"; |
37
|
|
|
public const PAYMENT_METHOD_VISA = "VISA"; |
38
|
|
|
public const PAYMENT_METHOD_VPAY = "VPAY"; |
39
|
|
|
|
40
|
|
|
public const TYPE_CARD = 'CARD'; |
41
|
|
|
public const TYPE_BANK_ACCOUNT = 'BANK_ACCOUNT'; |
42
|
|
|
public const TYPE_POSTFINANCE = 'POSTFINANCE'; |
43
|
|
|
public const TYPE_TWINT = 'TWINT'; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @var RegisterAlias |
47
|
|
|
* @SerializedName("RegisterAlias") |
48
|
|
|
*/ |
49
|
|
|
private $registerAlias; |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @var string |
53
|
|
|
* @SerializedName("Type") |
54
|
|
|
* @Type("string") |
55
|
|
|
*/ |
56
|
|
|
private $type; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @var ReturnUrls |
60
|
|
|
* @SerializedName("ReturnUrls") |
61
|
|
|
*/ |
62
|
|
|
private $returnUrls; |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @var Styling|null |
66
|
|
|
* @SerializedName("Styling") |
67
|
|
|
*/ |
68
|
|
|
private $styling; |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @var string|null |
72
|
|
|
* @SerializedName("LanguageCode") |
73
|
|
|
* @Type("string") |
74
|
|
|
*/ |
75
|
|
|
private $languageCode; |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* @var Check|null |
79
|
|
|
* @SerializedName("Check") |
80
|
|
|
*/ |
81
|
|
|
private $check; |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* @var array<string>|null |
85
|
|
|
* @SerializedName("PaymentMethods") |
86
|
|
|
*/ |
87
|
|
|
private $paymentMethods; |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @var CardForm|null |
91
|
|
|
* @SerializedName("CardForm") |
92
|
|
|
*/ |
93
|
|
|
private $cardForm; |
94
|
|
|
|
95
|
|
|
/** |
96
|
|
|
* @var PaymentMeans|null |
97
|
|
|
* @SerializedName("PaymentMeans") |
98
|
|
|
*/ |
99
|
|
|
private $paymentMeans; |
100
|
|
|
|
101
|
|
|
public function __construct( |
102
|
|
|
RequestConfig $requestConfig, |
103
|
|
|
RegisterAlias $registerAlias, |
104
|
|
|
string $type, |
105
|
|
|
ReturnUrls $returnUrls |
106
|
|
|
) { |
107
|
|
|
$this->registerAlias = $registerAlias; |
108
|
|
|
$this->type = $type; |
109
|
|
|
$this->returnUrls = $returnUrls; |
110
|
|
|
|
111
|
|
|
parent::__construct($requestConfig); |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
public function getRegisterAlias(): RegisterAlias |
115
|
|
|
{ |
116
|
|
|
return $this->registerAlias; |
117
|
|
|
} |
118
|
|
|
|
119
|
|
|
public function setRegisterAlias(RegisterAlias $registerAlias): self |
120
|
|
|
{ |
121
|
|
|
$this->registerAlias = $registerAlias; |
122
|
|
|
|
123
|
|
|
return $this; |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
public function getType(): string |
127
|
|
|
{ |
128
|
|
|
return $this->type; |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
public function setType(string $type): self |
132
|
|
|
{ |
133
|
|
|
$this->type = $type; |
134
|
|
|
|
135
|
|
|
return $this; |
136
|
|
|
} |
137
|
|
|
|
138
|
|
|
public function getReturnUrls(): ReturnUrls |
139
|
|
|
{ |
140
|
|
|
return $this->returnUrls; |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
public function setReturnUrls(ReturnUrls $returnUrls): self |
144
|
|
|
{ |
145
|
|
|
$this->returnUrls = $returnUrls; |
146
|
|
|
|
147
|
|
|
return $this; |
148
|
|
|
} |
149
|
|
|
|
150
|
|
|
public function getStyling(): ?Styling |
151
|
|
|
{ |
152
|
|
|
return $this->styling; |
153
|
|
|
} |
154
|
|
|
|
155
|
|
|
public function setStyling(?Styling $styling): self |
156
|
|
|
{ |
157
|
|
|
$this->styling = $styling; |
158
|
|
|
|
159
|
|
|
return $this; |
160
|
|
|
} |
161
|
|
|
|
162
|
|
|
public function getCheck(): ?Check |
163
|
|
|
{ |
164
|
|
|
return $this->check; |
165
|
|
|
} |
166
|
|
|
|
167
|
|
|
public function setCheck(?Check $check): self |
168
|
|
|
{ |
169
|
|
|
$this->check = $check; |
170
|
|
|
|
171
|
|
|
return $this; |
172
|
|
|
} |
173
|
|
|
|
174
|
|
|
public function getLanguageCode(): ?string |
175
|
|
|
{ |
176
|
|
|
return $this->languageCode; |
177
|
|
|
} |
178
|
|
|
|
179
|
|
|
public function setLanguageCode(?string $languageCode): self |
180
|
|
|
{ |
181
|
|
|
$this->languageCode = $languageCode; |
182
|
|
|
|
183
|
|
|
return $this; |
184
|
|
|
} |
185
|
|
|
|
186
|
|
|
public function getPaymentMethods(): ?array |
187
|
|
|
{ |
188
|
|
|
return $this->paymentMethods; |
189
|
|
|
} |
190
|
|
|
|
191
|
|
|
public function setPaymentMethods(?array $paymentMethods): self |
192
|
|
|
{ |
193
|
|
|
$this->paymentMethods = $paymentMethods; |
194
|
|
|
|
195
|
|
|
return $this; |
196
|
|
|
} |
197
|
|
|
|
198
|
|
|
public function getCardForm(): ?CardForm |
199
|
|
|
{ |
200
|
|
|
return $this->cardForm; |
201
|
|
|
} |
202
|
|
|
|
203
|
|
|
public function setCardForm(?CardForm $cardForm): self |
204
|
|
|
{ |
205
|
|
|
$this->cardForm = $cardForm; |
206
|
|
|
|
207
|
|
|
return $this; |
208
|
|
|
} |
209
|
|
|
|
210
|
|
|
public function getPaymentMeans(): ?PaymentMeans |
211
|
|
|
{ |
212
|
|
|
return $this->paymentMeans; |
213
|
|
|
} |
214
|
|
|
|
215
|
|
|
public function setPaymentMeans(?PaymentMeans $paymentMeans): self |
216
|
|
|
{ |
217
|
|
|
$this->paymentMeans = $paymentMeans; |
218
|
|
|
|
219
|
|
|
return $this; |
220
|
|
|
} |
221
|
|
|
|
222
|
|
|
public function execute(): AliasInsertResponse |
223
|
|
|
{ |
224
|
|
|
/** @var AliasInsertResponse $response */ |
225
|
|
|
$response = $this->doExecute(); |
226
|
|
|
|
227
|
|
|
return $response; |
228
|
|
|
} |
229
|
|
|
} |
230
|
|
|
|