Passed
Push — feature/eco-3656/dev-paypal-ex... ( a9c700...3cc3fd )
by
unknown
04:14
created

getPayPalExpressInitQuoteExpanderPlugins()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Yves\Computop;
9
10
use Spryker\Yves\Kernel\AbstractFactory;
11
use Spryker\Yves\Router\Router\RouterInterface;
12
use Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface;
13
use Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface;
14
use SprykerEco\Client\Computop\ComputopClientInterface;
15
use SprykerEco\Service\ComputopApi\ComputopApiServiceInterface;
16
use SprykerEco\Yves\Computop\Converter\ConverterInterface;
17
use SprykerEco\Yves\Computop\Converter\InitCreditCardConverter;
18
use SprykerEco\Yves\Computop\Converter\InitDirectDebitConverter;
19
use SprykerEco\Yves\Computop\Converter\InitEasyCreditConverter;
20
use SprykerEco\Yves\Computop\Converter\InitIdealConverter;
21
use SprykerEco\Yves\Computop\Converter\InitPaydirektConverter;
22
use SprykerEco\Yves\Computop\Converter\InitPayNowConverter;
23
use SprykerEco\Yves\Computop\Converter\InitPayPalConverter;
24
use SprykerEco\Yves\Computop\Converter\InitPayPalExpressConverter;
25
use SprykerEco\Yves\Computop\Converter\InitSofortConverter;
26
use SprykerEco\Yves\Computop\Dependency\Client\ComputopToCalculationClientInterface;
27
use SprykerEco\Yves\Computop\Dependency\Client\ComputopToComputopApiClientInterface;
28
use SprykerEco\Yves\Computop\Dependency\Client\ComputopToCountryClientInterface;
29
use SprykerEco\Yves\Computop\Dependency\Client\ComputopToQuoteClientInterface;
30
use SprykerEco\Yves\Computop\Dependency\ComputopToStoreInterface;
31
use SprykerEco\Yves\Computop\Dependency\Service\ComputopToUtilEncodingServiceInterface;
32
use SprykerEco\Yves\Computop\Form\CreditCardSubForm;
33
use SprykerEco\Yves\Computop\Form\DataProvider\CreditCardFormDataProvider;
34
use SprykerEco\Yves\Computop\Form\DataProvider\DirectDebitFormDataProvider;
35
use SprykerEco\Yves\Computop\Form\DataProvider\EasyCreditFormDataProvider;
36
use SprykerEco\Yves\Computop\Form\DataProvider\IdealFormDataProvider;
37
use SprykerEco\Yves\Computop\Form\DataProvider\PaydirektFormDataProvider;
38
use SprykerEco\Yves\Computop\Form\DataProvider\PayNowFormDataProvider;
39
use SprykerEco\Yves\Computop\Form\DataProvider\PayPalExpressFormDataProvider;
40
use SprykerEco\Yves\Computop\Form\DataProvider\PayPalFormDataProvider;
41
use SprykerEco\Yves\Computop\Form\DataProvider\SofortFormDataProvider;
42
use SprykerEco\Yves\Computop\Form\DirectDebitSubForm;
43
use SprykerEco\Yves\Computop\Form\EasyCreditSubForm;
44
use SprykerEco\Yves\Computop\Form\IdealSubForm;
45
use SprykerEco\Yves\Computop\Form\PaydirektSubForm;
46
use SprykerEco\Yves\Computop\Form\PayNowSubForm;
47
use SprykerEco\Yves\Computop\Form\PayPalSubForm;
48
use SprykerEco\Yves\Computop\Form\SofortSubForm;
49
use SprykerEco\Yves\Computop\Handler\ComputopPaymentHandler;
50
use SprykerEco\Yves\Computop\Handler\ComputopPaymentHandlerInterface;
51
use SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface;
52
use SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressCompleteAggregator;
53
use SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressCompleteAggregatorInterface;
54
use SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressInitAggregator;
55
use SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressInitAggregatorInterface;
56
use SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressPrepareAggregator;
57
use SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressPrepareAggregatorInterface;
58
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopCreditCardPaymentHandler;
59
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopDirectDebitPaymentHandler;
60
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopEasyCreditPaymentHandler;
61
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopIdealPaymentHandler;
62
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopPaydirektPaymentHandler;
63
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopPayNowPaymentHandler;
64
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopPayPalPaymentHandler;
65
use SprykerEco\Yves\Computop\Handler\PostPlace\ComputopSofortPaymentHandler;
66
use SprykerEco\Yves\Computop\Mapper\Init\MapperInterface;
67
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\CreditCardMapper;
68
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\DirectDebitMapper;
69
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\EasyCreditMapper;
70
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\IdealMapper;
71
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\PaydirektMapper;
72
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\PayNowMapper;
73
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\PayPalExpressMapper;
74
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\PayPalMapper;
75
use SprykerEco\Yves\Computop\Mapper\Init\PostPlace\SofortMapper;
76
use SprykerEco\Yves\Computop\Mapper\Init\PrePlace\PayPalExpressToQuoteMapper;
77
use SprykerEco\Yves\Computop\Mapper\Init\PrePlace\PayPalExpressToQuoteMapperInterface;
78
use Symfony\Component\HttpFoundation\RequestStack;
79
use Symfony\Component\HttpKernel\HttpKernelInterface;
80
81
/**
82
 * @method \SprykerEco\Yves\Computop\ComputopConfig getConfig()
83
 * @method \SprykerEco\Client\Computop\ComputopClientInterface getClient()
84
 */
