Passed
Push — master ( 1aa207...da253c )
by Manuel
03:24
created

InitializeRequest::setOrder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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