InitializeRequest   A
last analyzed

Complexity

Total Complexity 38

Size/Duplication

Total Lines 382
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 38
eloc 111
c 3
b 0
f 0
dl 0
loc 382
rs 9.36

38 Methods

Rating   Name   Duplication   Size   Complexity  
A getTerminalId() 0 3 1
A getRegisterAlias() 0 3 1
A getCardForm() 0 3 1
A setRiskFactors() 0 5 1
A setStyling() 0 5 1
A getBillingAddressForm() 0 3 1
A getPaymentMethods() 0 3 1
A getPayer() 0 3 1
A setAuthentication() 0 5 1
A setNotification() 0 5 1
A setPaymentMethodsOptions() 0 5 1
A setReturnUrls() 0 5 1
A getCondition() 0 3 1
A getPaymentMethodsOptions() 0 3 1
A setOrder() 0 5 1
A setPayment() 0 5 1
A getPayment() 0 3 1
A setCardForm() 0 5 1
A getStyling() 0 3 1
A setCondition() 0 5 1
A getNotification() 0 3 1
A getWallets() 0 3 1
A setTerminalId() 0 5 1
A setRegisterAlias() 0 5 1
A setPayer() 0 5 1
A getOrder() 0 3 1
A setWallets() 0 5 1
A getReturnUrls() 0 3 1
A setBillingAddressForm() 0 5 1
A setConfigSet() 0 5 1
A getRiskFactors() 0 3 1
A getDeliveryAddressForm() 0 3 1
A setDeliveryAddressForm() 0 5 1
A getConfigSet() 0 3 1
A setPaymentMethods() 0 5 1
A getAuthentication() 0 3 1
A execute() 0 6 1
A __construct() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ticketpark\SaferpayJson\Request\PaymentPage;
6
7
use JMS\Serializer\Annotation\SerializedName;
8
use Ticketpark\SaferpayJson\Request\Container\AddressForm;
9
use Ticketpark\SaferpayJson\Request\Container\Authentication;
10
use Ticketpark\SaferpayJson\Request\Container\CardForm;
11
use Ticketpark\SaferpayJson\Request\Container\Notification;
12
use Ticketpark\SaferpayJson\Request\Container\Order;
13
use Ticketpark\SaferpayJson\Request\Container\Payer;
14
use Ticketpark\SaferpayJson\Request\Container\Payment;
15
use Ticketpark\SaferpayJson\Request\Container\PaymentMethodsOptions;
16
use Ticketpark\SaferpayJson\Request\Container\RegisterAlias;
17
use Ticketpark\SaferpayJson\Request\Container\ReturnUrls;
18
use Ticketpark\SaferpayJson\Request\Container\RiskFactors;
19
use Ticketpark\SaferpayJson\Request\Container\Styling;
20
use Ticketpark\SaferpayJson\Request\Request;
21
use Ticketpark\SaferpayJson\Request\RequestCommonsTrait;
22
use Ticketpark\SaferpayJson\Request\RequestConfig;
23
use Ticketpark\SaferpayJson\Response\PaymentPage\InitializeResponse;
24
25
final class InitializeRequest extends Request
26
{
27
    use RequestCommonsTrait;
28
    public const API_PATH = '/Payment/v1/PaymentPage/Initialize';
29
    public const RESPONSE_CLASS = InitializeResponse::class;
30
31
    public const PAYMENT_METHOD_ALIPAY = "ALIPAY";
32
    public const PAYMENT_METHOD_AMEX = "AMEX";
33
    public const PAYMENT_METHOD_BANCONTACT = "BANCONTACT";
34
    public const PAYMENT_METHOD_BONUS = "BONUS";
35
    public const PAYMENT_METHOD_DINERS = "DINERS";
36
    public const PAYMENT_METHOD_DIRECTDEBIT = "DIRECTDEBIT";
37
    public const PAYMENT_METHOD_EPRZELEWY = "EPRZELEWY";
38
    public const PAYMENT_METHOD_EPS = "EPS";
39
    public const PAYMENT_METHOD_GIROPAY = "GIROPAY";
40
    public const PAYMENT_METHOD_IDEAL = "IDEAL";
41
    public const PAYMENT_METHOD_INVOICE = "INVOICE";
42
    public const PAYMENT_METHOD_JCB = "JCB";
43
    public const PAYMENT_METHOD_MAESTRO = "MAESTRO";
44
    public const PAYMENT_METHOD_MASTERCARD = "MASTERCARD";
45
    public const PAYMENT_METHOD_MYONE = "MYONE";
46
    public const PAYMENT_METHOD_PAYPAL = "PAYPAL";
47
    public const PAYMENT_METHOD_PAYDIREKT = "PAYDIREKT";
48
    public const PAYMENT_METHOD_POSTCARD = "POSTCARD";
49
    public const PAYMENT_METHOD_POSTFINANCE = "POSTFINANCE";
50
    public const PAYMENT_METHOD_SAFERPAYTEST = "SAFERPAYTEST";
51
    public const PAYMENT_METHOD_SOFORT = "SOFORT";
52
    public const PAYMENT_METHOD_TWINT = "TWINT";
53
    public const PAYMENT_METHOD_UNIONPAY = "UNIONPAY";
54
    public const PAYMENT_METHOD_VISA = "VISA";
55
    public const PAYMENT_METHOD_VPAY = "VPAY";
56
57
    public const WALLET_MASTERPASS = "MASTERPASS";
58
    public const WALLET_APPLEPAY = "APPLEPAY";
59
60
    public const CONDITION_WITH_LIABILITY_SHIFT = 'WITH_LIABILITY_SHIFT';
61
    public const CONDITION_IF_ALLOWED_BY_SCHEME = 'IF_ALLOWED_BY_SCHEME';
62
63
    /**
64
     * @var string
65
     * @SerializedName("TerminalId")
66
     */
67
    private $terminalId;
68
69
    /**
70
     * @var Payment
71
     * @SerializedName("Payment")
72
     */
73
    private $payment;
74
75
    /**
76
     * @var ReturnUrls
77
     * @SerializedName("ReturnUrls")
78
     */
79
    private $returnUrls;
80
81
    /**
82
     * @var string|null
83
     * @SerializedName("ConfigSet")
84
     */
85
    private $configSet;
86
87
    /**
88
     * @var array<string>|null
89
     * @SerializedName("PaymentMethods")
90
     */
91
    private $paymentMethods;
92
93
    /**
94
     * @var PaymentMethodsOptions|null
95
     * @SerializedName("PaymentMethodsOptions")
96
     */
97
    private $paymentMethodsOptions;
98
99
    /**
100
     * @var Authentication|null
101
     * @SerializedName("Authentication")
102
     */
103
    private $authentication;
104
105
    /**
106
     * @var array<string>|null
107
     * @SerializedName("Wallets")
108
     */
109
    private $wallets;
110
111
    /**
112
     * @var Payer|null
113
     * @SerializedName("Payer")
114
     */
115
    private $payer;
116
117
    /**
118
     * @var RegisterAlias|null
119
     * @SerializedName("RegisterAlias")
120
     */
121
    private $registerAlias;
122
123
    /**
124
     * @var Notification|null
125
     * @SerializedName("Notification")
126
     */
127
    private $notification;
128
129
    /**
130
     * @var Styling|null
131
     * @SerializedName("Styling")
132
     */
133
    private $styling;
134
135
    /**
136
     * @var AddressForm|null
137
     * @SerializedName("BillingAddressForm")
138
     */
139
    private $billingAddressForm;
140
141
    /**
142
     * @var AddressForm|null
143
     * @SerializedName("DeliveryAddressForm")
144
     */
145
    private $deliveryAddressForm;
146
147
    /**
148
     * @var CardForm|null
149
     * @SerializedName("CardForm")
150
     */
151
    private $cardForm;
152
153
    /**
154
     * @var string|null
155
     * @SerializedName("Condition")
156
     */
157
    private $condition;
158
159
    /**
160
     * @var Order|null
161
     * @SerializedName("Order")
162
     */
163
    private $order;
164
165
    /**
166
     * @var RiskFactors|null
167
     * @SerializedName("RiskFactors")
168
     */
169
    private $riskFactors;
170
171
    public function __construct(
172
        RequestConfig $requestConfig,
173
        string $terminalId,
174
        Payment $payment,
175
        ReturnUrls $returnUrls
176
    ) {
177
        $this->terminalId = $terminalId;
178
        $this->payment = $payment;
179
        $this->returnUrls = $returnUrls;
180
181
        parent::__construct($requestConfig);
182
    }
183
184
    public function getTerminalId(): string
185
    {
186
        return $this->terminalId;
187
    }
188
189
    public function setTerminalId(string $terminalId): self
190
    {
191
        $this->terminalId = $terminalId;
192
193
        return $this;
194
    }
195
196
    public function getPayment(): Payment
197
    {
198
        return $this->payment;
199
    }
200
201
    public function setPayment(Payment $payment): self
202
    {
203
        $this->payment = $payment;
204
205
        return $this;
206
    }
207
208
    public function getReturnUrls(): ReturnUrls
209
    {
210
        return $this->returnUrls;
211
    }
212
213
    public function setReturnUrls(ReturnUrls $returnUrls): self
214
    {
215
        $this->returnUrls = $returnUrls;
216
217
        return $this;
218
    }
219
220
    public function getConfigSet(): ?string
221
    {
222
        return $this->configSet;
223
    }
224
225
    public function setConfigSet(?string $configSet): self
226
    {
227
        $this->configSet = $configSet;
228
229
        return $this;
230
    }
231
232
    public function getPaymentMethods(): ?array
233
    {
234
        return $this->paymentMethods;
235
    }
236
237
    public function setPaymentMethods(?array $paymentMethods): self
238
    {
239
        $this->paymentMethods = $paymentMethods;
240
241
        return $this;
242
    }
243
244
    public function getPaymentMethodsOptions(): ?PaymentMethodsOptions
245
    {
246
        return $this->paymentMethodsOptions;
247
    }
248
249
    public function setPaymentMethodsOptions(?PaymentMethodsOptions $paymentMethodsOptions): self
250
    {
251
        $this->paymentMethodsOptions = $paymentMethodsOptions;
252
253
        return $this;
254
    }
255
256
    public function getAuthentication(): ?Authentication
257
    {
258
        return $this->authentication;
259
    }
260
261
    public function setAuthentication(?Authentication $authentication): self
262
    {
263
        $this->authentication = $authentication;
264
265
        return $this;
266
    }
267
268
    public function getWallets(): ?array
269
    {
270
        return $this->wallets;
271
    }
272
273
    public function setWallets(?array $wallets): self
274
    {
275
        $this->wallets = $wallets;
276
277
        return $this;
278
    }
279
280
    public function getPayer(): ?Payer
281
    {
282
        return $this->payer;
283
    }
284
285
    public function setPayer(?Payer $payer): self
286
    {
287
        $this->payer = $payer;
288
289
        return $this;
290
    }
291
292
    public function getRegisterAlias(): ?RegisterAlias
293
    {
294
        return $this->registerAlias;
295
    }
296
297
    public function setRegisterAlias(?RegisterAlias $registerAlias): self
298
    {
299
        $this->registerAlias = $registerAlias;
300
301
        return $this;
302
    }
303
304
    public function getNotification(): ?Notification
305
    {
306
        return $this->notification;
307
    }
308
309
    public function setNotification(?Notification $notification): self
310
    {
311
        $this->notification = $notification;
312
313
        return $this;
314
    }
315
316
    public function getStyling(): ?Styling
317
    {
318
        return $this->styling;
319
    }
320
321
    public function setStyling(?Styling $styling): self
322
    {
323
        $this->styling = $styling;
324
325
        return $this;
326
    }
327
328
    public function getBillingAddressForm(): ?AddressForm
329
    {
330
        return $this->billingAddressForm;
331
    }
332
333
    public function setBillingAddressForm(?AddressForm $billingAddressForm): self
334
    {
335
        $this->billingAddressForm = $billingAddressForm;
336
337
        return $this;
338
    }
339
340
    public function getDeliveryAddressForm(): ?AddressForm
341
    {
342
        return $this->deliveryAddressForm;
343
    }
344
345
    public function setDeliveryAddressForm(?AddressForm $deliveryAddressForm): self
346
    {
347
        $this->deliveryAddressForm = $deliveryAddressForm;
348
349
        return $this;
350
    }
351
352
    public function getCardForm(): ?CardForm
353
    {
354
        return $this->cardForm;
355
    }
356
357
    public function setCardForm(?CardForm $cardForm): self
358
    {
359
        $this->cardForm = $cardForm;
360
361
        return $this;
362
    }
363
364
    public function getCondition(): ?string
365
    {
366
        return $this->condition;
367
    }
368
369
    public function setCondition(?string $condition): self
370
    {
371
        $this->condition = $condition;
372
373
        return $this;
374
    }
375
376
    public function getOrder(): ?Order
377
    {
378
        return $this->order;
379
    }
380
381
    public function setOrder(?Order $order): self
382
    {
383
        $this->order = $order;
384
385
        return $this;
386
    }
387
388
    public function getRiskFactors(): ?RiskFactors
389
    {
390
        return $this->riskFactors;
391
    }
392
393
    public function setRiskFactors(?RiskFactors $riskFactors): self
394
    {
395
        $this->riskFactors = $riskFactors;
396
397
        return $this;
398
    }
399
400
401
    public function execute(): InitializeResponse
402
    {
403
        /** @var InitializeResponse $response */
404
        $response = $this->doExecute();
405
406
        return $response;
407
    }
408
}
409