85
class ComputopFactory extends AbstractFactory
86
{
87
    /**
88
     * @return \SprykerEco\Yves\Computop\ComputopConfigInterface
89
     */
90
    public function getComputopConfig(): ComputopConfigInterface
91
    {
92
        return $this->getConfig();
93
    }
94
95
    /**
96
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPaymentHandlerInterface
97
     */
98
    public function createComputopPaymentHandler(): ComputopPaymentHandlerInterface
99
    {
100
        return new ComputopPaymentHandler($this->getConfig());
101
    }
102
103
    /**
104
     * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface
105
     */
106
    public function createCreditCardForm(): SubFormInterface
107
    {
108
        return new CreditCardSubForm();
109
    }
110
111
    /**
112
     * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface
113
     */
114
    public function createPayNowForm(): SubFormInterface
115
    {
116
        return new PayNowSubForm();
117
    }
118
119
    /**
120
     * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface
121
     */
122
    public function createPayPalForm(): SubFormInterface
123
    {
124
        return new PayPalSubForm();
125
    }
126
127
    /**
128
     * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface
129
     */
130
    public function createSofortForm(): SubFormInterface
131
    {
132
        return new SofortSubForm();
133
    }
134
135
    /**
136
     * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface
137
     */
138
    public function createDirectDebitForm(): SubFormInterface
139
    {
140
        return new DirectDebitSubForm();
141
    }
142
143
    /**
144
     * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface
145
     */
146
    public function createPaydirektForm(): SubFormInterface
147
    {
148
        return new PaydirektSubForm();
149
    }
150
151
    /**
152
     * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface
153
     */
154
    public function createIdealForm(): SubFormInterface
155
    {
156
        return new IdealSubForm();
157
    }
158
159
    /**
160
     * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface
161
     */
162
    public function createEasyCreditForm(): SubFormInterface
163
    {
164
        return new EasyCreditSubForm();
165
    }
166
167
    /**
168
     * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface
169
     */
170
    public function createCreditCardFormDataProvider(): StepEngineFormDataProviderInterface
171
    {
172
        return new CreditCardFormDataProvider($this->getQuoteClient(), $this->createOrderCreditCardMapper());
173
    }
174
175
    /**
176
     * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface
177
     */
178
    public function createPayNowFormDataProvider(): StepEngineFormDataProviderInterface
179
    {
180
        return new PayNowFormDataProvider($this->getQuoteClient(), $this->createOrderPayNowMapper());
181
    }
182
183
    /**
184
     * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface
185
     */
186
    public function createPayPalFormDataProvider(): StepEngineFormDataProviderInterface
187
    {
188
        return new PayPalFormDataProvider($this->getQuoteClient(), $this->createOrderPayPalMapper());
189
    }
190
191
    /**
192
     * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface
193
     */
194
    public function createPayPalExpressFormDataProvider(): StepEngineFormDataProviderInterface
195
    {
196
        return new PayPalExpressFormDataProvider($this->getQuoteClient(), $this->createPayPalExpressMapper());
197
    }
198
199
    /**
200
     * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface
201
     */
202
    public function createSofortFormDataProvider(): StepEngineFormDataProviderInterface
203
    {
204
        return new SofortFormDataProvider($this->getQuoteClient(), $this->createOrderSofortMapper());
205
    }
206
207
    /**
208
     * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface
209
     */
210
    public function createDirectDebitFormDataProvider(): StepEngineFormDataProviderInterface
211
    {
212
        return new DirectDebitFormDataProvider($this->getQuoteClient(), $this->createOrderDirectDebitMapper());
213
    }
214
215
    /**
216
     * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface
217
     */
218
    public function createPaydirektFormDataProvider(): StepEngineFormDataProviderInterface
219
    {
220
        return new PaydirektFormDataProvider($this->getQuoteClient(), $this->createOrderPaydirektMapper());
221
    }
222
223
    /**
224
     * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface
225
     */
226
    public function createIdealFormDataProvider(): StepEngineFormDataProviderInterface
227
    {
228
        return new IdealFormDataProvider($this->getQuoteClient(), $this->createOrderIdealMapper());
229
    }
230
231
    /**
232
     * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface
233
     */
234
    public function createEasyCreditFormDataProvider(): StepEngineFormDataProviderInterface
235
    {
236
        return new EasyCreditFormDataProvider($this->getQuoteClient(), $this->createOrderEasyCreditMapper());
237
    }
238
239
    /**
240
     * @return \SprykerEco\Service\ComputopApi\ComputopApiServiceInterface
241
     */
242
    public function getComputopApiService(): ComputopApiServiceInterface
243
    {
244
        return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_COMPUTOP_API);
245
    }
