Passed
Pull Request — master (#34)
by
unknown
02:48
created

InitializeRequest::getOrder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
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
    {
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