AdyenApiBusinessFactory::getUtilEncodingService()   A
last analyzed

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
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Zed\AdyenApi\Business;
9
10
use Spryker\Zed\Kernel\Business\AbstractBusinessFactory;
11
use SprykerEco\Zed\AdyenApi\AdyenApiDependencyProvider;
12
use SprykerEco\Zed\AdyenApi\Business\Adapter\AdjustAuthorizationAdapter;
13
use SprykerEco\Zed\AdyenApi\Business\Adapter\AdyenApiAdapterInterface;
14
use SprykerEco\Zed\AdyenApi\Business\Adapter\Authorize3dAdapter;
15
use SprykerEco\Zed\AdyenApi\Business\Adapter\AuthorizeAdapter;
16
use SprykerEco\Zed\AdyenApi\Business\Adapter\CancelAdapter;
17
use SprykerEco\Zed\AdyenApi\Business\Adapter\CancelOrRefundAdapter;
18
use SprykerEco\Zed\AdyenApi\Business\Adapter\CaptureAdapter;
19
use SprykerEco\Zed\AdyenApi\Business\Adapter\GetPaymentMethodsAdapter;
20
use SprykerEco\Zed\AdyenApi\Business\Adapter\MakePaymentAdapter;
21
use SprykerEco\Zed\AdyenApi\Business\Adapter\PaymentDetailsAdapter;
22
use SprykerEco\Zed\AdyenApi\Business\Adapter\RefundAdapter;
23
use SprykerEco\Zed\AdyenApi\Business\Adapter\TechnicalCancelAdapter;
24
use SprykerEco\Zed\AdyenApi\Business\Converter\AdjustAuthorizationConverter;
25
use SprykerEco\Zed\AdyenApi\Business\Converter\AdyenApiConverterInterface;
26
use SprykerEco\Zed\AdyenApi\Business\Converter\Authorize3dConverter;
27
use SprykerEco\Zed\AdyenApi\Business\Converter\AuthorizeConverter;
28
use SprykerEco\Zed\AdyenApi\Business\Converter\CancelConverter;
29
use SprykerEco\Zed\AdyenApi\Business\Converter\CancelOrRefundConverter;
30
use SprykerEco\Zed\AdyenApi\Business\Converter\CaptureConverter;
31
use SprykerEco\Zed\AdyenApi\Business\Converter\GetPaymentMethodsConverter;
32
use SprykerEco\Zed\AdyenApi\Business\Converter\MakePaymentConverter;
33
use SprykerEco\Zed\AdyenApi\Business\Converter\PaymentDetailsConverter;
34
use SprykerEco\Zed\AdyenApi\Business\Converter\RefundConverter;
35
use SprykerEco\Zed\AdyenApi\Business\Converter\TechnicalCancelConverter;
36
use SprykerEco\Zed\AdyenApi\Business\Mapper\AdjustAuthorizationMapper;
37
use SprykerEco\Zed\AdyenApi\Business\Mapper\AdyenApiMapperInterface;
38
use SprykerEco\Zed\AdyenApi\Business\Mapper\Authorize3dMapper;
39
use SprykerEco\Zed\AdyenApi\Business\Mapper\AuthorizeMapper;
40
use SprykerEco\Zed\AdyenApi\Business\Mapper\CancelMapper;
41
use SprykerEco\Zed\AdyenApi\Business\Mapper\CancelOrRefundMapper;
42
use SprykerEco\Zed\AdyenApi\Business\Mapper\CaptureMapper;
43
use SprykerEco\Zed\AdyenApi\Business\Mapper\GetPaymentMethodsMapper;
44
use SprykerEco\Zed\AdyenApi\Business\Mapper\MakePaymentMapper;
45
use SprykerEco\Zed\AdyenApi\Business\Mapper\PaymentDetailsMapper;
46
use SprykerEco\Zed\AdyenApi\Business\Mapper\RefundMapper;
47
use SprykerEco\Zed\AdyenApi\Business\Mapper\TechnicalCancelMapper;
48
use SprykerEco\Zed\AdyenApi\Business\Request\AdyenApiRequest;
49
use SprykerEco\Zed\AdyenApi\Business\Request\AdyenApiRequestInterface;
50
use SprykerEco\Zed\AdyenApi\Dependency\Service\AdyenApiToUtilEncodingServiceInterface;
51
52
/**
53
 * @method \SprykerEco\Zed\AdyenApi\AdyenApiConfig getConfig()
54
 */