246
247
    /**
248
     * @return \Symfony\Component\HttpKernel\HttpKernelInterface
249
     */
250
    public function getApplication(): HttpKernelInterface
251
    {
252
        return $this->getProvidedDependency(ComputopDependencyProvider::PLUGIN_APPLICATION);
253
    }
254
255
    /**
256
     * @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToQuoteClientInterface
257
     */
258
    public function getQuoteClient(): ComputopToQuoteClientInterface
259
    {
260
        return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_QUOTE);
261
    }
262
263
    /**
264
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
265
     */
266
    public function createCreditCardPaymentHandler(): ComputopPrePostPaymentHandlerInterface
267
    {
268
        return new ComputopCreditCardPaymentHandler($this->createInitCreditCardConverter(), $this->getComputopClient());
269
    }
270
271
    /**
272
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
273
     */
274
    public function createPayNowPaymentHandler(): ComputopPrePostPaymentHandlerInterface
275
    {
276
        return new ComputopPayNowPaymentHandler($this->createInitPayNowConverter(), $this->getComputopClient());
277
    }
278
279
    /**
280
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
281
     */
282
    public function createPayPalPaymentHandler(): ComputopPrePostPaymentHandlerInterface
283
    {
284
        return new ComputopPayPalPaymentHandler($this->createInitPayPalConverter(), $this->getComputopClient());
285
    }
286
287
    /**
288
     * @return \SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressInitAggregatorInterface
289
     */
290
    public function createComputopPayPalExpressInitAggregator(): ComputopPayPalExpressInitAggregatorInterface
291
    {
292
        return new ComputopPayPalExpressInitAggregator(
293
            $this->createComputopPaymentHandler(),
294
            $this->createInitPayPalExpressConverter(),
295
            $this->getQuoteClient(),
296
            $this->createPayPalExpressToQuoteMapper(),
297
            $this->getPayPalExpressInitQuoteExpanderPlugins()
298
        );
299
    }
300
301
    /**
302
     * @return \SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressPrepareAggregatorInterface
303
     */
304
    public function createComputopPayPalExpressPrepareAggregator(): ComputopPayPalExpressPrepareAggregatorInterface
305
    {
306
        return new ComputopPayPalExpressPrepareAggregator(
307
            $this->getQuoteClient(),
308
            $this->createPayPalExpressFormDataProvider(),
309
            $this->getComputopApiClient()
310
        );
311
    }
312
313
    /**
314
     * @return \SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressCompleteAggregatorInterface
315
     */
316
    public function createComputopPayPalExpressCompleteAggregator(): ComputopPayPalExpressCompleteAggregatorInterface
317
    {
318
        return new ComputopPayPalExpressCompleteAggregator(
319
            $this->getComputopApiClient(),
320
            $this->getComputopClient()
321
        );
322
    }
323
324
    /**
325
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
326
     */
