Passed
Pull Request — master (#82)
by John
07:07
created

getStandardParameterMapperPlugins()   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\Zed\Payone\Business;
9
10
use Generated\Shared\Transfer\PayoneStandardParameterTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...andardParameterTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Generated\Shared\Transfer\PayoneTransactionStatusUpdateTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...ionStatusUpdateTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use Spryker\Shared\Kernel\Store;
13
use Spryker\Zed\Kernel\Business\AbstractBusinessFactory;
14
use SprykerEco\Shared\Payone\Dependency\HashInterface;
15
use SprykerEco\Shared\Payone\Dependency\ModeDetectorInterface;
16
use SprykerEco\Shared\Payone\PayoneApiConstants;
17
use SprykerEco\Zed\Payone\Business\Api\Adapter\AdapterInterface;
18
use SprykerEco\Zed\Payone\Business\Api\Adapter\Http\Guzzle;
19
use SprykerEco\Zed\Payone\Business\Api\Log\ApiCallLogWriter;
20
use SprykerEco\Zed\Payone\Business\Api\Response\Mapper\AuthorizationResponseMapper;
21
use SprykerEco\Zed\Payone\Business\Api\Response\Mapper\AuthorizationResponseMapperInterface;
22
use SprykerEco\Zed\Payone\Business\Api\Response\Mapper\CaptureResponseMapper;
23
use SprykerEco\Zed\Payone\Business\Api\Response\Mapper\CaptureResponseMapperInterface;
24
use SprykerEco\Zed\Payone\Business\Api\Response\Mapper\CreditCardCheckResponseMapper;
25
use SprykerEco\Zed\Payone\Business\Api\Response\Mapper\CreditCardCheckResponseMapperInterface;
26
use SprykerEco\Zed\Payone\Business\Api\Response\Mapper\DebitResponseMapper;
27
use SprykerEco\Zed\Payone\Business\Api\Response\Mapper\DebitResponseMapperInterface;
28
use SprykerEco\Zed\Payone\Business\Api\Response\Mapper\RefundResponseMapper;
29
use SprykerEco\Zed\Payone\Business\Api\Response\Mapper\RefundResponseMapperInterface;
30
use SprykerEco\Zed\Payone\Business\Api\TransactionStatus\TransactionStatusRequest;
31
use SprykerEco\Zed\Payone\Business\ApiLog\ApiLogFinder;
32
use SprykerEco\Zed\Payone\Business\ApiLog\ApiLogFinderInterface;
33
use SprykerEco\Zed\Payone\Business\ConditionChecker\PaymentDataChecker;
34
use SprykerEco\Zed\Payone\Business\ConditionChecker\PaymentDataCheckerInterface;
35
use SprykerEco\Zed\Payone\Business\ConditionChecker\RefundChecker;
36
use SprykerEco\Zed\Payone\Business\ConditionChecker\RefundCheckerInterface;
37
use SprykerEco\Zed\Payone\Business\Distributor\OrderPriceDistributor;
38
use SprykerEco\Zed\Payone\Business\Distributor\OrderPriceDistributorInterface;
39
use SprykerEco\Zed\Payone\Business\Key\HashGenerator;
40
use SprykerEco\Zed\Payone\Business\Key\HashGeneratorInterface;
41
use SprykerEco\Zed\Payone\Business\Key\HashProvider;
42
use SprykerEco\Zed\Payone\Business\Key\HmacGeneratorInterface;
43
use SprykerEco\Zed\Payone\Business\Key\UrlHmacGenerator;
44
use SprykerEco\Zed\Payone\Business\Mode\ModeDetector;
45
use SprykerEco\Zed\Payone\Business\Order\OrderManager;
46
use SprykerEco\Zed\Payone\Business\Order\OrderManagerInterface;
47
use SprykerEco\Zed\Payone\Business\Order\PayoneOrderItemStatusFinder;
48
use SprykerEco\Zed\Payone\Business\Order\PayoneOrderItemStatusFinderInterface;
49
use SprykerEco\Zed\Payone\Business\Payment\Checker\PayoneBankAccountChecker;
50
use SprykerEco\Zed\Payone\Business\Payment\Checker\PayoneBankAccountCheckerInterface;
51
use SprykerEco\Zed\Payone\Business\Payment\Checker\PayoneCreditCardChecker;
52
use SprykerEco\Zed\Payone\Business\Payment\Checker\PayoneCreditCardCheckerInterface;
53
use SprykerEco\Zed\Payone\Business\Payment\DataMapper\DiscountMapper;
54
use SprykerEco\Zed\Payone\Business\Payment\DataMapper\DiscountMapperInterface;
55
use SprykerEco\Zed\Payone\Business\Payment\DataMapper\ExpenseMapper;
56
use SprykerEco\Zed\Payone\Business\Payment\DataMapper\ExpenseMapperInterface;
57
use SprykerEco\Zed\Payone\Business\Payment\DataMapper\PayoneRequestProductDataMapper;
58
use SprykerEco\Zed\Payone\Business\Payment\DataMapper\PayoneRequestProductDataMapperInterface;
59
use SprykerEco\Zed\Payone\Business\Payment\DataMapper\ProductMapper;
60
use SprykerEco\Zed\Payone\Business\Payment\DataMapper\ProductMapperInterface;
61
use SprykerEco\Zed\Payone\Business\Payment\DataMapper\ShipmentMapper;
62
use SprykerEco\Zed\Payone\Business\Payment\DataMapper\ShipmentMapperInterface;
63
use SprykerEco\Zed\Payone\Business\Payment\DataMapper\StandartParameterMapper;
64
use SprykerEco\Zed\Payone\Business\Payment\DataMapper\StandartParameterMapperInterface;
65
use SprykerEco\Zed\Payone\Business\Payment\GenericPaymentMethodMapperInterface;
66
use SprykerEco\Zed\Payone\Business\Payment\Hook\PostSaveHook;
67
use SprykerEco\Zed\Payone\Business\Payment\Hook\PostSaveHookInterface;
68
use SprykerEco\Zed\Payone\Business\Payment\MethodMapper\CashOnDelivery;
69
use SprykerEco\Zed\Payone\Business\Payment\MethodMapper\CreditCardPseudo;
70
use SprykerEco\Zed\Payone\Business\Payment\MethodMapper\CreditCardPseudoInterface;
71
use SprykerEco\Zed\Payone\Business\Payment\MethodMapper\DirectDebit;
72
use SprykerEco\Zed\Payone\Business\Payment\MethodMapper\DirectDebitInterface;
73
use SprykerEco\Zed\Payone\Business\Payment\MethodMapper\EWallet;
74
use SprykerEco\Zed\Payone\Business\Payment\MethodMapper\GenericPayment;
75
use SprykerEco\Zed\Payone\Business\Payment\MethodMapper\Invoice;
76
use SprykerEco\Zed\Payone\Business\Payment\MethodMapper\InvoiceInterface;
77
use SprykerEco\Zed\Payone\Business\Payment\MethodMapper\KlarnaPaymentMapper;
78
use SprykerEco\Zed\Payone\Business\Payment\MethodMapper\KlarnaPaymentMapperInterface;
79
use SprykerEco\Zed\Payone\Business\Payment\MethodMapper\OnlineBankTransfer;
80
use SprykerEco\Zed\Payone\Business\Payment\MethodMapper\Prepayment;
81
use SprykerEco\Zed\Payone\Business\Payment\MethodMapper\SecurityInvoice;
82
use SprykerEco\Zed\Payone\Business\Payment\PaymentMapperReader;
83
use SprykerEco\Zed\Payone\Business\Payment\PaymentMapperReaderInterface;
84
use SprykerEco\Zed\Payone\Business\Payment\PaymentMethodFilter;
85
use SprykerEco\Zed\Payone\Business\Payment\PaymentMethodFilterInterface;
86
use SprykerEco\Zed\Payone\Business\Payment\PaymentMethodMapperInterface;
87
use SprykerEco\Zed\Payone\Business\Payment\Reader\PayoneFileReader;
88
use SprykerEco\Zed\Payone\Business\Payment\Reader\PayoneFileReaderInterface;
89
use SprykerEco\Zed\Payone\Business\Payment\Reader\PayoneInvoiceReader;
90
use SprykerEco\Zed\Payone\Business\Payment\Reader\PayoneInvoiceReaderInterface;
91
use SprykerEco\Zed\Payone\Business\Payment\Reader\PayonePaypalExpressCheckoutDetailsReader;
92
use SprykerEco\Zed\Payone\Business\Payment\Reader\PayonePaypalExpressCheckoutDetailsReaderInterface;
93
use SprykerEco\Zed\Payone\Business\Payment\Reader\PayoneSecurityInvoiceReader;
94
use SprykerEco\Zed\Payone\Business\Payment\Reader\PayoneSecurityInvoiceReaderInterface;
95
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneAuthorizeRequestSender;
96
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneAuthorizeRequestSenderInterface;
97
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneBaseAuthorizeSender;
98
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneBaseAuthorizeSenderInterface;
99
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneCaptureRequestSender;
100
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneCaptureRequestSenderInterface;
101
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneDebitRequestSender;
102
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneDebitRequestSenderInterface;
103
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneGenericRequestMethodSender;
104
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneGenericRequestMethodSenderInterface;
105
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneInitPaypalExpressCheckoutMethodSender;
106
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneInitPaypalExpressCheckoutMethodSenderInterface;
107
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneKlarnaStartSessionMethodSender;
108
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneKlarnaStartSessionMethodSenderInterface;
109
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneManageMandateMethodSender;
110
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneManageMandateMethodSenderInterface;
111
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayonePartialCaptureRequestSender;
112
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayonePartialCaptureRequestSenderInterface;
113
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayonePartialRefundRequestSender;
114
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayonePartialRefundRequestSenderInterface;
115
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayonePreAuthorizeRequestSender;
116
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayonePreAuthorizeRequestSenderInterface;
117
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneRefundRequestSender;
118
use SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneRefundRequestSenderInterface;
119
use SprykerEco\Zed\Payone\Business\RiskManager\Factory\RiskCheckFactory;
120
use SprykerEco\Zed\Payone\Business\RiskManager\Factory\RiskCheckFactoryInterface;
121
use SprykerEco\Zed\Payone\Business\RiskManager\Mapper\RiskCheckMapper;
122
use SprykerEco\Zed\Payone\Business\RiskManager\Mapper\RiskCheckMapperInterface;
123
use SprykerEco\Zed\Payone\Business\RiskManager\RiskCheckManager;
124
use SprykerEco\Zed\Payone\Business\RiskManager\RiskCheckManagerInterface;
125
use SprykerEco\Zed\Payone\Business\SequenceNumber\SequenceNumberProvider;
126
use SprykerEco\Zed\Payone\Business\SequenceNumber\SequenceNumberProviderInterface;
127
use SprykerEco\Zed\Payone\Business\TransactionStatus\TransactionStatusUpdateManager;
128
use SprykerEco\Zed\Payone\Business\TransactionStatus\TransactionStatusUpdateManagerInterface;
129
use SprykerEco\Zed\Payone\Dependency\Facade\PayoneToGlossaryFacadeInterface;
130
use SprykerEco\Zed\Payone\PayoneDependencyProvider;
131
use Symfony\Component\HttpFoundation\RequestStack;
132
133
/**
134
 * @method \SprykerEco\Zed\Payone\PayoneConfig getConfig()
135
 * @method \SprykerEco\Zed\Payone\Persistence\PayoneQueryContainerInterface getQueryContainer()
136
 * @method \SprykerEco\Zed\Payone\Persistence\PayoneRepositoryInterface getRepository()
137
 * @method \SprykerEco\Zed\Payone\Persistence\PayoneEntityManagerInterface getEntityManager()
138
 */
139
class PayoneBusinessFactory extends AbstractBusinessFactory
140
{
141
    /**
142
     * @var \Generated\Shared\Transfer\PayoneStandardParameterTransfer
143
     */
144
    private $standardParameter;
145
146
    /**
147
     * @return \SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayonePreAuthorizeRequestSenderInterface
148
     */
149
    public function createPayonePreAuthorizeRequestSender(): PayonePreAuthorizeRequestSenderInterface
150
    {
151
        return new PayonePreAuthorizeRequestSender(
152
            $this->getQueryContainer(),
153
            $this->createPaymentMapperReader(),
154
            $this->createPayoneBaseAuthorizeSender(),
155
            $this->createAuthorizationResponseMapper(),
156
        );
157
    }
158
159
    /**
160
     * @return \SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneAuthorizeRequestSenderInterface
161
     */
162
    public function createPayoneAuthorizeRequestSender(): PayoneAuthorizeRequestSenderInterface
163
    {
164
        return new PayoneAuthorizeRequestSender(
165
            $this->getQueryContainer(),
166
            $this->createPaymentMapperReader(),
167
            $this->createPayoneRequestProductDataMapper(),
168
            $this->createPayoneBaseAuthorizeSender(),
169
            $this->createAuthorizationResponseMapper(),
170
        );
171
    }
172
173
    /**
174
     * @return \SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneCaptureRequestSenderInterface
175
     */
176
    public function createPayoneCaptureRequestSender(): PayoneCaptureRequestSenderInterface
177
    {
178
        return new PayoneCaptureRequestSender(
179
            $this->createExecutionAdapter(),
180
            $this->getQueryContainer(),
181
            $this->createPaymentMapperReader(),
182
            $this->getStandardParameter(),
183
            $this->createOrderPriceDistributor(),
184
            $this->createStandartParameterMapper(),
185
            $this->createPayoneRequestProductDataMapper(),
186
            $this->createExpenseMapper(),
187
            $this->createCaptureResponseMapper(),
188
        );
189
    }
190
191
    /**
192
     * @return \SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayonePartialCaptureRequestSenderInterface
193
     */
194
    public function createPayonePartialCaptureRequestSender(): PayonePartialCaptureRequestSenderInterface
195
    {
196
        return new PayonePartialCaptureRequestSender(
197
            $this->createExecutionAdapter(),
198
            $this->getQueryContainer(),
199
            $this->createPaymentMapperReader(),
200
            $this->createExpenseMapper(),
201
            $this->getStandardParameter(),
202
            $this->getRepository(),
203
            $this->getEntityManager(),
204
            $this->createOrderPriceDistributor(),
205
            $this->createStandartParameterMapper(),
206
            $this->createShipmentMapper(),
207
            $this->createCaptureResponseMapper(),
208
        );
209
    }
210
211
    /**
212
     * @return \SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneDebitRequestSenderInterface
213
     */
214
    public function createPayoneDebitRequestSender(): PayoneDebitRequestSenderInterface
215
    {
216
        return new PayoneDebitRequestSender(
217
            $this->createExecutionAdapter(),
218
            $this->getQueryContainer(),
219
            $this->getStandardParameter(),
220
            $this->createStandartParameterMapper(),
221
            $this->createPaymentMapperReader(),
222
            $this->createDebitResponseMapper(),
223
        );
224
    }
225
226
    /**
227
     * @return \SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneRefundRequestSenderInterface
228
     */
229
    public function createPayoneRefundRequestSender(): PayoneRefundRequestSenderInterface
230
    {
231
        return new PayoneRefundRequestSender(
232
            $this->createExecutionAdapter(),
233
            $this->getQueryContainer(),
234
            $this->createPaymentMapperReader(),
235
            $this->getStandardParameter(),
236
            $this->createOrderPriceDistributor(),
237
            $this->createStandartParameterMapper(),
238
            $this->createPayoneRequestProductDataMapper(),
239
            $this->createRefundResponseMapper(),
240
        );
241
    }
242
243
    /**
244
     * @return \SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayonePartialRefundRequestSenderInterface
245
     */
246
    public function createPayonePartialRefundRequestSender(): PayonePartialRefundRequestSenderInterface
247
    {
248
        return new PayonePartialRefundRequestSender(
249
            $this->createExecutionAdapter(),
250
            $this->getQueryContainer(),
251
            $this->createPaymentMapperReader(),
252
            $this->getStandardParameter(),
253
            $this->getRepository(),
254
            $this->getEntityManager(),
255
            $this->createStandartParameterMapper(),
256
            $this->createRefundResponseMapper(),
257
        );
258
    }
259
260
    /**
261
     * @return \SprykerEco\Zed\Payone\Business\Payment\Checker\PayoneBankAccountCheckerInterface
262
     */
263
    public function createPayoneBankAccountChecker(): PayoneBankAccountCheckerInterface
264
    {
265
        return new PayoneBankAccountChecker(
266
            $this->createExecutionAdapter(),
267
            $this->createPaymentMapperReader(),
268
            $this->getStandardParameter(),
269
            $this->createStandartParameterMapper(),
270
        );
271
    }
272
273
    /**
274
     * @return \SprykerEco\Zed\Payone\Business\Payment\Checker\PayoneCreditCardCheckerInterface
275
     */
276
    public function createPayoneCreditCardChecker(): PayoneCreditCardCheckerInterface
277
    {
278
        return new PayoneCreditCardChecker(
279
            $this->createExecutionAdapter(),
280
            $this->getStandardParameter(),
281
            $this->createStandartParameterMapper(),
282
            $this->createPaymentMapperReader(),
283
            $this->createCreditCardCheckResponseMapper(),
284
        );
285
    }
286
287
    /**
288
     * @return \SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneManageMandateMethodSenderInterface
289
     */
290
    public function createPayoneManageMandateMethodSender(): PayoneManageMandateMethodSenderInterface
291
    {
292
        return new PayoneManageMandateMethodSender(
293
            $this->createExecutionAdapter(),
294
            $this->getStandardParameter(),
295
            $this->createStandartParameterMapper(),
296
            $this->createPaymentMapperReader(),
297
        );
298
    }
299
300
    /**
301
     * @return \SprykerEco\Zed\Payone\Business\Payment\Reader\PayoneFileReaderInterface
302
     */
303
    public function createPayoneFileReader(): PayoneFileReaderInterface
304
    {
305
        return new PayoneFileReader(
306
            $this->createExecutionAdapter(),
307
            $this->getQueryContainer(),
308
            $this->getStandardParameter(),
309
            $this->createStandartParameterMapper(),
310
            $this->createPaymentMapperReader(),
311
        );
312
    }
313
314
    /**
315
     * @return \SprykerEco\Zed\Payone\Business\Payment\Reader\PayoneInvoiceReaderInterface
316
     */
317
    public function createPayoneInvoiceReader(): PayoneInvoiceReaderInterface
318
    {
319
        return new PayoneInvoiceReader(
320
            $this->createExecutionAdapter(),
321
            $this->getQueryContainer(),
322
            $this->getStandardParameter(),
323
            $this->createStandartParameterMapper(),
324
            $this->createPaymentMapperReader(),
325
        );
326
    }
327
328
    /**
329
     * @return \SprykerEco\Zed\Payone\Business\Payment\Reader\PayoneSecurityInvoiceReaderInterface
330
     */
331
    public function createPayoneSecurityInvoiceReader(): PayoneSecurityInvoiceReaderInterface
332
    {
333
        return new PayoneSecurityInvoiceReader(
334
            $this->createExecutionAdapter(),
335
            $this->getQueryContainer(),
336
            $this->getStandardParameter(),
337
            $this->createStandartParameterMapper(),
338
            $this->createPaymentMapperReader(),
339
        );
340
    }
341
342
    /**
343
     * @return \SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneInitPaypalExpressCheckoutMethodSenderInterface
344
     */
345
    public function createPayoneInitPaypalExpressCheckoutMethodSender(): PayoneInitPaypalExpressCheckoutMethodSenderInterface
346
    {
347
        return new PayoneInitPaypalExpressCheckoutMethodSender(
348
            $this->createPaymentMapperReader(),
349
            $this->createPayoneGenericRequestMethodSender(),
350
        );
351
    }
352
353
    /**
354
     * @return \SprykerEco\Zed\Payone\Business\Payment\Reader\PayonePaypalExpressCheckoutDetailsReaderInterface
355
     */
356
    public function createPayonePaypalExpressCheckoutDetailsReader(): PayonePaypalExpressCheckoutDetailsReaderInterface
357
    {
358
        return new PayonePaypalExpressCheckoutDetailsReader(
359
            $this->createPaymentMapperReader(),
360
            $this->createPayoneGenericRequestMethodSender()
361
        );
362
    }
363
364
    /**
365
     * @return \SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneGenericRequestMethodSenderInterface
366
     */
367
    public function createPayoneGenericRequestMethodSender(): PayoneGenericRequestMethodSenderInterface
368
    {
369
        return new PayoneGenericRequestMethodSender(
370
            $this->createExecutionAdapter(),
371
            $this->getStandardParameter(),
372
            $this->createStandartParameterMapper(),
373
        );
374
    }
375
376
    /**
377
     * @return \SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneKlarnaStartSessionMethodSenderInterface
378
     */
379
    public function createPayoneKlarnaStartSessionMethodSender(): PayoneKlarnaStartSessionMethodSenderInterface
380
    {
381
        return new PayoneKlarnaStartSessionMethodSender(
382
            $this->createExecutionAdapter(),
383
            $this->createStandartParameterMapper(),
384
            $this->createPayoneRequestProductDataMapper(),
385
            $this->createKlarnaPaymentMapper($this->getStore()),
386
            $this->getStandardParameter(),
387
            $this->createSequenceNumberProvider(),
388
            $this->createUrlHmacGenerator(),
389
        );
390
    }
391
392
    /**
393
     * @return \SprykerEco\Zed\Payone\Business\Order\OrderManagerInterface
394
     */
395
    public function createOrderManager(): OrderManagerInterface
396
    {
397
        return new OrderManager($this->getConfig(), $this->getEntityManager());
398
    }
399
400
    /**
401
     * @return \SprykerEco\Zed\Payone\Business\TransactionStatus\TransactionStatusUpdateManagerInterface
402
     */
403
    public function createTransactionStatusManager(): TransactionStatusUpdateManagerInterface
404
    {
405
        return new TransactionStatusUpdateManager(
406
            $this->getQueryContainer(),
407
            $this->getStandardParameter(),
408
            $this->createHashGenerator()
409
        );
410
    }
411
412
    /**
413
     * @return \SprykerEco\Zed\Payone\Business\ApiLog\ApiLogFinderInterface
414
     */
415
    public function createApiLogFinder(): ApiLogFinderInterface
416
    {
417
        return new ApiLogFinder(
418
            $this->getQueryContainer()
419
        );
420
    }
421
422
    /**
423
     * @return \SprykerEco\Zed\Payone\Business\Api\Adapter\AdapterInterface
424
     */
425
    public function createExecutionAdapter(): AdapterInterface
426
    {
427
        return new Guzzle(
428
            $this->getStandardParameter()->getPaymentGatewayUrl(),
429
            $this->createApiCallLogWriter()
430
        );
431
    }
432
433
    /**
434
     * @return \SprykerEco\Zed\Payone\Business\Api\Log\ApiCallLogWriter
435
     */
436
    public function createApiCallLogWriter(): ApiCallLogWriter
437
    {
438
        return new ApiCallLogWriter(
439
            $this->getQueryContainer()
440
        );
441
    }
442
443
    /**
444
     * @return \SprykerEco\Zed\Payone\Business\SequenceNumber\SequenceNumberProviderInterface
445
     */
446
    public function createSequenceNumberProvider(): SequenceNumberProviderInterface
447
    {
448
        $defaultEmptySequenceNumber = $this->getConfig()->getEmptySequenceNumber();
449
450
        return new SequenceNumberProvider(
451
            $this->getQueryContainer(),
452
            $defaultEmptySequenceNumber
453
        );
454
    }
455
456
    /**
457
     * @return \SprykerEco\Shared\Payone\Dependency\HashInterface
458
     */
459
    public function createHashProvider(): HashInterface
460
    {
461
        return new HashProvider();
462
    }
463
464
    /**
465
     * @return \SprykerEco\Zed\Payone\Business\Key\HashGeneratorInterface
466
     */
467
    public function createHashGenerator(): HashGeneratorInterface
468
    {
469
        return new HashGenerator(
470
            $this->createHashProvider()
471
        );
472
    }
473
474
    /**
475
     * @return \SprykerEco\Zed\Payone\Business\Key\HmacGeneratorInterface
476
     */
477
    public function createUrlHmacGenerator(): HmacGeneratorInterface
478
    {
479
        return new UrlHmacGenerator();
480
    }
481
482
    /**
483
     * @return \SprykerEco\Shared\Payone\Dependency\ModeDetectorInterface
484
     */
485
    public function createModeDetector(): ModeDetectorInterface
486
    {
487
        return new ModeDetector($this->getConfig());
488
    }
489
490
    /**
491
     * @param \Generated\Shared\Transfer\PayoneTransactionStatusUpdateTransfer $transactionStatusUpdateTransfer
492
     *
493
     * @return \SprykerEco\Zed\Payone\Business\Api\TransactionStatus\TransactionStatusRequest
494
     */
495
    public function createTransactionStatusRequest(PayoneTransactionStatusUpdateTransfer $transactionStatusUpdateTransfer): TransactionStatusRequest
496
    {
497
        return new TransactionStatusRequest($transactionStatusUpdateTransfer->toArray());
498
    }
499
500
    /**
501
     * @return \SprykerEco\Zed\Payone\Business\Payment\RequestSender\PayoneBaseAuthorizeSenderInterface
502
     */
503
    public function createPayoneBaseAuthorizeSender(): PayoneBaseAuthorizeSenderInterface
504
    {
505
        return new PayoneBaseAuthorizeSender(
506
            $this->createExecutionAdapter(),
507
            $this->getQueryContainer(),
508
            $this->createPaymentMapperReader(),
509
            $this->getStandardParameter(),
510
            $this->createStandartParameterMapper(),
511
        );
512
    }
513
514
    /**
515
     * @param \Spryker\Shared\Kernel\Store $storeConfig
516
     *
517
     * @return \SprykerEco\Zed\Payone\Business\Payment\MethodMapper\CreditCardPseudoInterface
518
     */
519
    public function createCreditCardPseudo(Store $storeConfig): CreditCardPseudoInterface
520
    {
521
        return new CreditCardPseudo($storeConfig);
522
    }
523
524
    /**
525
     * @param \Spryker\Shared\Kernel\Store $storeConfig
526
     *
527
     * @return \SprykerEco\Zed\Payone\Business\Payment\MethodMapper\DirectDebitInterface
528
     */
529
    public function createDirectDebit(Store $storeConfig): DirectDebitInterface
530
    {
531
        return new DirectDebit($storeConfig);
532
    }
533
534
    /**
535
     * @param \Spryker\Shared\Kernel\Store $storeConfig
536
     *
537
     * @return \SprykerEco\Zed\Payone\Business\Payment\MethodMapper\InvoiceInterface
538
     */
539
    public function createInvoice(Store $storeConfig): InvoiceInterface
540
    {
541
        return new Invoice($storeConfig);
542
    }
543
544
    /**
545
     * @param \Spryker\Shared\Kernel\Store $storeConfig
546
     *
547
     * @return \SprykerEco\Zed\Payone\Business\Payment\PaymentMethodMapperInterface
548
     */
549
    public function createSecurityInvoice(Store $storeConfig): PaymentMethodMapperInterface
550
    {
551
        return new SecurityInvoice($storeConfig, $this->getConfig());
552
    }
553
554
    /**
555
     * @param \Spryker\Shared\Kernel\Store $storeConfig
556
     *
557
     * @return \SprykerEco\Zed\Payone\Business\Payment\PaymentMethodMapperInterface
558
     */
559
    public function createOnlineBankTransfer(Store $storeConfig): PaymentMethodMapperInterface
560
    {
561
        return new OnlineBankTransfer($storeConfig);
562
    }
563
564
    /**
565
     * @param \Spryker\Shared\Kernel\Store $storeConfig
566
     *
567
     * @return \SprykerEco\Zed\Payone\Business\Payment\PaymentMethodMapperInterface
568
     */
569
    public function createEWallet(Store $storeConfig): PaymentMethodMapperInterface
570
    {
571
        return new EWallet($storeConfig);
572
    }
573
574
    /**
575
     * @param \Spryker\Shared\Kernel\Store $storeConfig
576
     * @param \SprykerEco\Zed\Payone\Dependency\Facade\PayoneToGlossaryFacadeInterface $glossary
577
     *
578
     * @return \SprykerEco\Zed\Payone\Business\Payment\PaymentMethodMapperInterface
579
     */
580
    public function createCashOnDelivery(Store $storeConfig, PayoneToGlossaryFacadeInterface $glossary): PaymentMethodMapperInterface
581
    {
582
        return new CashOnDelivery($storeConfig, $glossary);
583
    }
584
585
    /**
586
     * @param \Spryker\Shared\Kernel\Store $storeConfig
587
     *
588
     * @return \SprykerEco\Zed\Payone\Business\Payment\PaymentMethodMapperInterface
589
     */
590
    public function createPrepayment(Store $storeConfig): PaymentMethodMapperInterface
591
    {
592
        return new Prepayment($storeConfig);
593
    }
594
595
    /**
596
     * @param \Spryker\Shared\Kernel\Store $store
597
     *
598
     * @return \SprykerEco\Zed\Payone\Business\Payment\GenericPaymentMethodMapperInterface
599
     */
600
    public function createGenericPayment(Store $store): GenericPaymentMethodMapperInterface
601
    {
602
        return new GenericPayment($store);
603
    }
604
605
    /**
606
     * @param \Spryker\Shared\Kernel\Store $store
607
     *
608
     * @return \SprykerEco\Zed\Payone\Business\Payment\MethodMapper\KlarnaPaymentMapperInterface
609
     */
610
    public function createKlarnaPaymentMapper(Store $store): KlarnaPaymentMapperInterface
611
    {
612
        return new KlarnaPaymentMapper($store, $this->getRequestStack());
613
    }
614
615
    /**
616
     * @return \SprykerEco\Zed\Payone\Business\RiskManager\RiskCheckManagerInterface
617
     */
618
    public function createRiskCheckManager(): RiskCheckManagerInterface
619
    {
620
        return new RiskCheckManager(
621
            $this->createRiskCheckMapper(),
622
            $this->createExecutionAdapter(),
623
            $this->createRiskCheckFactory()
624
        );
625
    }
626
627
    /**
628
     * @return \SprykerEco\Zed\Payone\Business\RiskManager\Mapper\RiskCheckMapperInterface
629
     */
630
    public function createRiskCheckMapper(): RiskCheckMapperInterface
631
    {
632
        return new RiskCheckMapper(
633
            $this->createRiskCheckFactory(),
634
            $this->getStandardParameter(),
635
            $this->createModeDetector(),
636
            $this->getConfig()
637
        );
638
    }
639
640
    /**
641
     * @return \SprykerEco\Zed\Payone\Business\RiskManager\Factory\RiskCheckFactoryInterface
642
     */
643
    public function createRiskCheckFactory(): RiskCheckFactoryInterface
644
    {
645
        return new RiskCheckFactory();
646
    }
647
648
    /**
649
     * @return \SprykerEco\Zed\Payone\Business\Payment\PaymentMethodFilterInterface
650
     */
651
    public function createPaymentMethodFilter(): PaymentMethodFilterInterface
652
    {
653
        return new PaymentMethodFilter($this->getConfig());
654
    }
655
656
    /**
657
     * @return \SprykerEco\Zed\Payone\Business\Order\PayoneOrderItemStatusFinderInterface
658
     */
659
    public function createPayoneOrderItemStatusFinder(): PayoneOrderItemStatusFinderInterface
660
    {
661
        return new PayoneOrderItemStatusFinder($this->getRepository());
662
    }
663
664
    /**
665
     * @return \SprykerEco\Zed\Payone\Business\Distributor\OrderPriceDistributorInterface
666
     */
667
    public function createOrderPriceDistributor(): OrderPriceDistributorInterface
668
    {
669
        return new OrderPriceDistributor();
670
    }
671
672
    /**
673
     * @return \SprykerEco\Zed\Payone\Business\Payment\DataMapper\StandartParameterMapperInterface
674
     */
675
    public function createStandartParameterMapper(): StandartParameterMapperInterface
676
    {
677
        return new StandartParameterMapper(
678
            $this->createHashGenerator(),
679
            $this->createModeDetector(),
680
            $this->getStandardParameterHydratorPlugins()
0 ignored issues
show
Bug introduced by
The method getStandardParameterHydratorPlugins() does not exist on SprykerEco\Zed\Payone\Bu...s\PayoneBusinessFactory. Did you maybe mean getStandardParameter()? ( Ignorable by Annotation )

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

680
            $this->/** @scrutinizer ignore-call */ 
681
                   getStandardParameterHydratorPlugins()

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
681
        );
682
    }
683
684
    /**
685
     * @return \SprykerEco\Zed\Payone\Business\Payment\DataMapper\PayoneRequestProductDataMapperInterface
686
     */
687
    public function createPayoneRequestProductDataMapper(): PayoneRequestProductDataMapperInterface
688
    {
689
        return new PayoneRequestProductDataMapper(
690
            $this->createProductMapper(),
691
            $this->createShipmentMapper(),
692
            $this->createDiscountMapper(),
693
        );
694
    }
695
696
    /**
697
     * @return \SprykerEco\Zed\Payone\Business\Payment\DataMapper\ProductMapperInterface
698
     */
699
    public function createProductMapper(): ProductMapperInterface
700
    {
701
        return new ProductMapper();
702
    }
703
704
    /**
705
     * @return \SprykerEco\Zed\Payone\Business\Payment\DataMapper\ShipmentMapperInterface
706
     */
707
    public function createShipmentMapper(): ShipmentMapperInterface
708
    {
709
        return new ShipmentMapper();
710
    }
711
712
    /**
713
     * @return \SprykerEco\Zed\Payone\Business\Payment\PaymentMapperReaderInterface
714
     */
715
    public function createPaymentMapperReader(): PaymentMapperReaderInterface
716
    {
717
        $paymentMapperReader = new PaymentMapperReader(
718
            $this->createSequenceNumberProvider(),
719
            $this->createUrlHmacGenerator()
720
        );
721
722
        foreach ($this->getAvailablePaymentMethods() as $paymentMethod) {
723
            $paymentMapperReader->registerPaymentMethodMapper($paymentMethod, $this->getStandardParameter());
724
        }
725
726
        return $paymentMapperReader;
727
    }
728
729
    /**
730
     * @return \SprykerEco\Zed\Payone\Business\Payment\DataMapper\DiscountMapperInterface
731
     */
732
    public function createDiscountMapper(): DiscountMapperInterface
733
    {
734
        return new DiscountMapper();
735
    }
736
737
    /**
738
     * @return \SprykerEco\Zed\Payone\Business\Payment\DataMapper\ExpenseMapperInterface
739
     */
740
    public function createExpenseMapper(): ExpenseMapperInterface
741
    {
742
        return new ExpenseMapper();
743
    }
744
745
    /**
746
     * @return \SprykerEco\Zed\Payone\Business\ConditionChecker\RefundCheckerInterface
747
     */
748
    public function createRefundChecker(): RefundCheckerInterface
749
    {
750
        return new RefundChecker($this->getRepository(), $this->createPaymentDataChecker());
751
    }
752
753
    /**
754
     * @return \SprykerEco\Zed\Payone\Business\ConditionChecker\PaymentDataCheckerInterface
755
     */
756
    public function createPaymentDataChecker(): PaymentDataCheckerInterface
757
    {
758
        return new PaymentDataChecker($this->getRepository(), $this->getConfig());
759
    }
760
761
    /**
762
     * @return \SprykerEco\Zed\Payone\Business\Payment\Hook\PostSaveHookInterface
763
     */
764
    public function createPostSaveHook(): PostSaveHookInterface
765
    {
766
        return new PostSaveHook(
767
            $this->getRepository(),
768
            $this->createPaymentMapperReader(),
769
            $this->createPayoneRequestProductDataMapper(),
770
            $this->createPayoneBaseAuthorizeSender()
771
        );
772
    }
773
774
    /**
775
     * @return \SprykerEco\Zed\Payone\Business\Api\Response\Mapper\RefundResponseMapperInterface
776
     */
777
    public function createRefundResponseMapper(): RefundResponseMapperInterface
778
    {
779
        return new RefundResponseMapper();
780
    }
781
782
    /**
783
     * @return \SprykerEco\Zed\Payone\Business\Api\Response\Mapper\AuthorizationResponseMapperInterface
784
     */
785
    public function createAuthorizationResponseMapper(): AuthorizationResponseMapperInterface
786
    {
787
        return new AuthorizationResponseMapper();
788
    }
789
790
    /**
791
     * @return \SprykerEco\Zed\Payone\Business\Api\Response\Mapper\CaptureResponseMapperInterface
792
     */
793
    public function createCaptureResponseMapper(): CaptureResponseMapperInterface
794
    {
795
        return new CaptureResponseMapper();
796
    }
797
798
    /**
799
     * @return \SprykerEco\Zed\Payone\Business\Api\Response\Mapper\CreditCardCheckResponseMapperInterface
800
     */
801
    public function createCreditCardCheckResponseMapper(): CreditCardCheckResponseMapperInterface
802
    {
803
        return new CreditCardCheckResponseMapper();
804
    }
805
806
    /**
807
     * @return \SprykerEco\Zed\Payone\Business\Api\Response\Mapper\DebitResponseMapperInterface
808
     */
809
    public function createDebitResponseMapper(): DebitResponseMapperInterface
810
    {
811
        return new DebitResponseMapper();
812
    }
813
814
    /**
815
     * @return array
816
     */
817
    public function getAvailablePaymentMethods(): array
818
    {
819
        $storeConfig = $this->getProvidedDependency(PayoneDependencyProvider::STORE_CONFIG);
820
821
        return [
822
            PayoneApiConstants::PAYMENT_METHOD_CREDITCARD_PSEUDO => $this->createCreditCardPseudo($storeConfig),
823
            PayoneApiConstants::PAYMENT_METHOD_INVOICE => $this->createInvoice($storeConfig),
824
            PayoneApiConstants::PAYMENT_METHOD_SECURITY_INVOICE => $this->createSecurityInvoice($storeConfig),
825
            PayoneApiConstants::PAYMENT_METHOD_ONLINE_BANK_TRANSFER => $this->createOnlineBankTransfer($storeConfig),
826
            PayoneApiConstants::PAYMENT_METHOD_E_WALLET => $this->createEWallet($storeConfig),
827
            PayoneApiConstants::PAYMENT_METHOD_PREPAYMENT => $this->createPrepayment($storeConfig),
828
            PayoneApiConstants::PAYMENT_METHOD_DIRECT_DEBIT => $this->createDirectDebit($storeConfig),
829
            PayoneApiConstants::PAYMENT_METHOD_PAYPAL_EXPRESS_CHECKOUT => $this->createGenericPayment($storeConfig),
830
            PayoneApiConstants::PAYMENT_METHOD_CASH_ON_DELIVERY => $this->createCashOnDelivery($storeConfig, $this->getGlossaryFacade()),
831
            PayoneApiConstants::PAYMENT_METHOD_KLARNA => $this->createKlarnaPaymentMapper($storeConfig),
832
        ];
833
    }
834
835
    /**
836
     * @return \Spryker\Shared\Kernel\Store
837
     */
838
    public function getStore(): Store
839
    {
840
        return $this->getProvidedDependency(PayoneDependencyProvider::STORE_CONFIG);
841
    }
842
843
    /**
844
     * @return \Generated\Shared\Transfer\PayoneStandardParameterTransfer
845
     */
846
    public function getStandardParameter(): PayoneStandardParameterTransfer
847
    {
848
        if ($this->standardParameter === null) {
849
            $this->standardParameter = $this->getConfig()->getRequestStandardParameter();
850
        }
851
852
        return $this->standardParameter;
853
    }
854
855
    /**
856
     * @return \SprykerEco\Zed\Payone\Dependency\Facade\PayoneToGlossaryFacadeInterface
857
     */
858
    public function getGlossaryFacade(): PayoneToGlossaryFacadeInterface
859
    {
860
        return $this->getProvidedDependency(PayoneDependencyProvider::FACADE_GLOSSARY);
861
    }
862
863
    /**
864
     * @return \Symfony\Component\HttpFoundation\RequestStack
865
     */
866
    public function getRequestStack(): RequestStack
867
    {
868
        return $this->getProvidedDependency(PayoneDependencyProvider::SERVICE_REQUEST_STACK);
869
    }
870
871
    /**
872
     *
873
     * @return \SprykerEco\Zed\Payone\Dependency\Plugin\StandardParameterMapperPluginInterface[]
874
     */
875
    public function getStandardParameterMapperPlugins(): array
876
    {
877
        return $this->getProvidedDependency(PayoneDependencyProvider::PLUGINS_STANDARD_PARAMETER_HYDRATOR);
0 ignored issues
show
Bug introduced by
The constant SprykerEco\Zed\Payone\Pa...DARD_PARAMETER_HYDRATOR was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
878
    }
879
}
880