55
class AdyenApiBusinessFactory extends AbstractBusinessFactory
56
{
57
    /**
58
     * @return \SprykerEco\Zed\AdyenApi\Business\Request\AdyenApiRequestInterface
59
     */
60
    public function createGetPaymentMethodsRequest(): AdyenApiRequestInterface
61
    {
62
        return new AdyenApiRequest(
63
            $this->createGetPaymentMethodsAdapter(),
64
            $this->createGetPaymentMethodsConverter(),
65
            $this->createGetPaymentMethodsMapper(),
66
            $this->getConfig()
67
        );
68
    }
69
70
    /**
71
     * @return \SprykerEco\Zed\AdyenApi\Business\Request\AdyenApiRequestInterface
72
     */
73
    public function createMakePaymentRequest(): AdyenApiRequestInterface
74
    {
75
        return new AdyenApiRequest(
76
            $this->createMakePaymentAdapter(),
77
            $this->createMakePaymentConverter(),
78
            $this->createMakePaymentMapper(),
79
            $this->getConfig()
80
        );
81
    }
82
83
    /**
84
     * @return \SprykerEco\Zed\AdyenApi\Business\Request\AdyenApiRequestInterface
85
     */
86
    public function createPaymentDetailsRequest(): AdyenApiRequestInterface
87
    {
88
        return new AdyenApiRequest(
89
            $this->createPaymentDetailsAdapter(),
90
            $this->createPaymentDetailsConverter(),
91
            $this->createPaymentDetailsMapper(),
92
            $this->getConfig()
93
        );
94
    }
95
96
    /**
97
     * @return \SprykerEco\Zed\AdyenApi\Business\Request\AdyenApiRequestInterface
98
     */
99
    public function createAuthorizeRequest(): AdyenApiRequestInterface
100
    {
101
        return new AdyenApiRequest(
102
            $this->createAuthorizeAdapter(),
103
            $this->createAuthorizeConverter(),
104
            $this->createAuthorizeMapper(),
105
            $this->getConfig()
106
        );
107
    }
108
109
    /**
110
     * @return \SprykerEco\Zed\AdyenApi\Business\Request\AdyenApiRequestInterface
111
     */
112
    public function createAuthorize3dRequest(): AdyenApiRequestInterface
113
    {
114
        return new AdyenApiRequest(
115
            $this->createAuthorize3dAdapter(),
116
            $this->createAuthorize3dConverter(),
117
            $this->createAuthorize3dMapper(),
118
            $this->getConfig()
119
        );
120
    }
121
122
    /**
123
     * @return \SprykerEco\Zed\AdyenApi\Business\Request\AdyenApiRequestInterface
124
     */
125
    public function createCaptureRequest(): AdyenApiRequestInterface
126
    {
127
        return new AdyenApiRequest(
128
            $this->createCaptureAdapter(),
129
            $this->createCaptureConverter(),
130
            $this->createCaptureMapper(),
131
            $this->getConfig()
132
        );
133
    }
134
135
    /**
136
     * @return \SprykerEco\Zed\AdyenApi\Business\Request\AdyenApiRequestInterface
137
     */
138
    public function createCancelRequest(): AdyenApiRequestInterface
139
    {
140
        return new AdyenApiRequest(
141
            $this->createCancelAdapter(),
142
            $this->createCancelConverter(),
143
            $this->createCancelMapper(),
144
            $this->getConfig()
145
        );
146
    }
147
148
    /**
149
     * @return \SprykerEco\Zed\AdyenApi\Business\Request\AdyenApiRequestInterface
150
     */
151
    public function createRefundRequest(): AdyenApiRequestInterface
152
    {
153
        return new AdyenApiRequest(
154
            $this->createRefundAdapter(),
155
            $this->createRefundConverter(),
156
            $this->createRefundMapper(),
157
            $this->getConfig()
158
        );
159
    }
160
161
    /**
162
     * @return \SprykerEco\Zed\AdyenApi\Business\Request\AdyenApiRequestInterface
163
     */
164
    public function createCancelOrRefundRequest(): AdyenApiRequestInterface
165
    {
166
        return new AdyenApiRequest(
167
            $this->createCancelOrRefundAdapter(),
168
            $this->createCancelOrRefundConverter(),
169
            $this->createCancelOrRefundMapper(),
170
            $this->getConfig()
171
        );
172
    }
173
174
    /**
175
     * @return \SprykerEco\Zed\AdyenApi\Business\Request\AdyenApiRequestInterface
176
     */
177
    public function createTechnicalCancelRequest(): AdyenApiRequestInterface
178
    {
179
        return new AdyenApiRequest(
180
            $this->createTechnicalCancelAdapter(),
181
            $this->createTechnicalCancelConverter(),
182
            $this->createTechnicalCancelMapper(),
183
            $this->getConfig()
184
        );
185
    }
186
187
    /**
188
     * @return \SprykerEco\Zed\AdyenApi\Business\Request\AdyenApiRequestInterface
189
     */
190
    public function createAdjustAuthorizationRequest(): AdyenApiRequestInterface
191
    {
192
        return new AdyenApiRequest(
193
            $this->createAdjustAuthorizationAdapter(),
194
            $this->createAdjustAuthorizationConverter(),
195
            $this->createAdjustAuthorizationMapper(),
196
            $this->getConfig()
197
        );
198
    }
199
200
    /**
201
     * @return \SprykerEco\Zed\AdyenApi\Business\Adapter\AdyenApiAdapterInterface
202
     */
203
    public function createGetPaymentMethodsAdapter(): AdyenApiAdapterInterface
204
    {
205
        return new GetPaymentMethodsAdapter(
206
            $this->getConfig(),
207
            $this->getUtilEncodingService()
208
        );
209
    }
210
211
    /**
212
     * @return \SprykerEco\Zed\AdyenApi\Business\Adapter\AdyenApiAdapterInterface
213
     */
214
    public function createMakePaymentAdapter(): AdyenApiAdapterInterface
215
    {
216
        return new MakePaymentAdapter(
217
            $this->getConfig(),
218
            $this->getUtilEncodingService()
219
        );
220
    }
221
222
    /**
223
     * @return \SprykerEco\Zed\AdyenApi\Business\Adapter\AdyenApiAdapterInterface
224
     */
225
    public function createPaymentDetailsAdapter(): AdyenApiAdapterInterface
226
    {
227
        return new PaymentDetailsAdapter(
228
            $this->getConfig(),
229
            $this->getUtilEncodingService()
230
        );
231
    }
232
233
    /**
234
     * @return \SprykerEco\Zed\AdyenApi\Business\Adapter\AdyenApiAdapterInterface
235
     */
236
    public function createAuthorizeAdapter(): AdyenApiAdapterInterface
237
    {
238
        return new AuthorizeAdapter(
239
            $this->getConfig(),
240
            $this->getUtilEncodingService()
241
        );
242
    }
243
244
    /**
245
     * @return \SprykerEco\Zed\AdyenApi\Business\Adapter\AdyenApiAdapterInterface
246
     */
247
    public function createAuthorize3dAdapter(): AdyenApiAdapterInterface
248
    {
249
        return new Authorize3dAdapter(
250
            $this->getConfig(),
251
            $this->getUtilEncodingService()
252
        );
253
    }
254
255
    /**
256
     * @return \SprykerEco\Zed\AdyenApi\Business\Adapter\AdyenApiAdapterInterface
257
     */
258
    public function createCaptureAdapter(): AdyenApiAdapterInterface
259
    {
260
        return new CaptureAdapter(
261
            $this->getConfig(),
262
            $this->getUtilEncodingService()
263
        );
264
    }
265
266
    /**
267
     * @return \SprykerEco\Zed\AdyenApi\Business\Adapter\AdyenApiAdapterInterface
268
     */
269
    public function createCancelAdapter(): AdyenApiAdapterInterface
270
    {
271
        return new CancelAdapter(
272
            $this->getConfig(),
273
            $this->getUtilEncodingService()
274
        );
275
    }
276
277
    /**
278
     * @return \SprykerEco\Zed\AdyenApi\Business\Adapter\AdyenApiAdapterInterface
279
     */
280
    public function createRefundAdapter(): AdyenApiAdapterInterface
281
    {
282
        return new RefundAdapter(
283
            $this->getConfig(),
284
            $this->getUtilEncodingService()
285
        );
286
    }
287
288
    /**
289
     * @return \SprykerEco\Zed\AdyenApi\Business\Adapter\AdyenApiAdapterInterface
290
     */
291
    public function createCancelOrRefundAdapter(): AdyenApiAdapterInterface
292
    {
293
        return new CancelOrRefundAdapter(
294
            $this->getConfig(),
295
            $this->getUtilEncodingService()
296
        );
297
    }
298
299
    /**
300
     * @return \SprykerEco\Zed\AdyenApi\Business\Adapter\AdyenApiAdapterInterface
301
     */
302
    public function createTechnicalCancelAdapter(): AdyenApiAdapterInterface
303
    {
304
        return new TechnicalCancelAdapter(
305
            $this->getConfig(),
306
            $this->getUtilEncodingService()
307
        );
308
    }
309
310
    /**
311
     * @return \SprykerEco\Zed\AdyenApi\Business\Adapter\AdyenApiAdapterInterface
312
     */
313
    public function createAdjustAuthorizationAdapter(): AdyenApiAdapterInterface
314
    {
315
        return new AdjustAuthorizationAdapter(
316
            $this->getConfig(),
317
            $this->getUtilEncodingService()
318
        );
319
    }
320
321
    /**
322
     * @return \SprykerEco\Zed\AdyenApi\Business\Converter\AdyenApiConverterInterface
323
     */
324
    public function createGetPaymentMethodsConverter(): AdyenApiConverterInterface
325
    {
326
        return new GetPaymentMethodsConverter(
327
            $this->getConfig(),
328
            $this->getUtilEncodingService()
329
        );
330
    }
331
332
    /**
333
     * @return \SprykerEco\Zed\AdyenApi\Business\Converter\AdyenApiConverterInterface
334
     */
335
    public function createMakePaymentConverter(): AdyenApiConverterInterface
336
    {
337
        return new MakePaymentConverter(
338
            $this->getConfig(),
339
            $this->getUtilEncodingService()
340
        );
341
    }
342
343
    /**
344
     * @return \SprykerEco\Zed\AdyenApi\Business\Converter\AdyenApiConverterInterface
345
     */
346
    public function createPaymentDetailsConverter(): AdyenApiConverterInterface
347
    {
348
        return new PaymentDetailsConverter(
349
            $this->getConfig(),
350
            $this->getUtilEncodingService()
351
        );
352
    }
353
354
    /**
355
     * @return \SprykerEco\Zed\AdyenApi\Business\Converter\AdyenApiConverterInterface
356
     */
357
    public function createAuthorizeConverter(): AdyenApiConverterInterface
358
    {
359
        return new AuthorizeConverter(
360
            $this->getConfig(),
361
            $this->getUtilEncodingService()
362
        );
363
    }
364
365
    /**
366
     * @return \SprykerEco\Zed\AdyenApi\Business\Converter\AdyenApiConverterInterface
367
     */
368
    public function createAuthorize3dConverter(): AdyenApiConverterInterface
369
    {
370
        return new Authorize3dConverter(
371
            $this->getConfig(),
372
            $this->getUtilEncodingService()
373
        );
374
    }
375
376
    /**
377
     * @return \SprykerEco\Zed\AdyenApi\Business\Converter\AdyenApiConverterInterface
378
     */
379
    public function createCaptureConverter(): AdyenApiConverterInterface
380
    {
381
        return new CaptureConverter(
382
            $this->getConfig(),
383
            $this->getUtilEncodingService()
384
        );
385
    }
386
387
    /**
388
     * @return \SprykerEco\Zed\AdyenApi\Business\Converter\AdyenApiConverterInterface
389
     */
390
    public function createCancelConverter(): AdyenApiConverterInterface
391
    {
392
        return new CancelConverter(
393
            $this->getConfig(),
394
            $this->getUtilEncodingService()
395
        );
396
    }
397
398
    /**
399
     * @return \SprykerEco\Zed\AdyenApi\Business\Converter\AdyenApiConverterInterface
400
     */
401
    public function createRefundConverter(): AdyenApiConverterInterface
402
    {
403
        return new RefundConverter(
404
            $this->getConfig(),
405
            $this->getUtilEncodingService()
406
        );
407
    }
408
409
    /**
410
     * @return \SprykerEco\Zed\AdyenApi\Business\Converter\AdyenApiConverterInterface
411
     */
412
    public function createCancelOrRefundConverter(): AdyenApiConverterInterface
413
    {
414
        return new CancelOrRefundConverter(
415
            $this->getConfig(),
416
            $this->getUtilEncodingService()
417
        );
418
    }
419
420
    /**
421
     * @return \SprykerEco\Zed\AdyenApi\Business\Converter\AdyenApiConverterInterface
422
     */
423
    public function createTechnicalCancelConverter(): AdyenApiConverterInterface
424
    {
425
        return new TechnicalCancelConverter(
426
            $this->getConfig(),
427
            $this->getUtilEncodingService()
428
        );
429
    }
430
431
    /**
432
     * @return \SprykerEco\Zed\AdyenApi\Business\Converter\AdyenApiConverterInterface
433
     */
434
    public function createAdjustAuthorizationConverter(): AdyenApiConverterInterface
435
    {
436
        return new AdjustAuthorizationConverter(
437
            $this->getConfig(),
438
            $this->getUtilEncodingService()
439
        );
440
    }
441
442
    /**
443
     * @return \SprykerEco\Zed\AdyenApi\Business\Mapper\AdyenApiMapperInterface
444
     */
445
    public function createGetPaymentMethodsMapper(): AdyenApiMapperInterface
446
    {
447
        return new GetPaymentMethodsMapper($this->getConfig());
448
    }
449
450
    /**
451
     * @return \SprykerEco\Zed\AdyenApi\Business\Mapper\AdyenApiMapperInterface
452
     */
453
    public function createMakePaymentMapper(): AdyenApiMapperInterface
454
    {
455
        return new MakePaymentMapper($this->getConfig());
456
    }
457
458
    /**
459
     * @return \SprykerEco\Zed\AdyenApi\Business\Mapper\AdyenApiMapperInterface
460
     */
461
    public function createPaymentDetailsMapper(): AdyenApiMapperInterface
462
    {
463
        return new PaymentDetailsMapper($this->getConfig());
464
    }
465
466
    /**
467
     * @return \SprykerEco\Zed\AdyenApi\Business\Mapper\AdyenApiMapperInterface
468
     */
469
    public function createAuthorizeMapper(): AdyenApiMapperInterface
470
    {
471
        return new AuthorizeMapper($this->getConfig());
472
    }
473
474
    /**
475
     * @return \SprykerEco\Zed\AdyenApi\Business\Mapper\AdyenApiMapperInterface
476
     */
477
    public function createAuthorize3dMapper(): AdyenApiMapperInterface
478
    {
479
        return new Authorize3dMapper($this->getConfig());
480
    }
481
482
    /**
483
     * @return \SprykerEco\Zed\AdyenApi\Business\Mapper\AdyenApiMapperInterface
484
     */
485
    public function createCaptureMapper(): AdyenApiMapperInterface
486
    {
487
        return new CaptureMapper($this->getConfig());
488
    }
489
490
    /**
491
     * @return \SprykerEco\Zed\AdyenApi\Business\Mapper\AdyenApiMapperInterface
492
     */
493
    public function createCancelMapper(): AdyenApiMapperInterface
494
    {
495
        return new CancelMapper($this->getConfig());
496
    }
497
498
    /**
499
     * @return \SprykerEco\Zed\AdyenApi\Business\Mapper\AdyenApiMapperInterface
500
     */
501
    public function createRefundMapper(): AdyenApiMapperInterface
502
    {
503
        return new RefundMapper($this->getConfig());
504
    }
505
506
    /**
507
     * @return \SprykerEco\Zed\AdyenApi\Business\Mapper\AdyenApiMapperInterface
508
     */
509
    public function createCancelOrRefundMapper(): AdyenApiMapperInterface
510
    {
511
        return new CancelOrRefundMapper($this->getConfig());
512
    }
513
514
    /**
515
     * @return \SprykerEco\Zed\AdyenApi\Business\Mapper\AdyenApiMapperInterface
516
     */
517
    public function createTechnicalCancelMapper(): AdyenApiMapperInterface
518
    {
519
        return new TechnicalCancelMapper($this->getConfig());
520
    }
521
522
    /**
523
     * @return \SprykerEco\Zed\AdyenApi\Business\Mapper\AdyenApiMapperInterface
524
     */
525
    public function createAdjustAuthorizationMapper(): AdyenApiMapperInterface
526
    {
527
        return new AdjustAuthorizationMapper($this->getConfig());
528
    }
529
530
    /**
531
     * @return \SprykerEco\Zed\AdyenApi\Dependency\Service\AdyenApiToUtilEncodingServiceInterface
532
     */
533
    public function getUtilEncodingService(): AdyenApiToUtilEncodingServiceInterface
534
    {
535
        return $this->getProvidedDependency(AdyenApiDependencyProvider::SERVICE_UTIL_ENCODING);
536
    }
537
}
538