327
    public function createDirectDebitPaymentHandler(): ComputopPrePostPaymentHandlerInterface
328
    {
329
        return new ComputopDirectDebitPaymentHandler($this->createInitDirectDebitConverter(), $this->getComputopClient());
330
    }
331
332
    /**
333
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
334
     */
335
    public function createEasyCreditPaymentHandler(): ComputopPrePostPaymentHandlerInterface
336
    {
337
        return new ComputopEasyCreditPaymentHandler(
338
            $this->createInitEasyCreditConverter(),
339
            $this->getComputopClient(),
340
            $this->getCalculationClient()
341
        );
342
    }
343
344
    /**
345
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
346
     */
347
    public function createPaydirektPaymentHandler(): ComputopPrePostPaymentHandlerInterface
348
    {
349
        return new ComputopPaydirektPaymentHandler($this->createInitPaydirektConverter(), $this->getComputopClient());
350
    }
351
352
    /**
353
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
354
     */
355
    public function createSofortPaymentHandler(): ComputopPrePostPaymentHandlerInterface
356
    {
357
        return new ComputopSofortPaymentHandler($this->createInitSofortConverter(), $this->getComputopClient());
358
    }
359
360
    /**
361
     * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface
362
     */
363
    public function createIdealPaymentHandler(): ComputopPrePostPaymentHandlerInterface
364
    {
365
        return new ComputopIdealPaymentHandler($this->createInitIdealConverter(), $this->getComputopClient());
366
    }
367
368
    /**
369
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
370
     */
371
    public function createInitCreditCardConverter(): ConverterInterface
372
    {
373
        return new InitCreditCardConverter($this->getComputopApiService(), $this->getConfig());
374
    }
375
376
    /**
377
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
378
     */
379
    public function createInitPayNowConverter(): ConverterInterface
380
    {
381
        return new InitPayNowConverter($this->getComputopApiService(), $this->getConfig());
382
    }
383
384
    /**
385
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
386
     */
387
    public function createInitPayPalConverter(): ConverterInterface
388
    {
389
        return new InitPayPalConverter($this->getComputopApiService(), $this->getConfig());
390
    }
391
392
    /**
393
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
394
     */
395
    public function createInitPayPalExpressConverter(): ConverterInterface
396
    {
397
        return new InitPayPalExpressConverter($this->getComputopApiService(), $this->getConfig());
398
    }
399
400
    /**
401
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
402
     */
403
    public function createInitDirectDebitConverter(): ConverterInterface
404
    {
405
        return new InitDirectDebitConverter($this->getComputopApiService(), $this->getConfig());
406
    }
407
408
    /**
409
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
410
     */
411
    public function createInitEasyCreditConverter(): ConverterInterface
412
    {
413
        return new InitEasyCreditConverter($this->getComputopApiService(), $this->getConfig());
414
    }
415
416
    /**
417
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
418
     */
419
    public function createInitPaydirektConverter(): ConverterInterface
420
    {
421
        return new InitPaydirektConverter($this->getComputopApiService(), $this->getConfig());
422
    }
423
424
    /**
425
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
426
     */
427
    public function createInitSofortConverter(): ConverterInterface
428
    {
429
        return new InitSofortConverter($this->getComputopApiService(), $this->getConfig());
430
    }
431
432
    /**
433
     * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface
434
     */
435
    public function createInitIdealConverter(): ConverterInterface
436
    {
437
        return new InitIdealConverter($this->getComputopApiService(), $this->getConfig());
438
    }
439
440
    /**
441
     * @return \SprykerEco\Client\Computop\ComputopClientInterface
442
     */
443
    public function getComputopClient(): ComputopClientInterface
444
    {
445
        return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_COMPUTOP);
446
    }
447
448
    /**
449
     * @return \SprykerEco\Yves\Computop\Dependency\ComputopToStoreInterface
450
     */
451
    public function getStore(): ComputopToStoreInterface
452
    {
453
        return $this->getProvidedDependency(ComputopDependencyProvider::STORE);
454
    }
455
456
    /**
457
     * @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToCalculationClientInterface
458
     */
459
    public function getCalculationClient(): ComputopToCalculationClientInterface
460
    {
461
        return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_CALCULATION);
462
    }
463
464
    /**
465
     * @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToComputopApiClientInterface
466
     */
467
    public function getComputopApiClient(): ComputopToComputopApiClientInterface
468
    {
469
        return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_COMPUTOP_API);
470
    }
471
472
    /**
473
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
474
     */
475
    public function createOrderCreditCardMapper(): MapperInterface
476
    {
477
        return new CreditCardMapper(
478
            $this->getComputopApiService(),
479
            $this->getRouter(),
480
            $this->getStore(),
481
            $this->getConfig(),
482
            $this->getRequestStack()->getCurrentRequest(),
0 ignored issues
show
Bug introduced by
It seems like $this->getRequestStack()->getCurrentRequest() can also be of type null; however, parameter $request of SprykerEco\Yves\Computop...rdMapper::__construct() does only seem to accept Symfony\Component\HttpFoundation\Request, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

482
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
483
            $this->getUtilEncodingService(),
484
            $this->getCountryClient()
485
        );
486
    }
487
488
    /**
489
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
490
     */
491
    public function createOrderPayNowMapper(): MapperInterface
492
    {
493
        return new PayNowMapper(
494
            $this->getComputopApiService(),
495
            $this->getRouter(),
496
            $this->getStore(),
497
            $this->getConfig(),
498
            $this->getRequestStack()->getCurrentRequest(),
0 ignored issues
show
Bug introduced by
It seems like $this->getRequestStack()->getCurrentRequest() can also be of type null; however, parameter $request of SprykerEco\Yves\Computop...owMapper::__construct() does only seem to accept Symfony\Component\HttpFoundation\Request, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

498
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
499
            $this->getUtilEncodingService(),
500
            $this->getCountryClient()
501
        );
502
    }
503
504
    /**
505
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
506
     */
507
    public function createOrderPayPalMapper(): MapperInterface
508
    {
509
        return new PayPalMapper(
510
            $this->getComputopApiService(),
511
            $this->getRouter(),
512
            $this->getStore(),
513
            $this->getConfig(),
514
            $this->getRequestStack()->getCurrentRequest(),
0 ignored issues
show
Bug introduced by
It seems like $this->getRequestStack()->getCurrentRequest() can also be of type null; however, parameter $request of SprykerEco\Yves\Computop...alMapper::__construct() does only seem to accept Symfony\Component\HttpFoundation\Request, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

514
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
515
            $this->getUtilEncodingService(),
516
            $this->getCountryClient()
517
        );
518
    }
519
520
    /**
521
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
522
     */
523
    public function createPayPalExpressMapper(): MapperInterface
524
    {
525
        return new PayPalExpressMapper(
526
            $this->getComputopApiService(),
527
            $this->getRouter(),
528
            $this->getStore(),
529
            $this->getConfig(),
530
            $this->getRequestStack()->getCurrentRequest(),
0 ignored issues
show
Bug introduced by
It seems like $this->getRequestStack()->getCurrentRequest() can also be of type null; however, parameter $request of SprykerEco\Yves\Computop...ssMapper::__construct() does only seem to accept Symfony\Component\HttpFoundation\Request, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

530
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
531
            $this->getUtilEncodingService(),
532
            $this->getCountryClient()
533
        );
534
    }
535
536
    /**
537
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
538
     */
539
    public function createOrderDirectDebitMapper(): MapperInterface
540
    {
541
        return new DirectDebitMapper(
542
            $this->getComputopApiService(),
543
            $this->getRouter(),
544
            $this->getStore(),
545
            $this->getConfig(),
546
            $this->getRequestStack()->getCurrentRequest(),
0 ignored issues
show
Bug introduced by
It seems like $this->getRequestStack()->getCurrentRequest() can also be of type null; however, parameter $request of SprykerEco\Yves\Computop...itMapper::__construct() does only seem to accept Symfony\Component\HttpFoundation\Request, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

546
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
547
            $this->getUtilEncodingService(),
548
            $this->getCountryClient()
549
        );
550
    }
551
552
    /**
553
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
554
     */
555
    public function createOrderSofortMapper(): MapperInterface
556
    {
557
        return new SofortMapper(
558
            $this->getComputopApiService(),
559
            $this->getRouter(),
560
            $this->getStore(),
561
            $this->getConfig(),
562
            $this->getRequestStack()->getCurrentRequest(),
0 ignored issues
show
Bug introduced by
It seems like $this->getRequestStack()->getCurrentRequest() can also be of type null; however, parameter $request of SprykerEco\Yves\Computop...rtMapper::__construct() does only seem to accept Symfony\Component\HttpFoundation\Request, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

562
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
563
            $this->getUtilEncodingService(),
564
            $this->getCountryClient()
565
        );
566
    }
567
568
    /**
569
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
570
     */
571
    public function createOrderPaydirektMapper(): MapperInterface
572
    {
573
        return new PaydirektMapper(
574
            $this->getComputopApiService(),
575
            $this->getRouter(),
576
            $this->getStore(),
577
            $this->getConfig(),
578
            $this->getRequestStack()->getCurrentRequest(),
0 ignored issues
show
Bug introduced by
It seems like $this->getRequestStack()->getCurrentRequest() can also be of type null; however, parameter $request of SprykerEco\Yves\Computop...ktMapper::__construct() does only seem to accept Symfony\Component\HttpFoundation\Request, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

578
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
579
            $this->getUtilEncodingService(),
580
            $this->getCountryClient()
581
        );
582
    }
583
584
    /**
585
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
586
     */
587
    public function createOrderIdealMapper(): MapperInterface
588
    {
589
        return new IdealMapper(
590
            $this->getComputopApiService(),
591
            $this->getRouter(),
592
            $this->getStore(),
593
            $this->getConfig(),
594
            $this->getRequestStack()->getCurrentRequest(),
0 ignored issues
show
Bug introduced by
It seems like $this->getRequestStack()->getCurrentRequest() can also be of type null; however, parameter $request of SprykerEco\Yves\Computop...alMapper::__construct() does only seem to accept Symfony\Component\HttpFoundation\Request, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

594
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
595
            $this->getUtilEncodingService(),
596
            $this->getCountryClient()
597
        );
598
    }
599
600
    /**
601
     * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface
602
     */
603
    public function createOrderEasyCreditMapper(): MapperInterface
604
    {
605
        return new EasyCreditMapper(
606
            $this->getComputopApiService(),
607
            $this->getRouter(),
608
            $this->getStore(),
609
            $this->getConfig(),
610
            $this->getRequestStack()->getCurrentRequest(),
0 ignored issues
show
Bug introduced by
It seems like $this->getRequestStack()->getCurrentRequest() can also be of type null; however, parameter $request of SprykerEco\Yves\Computop...itMapper::__construct() does only seem to accept Symfony\Component\HttpFoundation\Request, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

610
            /** @scrutinizer ignore-type */ $this->getRequestStack()->getCurrentRequest(),
Loading history...
611
            $this->getUtilEncodingService(),
612
            $this->getCountryClient()
613
        );
614
    }
615
616
    /**
617
     * @return \Spryker\Yves\Router\Router\RouterInterface
618
     */
619
    public function getRouter(): RouterInterface
620
    {
621
        return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_ROUTER);
622
    }
623
624
    /**
625
     * @return \Symfony\Component\HttpFoundation\RequestStack
626
     */
627
    public function getRequestStack(): RequestStack
628
    {
629
        return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_REQUEST_STACK);
630
    }
631
632
    /**
633
     * @return \SprykerEco\Yves\Computop\Dependency\Service\ComputopToUtilEncodingServiceInterface
634
     */
635
    public function getUtilEncodingService(): ComputopToUtilEncodingServiceInterface
636
    {
637
        return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_UTIL_ENCODING);
638
    }
639
640
    /**
641
     * @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToCountryClientInterface
642
     */
643
    public function getCountryClient(): ComputopToCountryClientInterface
644
    {
645
        return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_COUNTRY);
646
    }
647
648
    /**
649
     * @return \SprykerEco\Yves\Computop\Mapper\Init\PrePlace\PayPalExpressToQuoteMapperInterface
650
     */
651
    public function createPayPalExpressToQuoteMapper(): PayPalExpressToQuoteMapperInterface
652
    {
653
        return new PayPalExpressToQuoteMapper();
654
    }
655
656
    /**
657
     * @return array<\SprykerEco\Yves\ComputopExtension\Dependency\Plugin\PayPalExpressInitQuoteExpanderPluginInterface>
658
     */
659
    public function getPayPalExpressInitQuoteExpanderPlugins(): array
660
    {
661
        return $this->getProvidedDependency(ComputopDependencyProvider::PLUGINS_PAYPAL_EXPRESS_INIT_QUOTE_EXPANDER);
662
    }
663
}
664