Passed
Push — feature/eco-3656/eco-3658-enab... ( da021b...202423 )
by
unknown
04:29
created

ComputopFacade::isComputopPaymentExist()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
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\Computop\Business;
9
10
use Generated\Shared\Transfer\CheckoutResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\CheckoutResponseTransfer 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\ComputopApiResponseHeaderTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...iResponseHeaderTransfer 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 Generated\Shared\Transfer\ComputopNotificationTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...topNotificationTransfer 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...
13
use Generated\Shared\Transfer\OrderTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\OrderTransfer 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...
14
use Generated\Shared\Transfer\PaymentMethodsTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\PaymentMethodsTransfer 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...
15
use Generated\Shared\Transfer\QuoteTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\QuoteTransfer 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...
16
use Generated\Shared\Transfer\SaveOrderTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\SaveOrderTransfer 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...
17
use Spryker\Zed\Kernel\Business\AbstractFacade;
18
19
/**
20
 * @method \SprykerEco\Zed\Computop\Business\ComputopBusinessFactory getFactory()
21
 * @method \SprykerEco\Zed\Computop\Persistence\ComputopEntityManagerInterface getEntityManager()
22
 */
23
class ComputopFacade extends AbstractFacade implements ComputopFacadeInterface
24
{
25
    /**
26
     * {@inheritDoc}
27
     *
28
     * @api
29
     *
30
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
31
     * @param \Generated\Shared\Transfer\SaveOrderTransfer $saveOrderTransfer
32
     *
33
     * @return void
34
     */
35
    public function saveOrderPayment(QuoteTransfer $quoteTransfer, SaveOrderTransfer $saveOrderTransfer)
36
    {
37
        $this->getFactory()
38
            ->createOrderSaver()
39
            ->saveOrderPayment($quoteTransfer, $saveOrderTransfer);
40
    }
41
42
    /**
43
     * {@inheritDoc}
44
     *
45
     * @api
46
     *
47
     * @param \Generated\Shared\Transfer\ComputopApiResponseHeaderTransfer $header
48
     * @param string $method
49
     *
50
     * @return \Generated\Shared\Transfer\ComputopApiResponseHeaderTransfer
51
     */
52
    public function logResponseHeader(ComputopApiResponseHeaderTransfer $header, $method)
53
    {
54
        $this->getFactory()
55
            ->createComputopResponseLogger()
56
            ->log($header, $method);
57
58
        return $header;
59
    }
60
61
    /**
62
     * {@inheritDoc}
63
     *
64
     * @api
65
     *
66
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
67
     * @param \Generated\Shared\Transfer\CheckoutResponseTransfer $checkoutResponseTransfer
68
     *
69
     * @return \Generated\Shared\Transfer\CheckoutResponseTransfer
70
     */
71
    public function postSaveHookExecute(QuoteTransfer $quoteTransfer, CheckoutResponseTransfer $checkoutResponseTransfer)
72
    {
73
        return $this->getFactory()
74
            ->createPostSaveHook()
75
            ->execute($quoteTransfer, $checkoutResponseTransfer);
76
    }
77
78
    /**
79
     * {@inheritDoc}
80
     *
81
     * @api
82
     *
83
     * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem[] $orderItems
84
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
85
     *
86
     * @return \Spryker\Shared\Kernel\Transfer\TransferInterface
87
     */
88
    public function authorizeCommandHandle(array $orderItems, OrderTransfer $orderTransfer)
89
    {
90
        return $this->getFactory()
91
            ->createAuthorizeCommandHandler()
92
            ->handle($orderItems, $orderTransfer);
93
    }
94
95
    /**
96
     * {@inheritDoc}
97
     *
98
     * @api
99
     *
100
     * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem[] $orderItems
101
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
102
     *
103
     * @return array|\Spryker\Shared\Kernel\Transfer\TransferInterface
104
     */
105
    public function cancelCommandHandle(array $orderItems, OrderTransfer $orderTransfer)
106
    {
107
        return $this->getFactory()
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getFactory...rItems, $orderTransfer) returns the type Spryker\Shared\Kernel\Transfer\TransferInterface which is incompatible with the return type mandated by SprykerEco\Zed\Computop\...::cancelCommandHandle() of array.

In the issue above, the returned value is violating the contract defined by the mentioned interface.

Let's take a look at an example:

interface HasName {
    /** @return string */
    public function getName();
}

class Name {
    public $name;
}

class User implements HasName {
    /** @return string|Name */
    public function getName() {
        return new Name('foo'); // This is a violation of the ``HasName`` interface
                                // which only allows a string value to be returned.
    }
}
Loading history...
108
            ->createCancelCommandHandler()
109
            ->handle($orderItems, $orderTransfer);
110
    }
111
112
    /**
113
     * {@inheritDoc}
114
     *
115
     * @api
116
     *
117
     * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem[] $orderItems
118
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
119
     *
120
     * @return \Spryker\Shared\Kernel\Transfer\TransferInterface
121
     */
122
    public function captureCommandHandle(array $orderItems, OrderTransfer $orderTransfer)
123
    {
124
        return $this->getFactory()
125
            ->createCaptureCommandHandler()
126
            ->handle($orderItems, $orderTransfer);
127
    }
128
129
    /**
130
     * {@inheritDoc}
131
     *
132
     * @api
133
     *
134
     * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem[] $orderItems
135
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
136
     *
137
     * @return \Spryker\Shared\Kernel\Transfer\TransferInterface
138
     */
139
    public function refundCommandHandle(array $orderItems, OrderTransfer $orderTransfer)
140
    {
141
        return $this->getFactory()
142
            ->createRefundCommandHandler()
143
            ->handle($orderItems, $orderTransfer);
144
    }
145
146
    /**
147
     * {@inheritDoc}
148
     *
149
     * @api
150
     *
151
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
152
     *
153
     * @return \Generated\Shared\Transfer\QuoteTransfer
154
     */
155
    public function saveSofortInitResponse(QuoteTransfer $quoteTransfer)
156
    {
157
        return $this->getFactory()
158
            ->createSofortResponseSaver()
159
            ->save($quoteTransfer);
160
    }
161
162
    /**
163
     * {@inheritDoc}
164
     *
165
     * @api
166
     *
167
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
168
     *
169
     * @return \Generated\Shared\Transfer\QuoteTransfer
170
     */
171
    public function saveIdealInitResponse(QuoteTransfer $quoteTransfer)
172
    {
173
        return $this->getFactory()
174
            ->createIdealResponseSaver()
175
            ->save($quoteTransfer);
176
    }
177
178
    /**
179
     * {@inheritDoc}
180
     *
181
     * @api
182
     *
183
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
184
     *
185
     * @return \Generated\Shared\Transfer\QuoteTransfer
186
     */
187
    public function saveCreditCardInitResponse(QuoteTransfer $quoteTransfer)
188
    {
189
        return $this->getFactory()
190
            ->createCreditCardResponseSaver()
191
            ->save($quoteTransfer);
192
    }
193
194
    /**
195
     * {@inheritDoc}
196
     *
197
     * @api
198
     *
199
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
200
     *
201
     * @return \Generated\Shared\Transfer\QuoteTransfer
202
     */
203
    public function savePayNowInitResponse(QuoteTransfer $quoteTransfer)
204
    {
205
        return $this->getFactory()
206
            ->createPayNowResponseSaver()
207
            ->save($quoteTransfer);
208
    }
209
210
    /**
211
     * {@inheritDoc}
212
     *
213
     * @api
214
     *
215
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
216
     *
217
     * @return \Generated\Shared\Transfer\QuoteTransfer
218
     */
219
    public function savePayPalInitResponse(QuoteTransfer $quoteTransfer)
220
    {
221
        return $this->getFactory()
222
            ->createPayPalResponseSaver()
223
            ->save($quoteTransfer);
224
    }
225
226
    /**
227
     * {@inheritDoc}
228
     *
229
     * @api
230
     *
231
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
232
     *
233
     * @return \Generated\Shared\Transfer\QuoteTransfer
234
     */
235
    public function savePayPalExpressInitResponse(QuoteTransfer $quoteTransfer): QuoteTransfer
236
    {
237
        return $this->getFactory()
238
            ->createPayPalExpressResponseSaver()
239
            ->save($quoteTransfer);
240
    }
241
242
    /**
243
     * {@inheritDoc}
244
     *
245
     * @api
246
     *
247
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
248
     *
249
     * @return \Generated\Shared\Transfer\QuoteTransfer
250
     */
251
    public function savePayPalExpressCompleteResponse(QuoteTransfer $quoteTransfer): QuoteTransfer
252
    {
253
        return $this->getFactory()
254
            ->createPayPalExpressCompleteResponseSaver()
255
            ->save($quoteTransfer);
256
    }
257
258
    /**
259
     * {@inheritDoc}
260
     *
261
     * @api
262
     *
263
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
264
     *
265
     * @return \Generated\Shared\Transfer\QuoteTransfer
266
     */
267
    public function saveDirectDebitInitResponse(QuoteTransfer $quoteTransfer)
268
    {
269
        return $this->getFactory()
270
            ->createDirectDebitResponseSaver()
271
            ->save($quoteTransfer);
272
    }
273
274
    /**
275
     * {@inheritDoc}
276
     *
277
     * @api
278
     *
279
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
280
     *
281
     * @return \Generated\Shared\Transfer\QuoteTransfer
282
     */
283
    public function saveEasyCreditInitResponse(QuoteTransfer $quoteTransfer)
284
    {
285
        return $this->getFactory()
286
            ->createEasyCreditResponseSaver()
287
            ->save($quoteTransfer);
288
    }
289
290
    /**
291
     * {@inheritDoc}
292
     *
293
     * @api
294
     *
295
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
296
     *
297
     * @return \Generated\Shared\Transfer\QuoteTransfer
298
     */
299
    public function savePaydirektInitResponse(QuoteTransfer $quoteTransfer)
300
    {
301
        return $this->getFactory()
302
            ->createPaydirektResponseSaver()
303
            ->save($quoteTransfer);
304
    }
305
306
    /**
307
     * {@inheritDoc}
308
     *
309
     * @api
310
     *
311
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
312
     *
313
     * @return \Generated\Shared\Transfer\QuoteTransfer
314
     */
315
    public function easyCreditStatusApiCall(QuoteTransfer $quoteTransfer)
316
    {
317
        return $this->getFactory()
318
            ->createEasyCreditStatusHandler()
319
            ->handle($quoteTransfer);
320
    }
321
322
    /**
323
     * {@inheritDoc}
324
     *
325
     * @api
326
     *
327
     * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem[] $orderItems
328
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
329
     *
330
     * @return \Spryker\Shared\Kernel\Transfer\TransferInterface
331
     */
332
    public function easyCreditAuthorizeCommandHandle(array $orderItems, OrderTransfer $orderTransfer)
333
    {
334
        return $this->getFactory()
335
            ->createEasyCreditAuthorizeCommandHandler()
336
            ->handle($orderItems, $orderTransfer);
337
    }
338
339
    /**
340
     * {@inheritDoc}
341
     *
342
     * @api
343
     *
344
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
345
     *
346
     * @return \Generated\Shared\Transfer\QuoteTransfer
347
     */
348
    public function isComputopPaymentExist(QuoteTransfer $quoteTransfer)
349
    {
350
        return $this->getFactory()
351
            ->createPaymentReader()
352
            ->isComputopPaymentExist($quoteTransfer);
353
    }
354
355
    /**
356
     * {@inheritDoc}
357
     *
358
     * @api
359
     *
360
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
361
     *
362
     * @return \Generated\Shared\Transfer\QuoteTransfer
363
     */
364
    public function performCrifApiCall(QuoteTransfer $quoteTransfer)
365
    {
366
        return $this->getFactory()
367
            ->createCrifHandler()
368
            ->handle($quoteTransfer);
369
    }
370
371
    /**
372
     * {@inheritDoc}
373
     *
374
     * @api
375
     *
376
     * @param \Generated\Shared\Transfer\PaymentMethodsTransfer $paymentMethodsTransfer
377
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
378
     *
379
     * @return \Generated\Shared\Transfer\PaymentMethodsTransfer
380
     */
381
    public function filterPaymentMethods(PaymentMethodsTransfer $paymentMethodsTransfer, QuoteTransfer $quoteTransfer)
382
    {
383
        return $this->getFactory()
384
            ->createPaymentMethodFilter()
385
            ->filterPaymentMethods($paymentMethodsTransfer, $quoteTransfer);
386
    }
387
388
    /**
389
     * {@inheritDoc}
390
     *
391
     * @api
392
     *
393
     * @param \Generated\Shared\Transfer\ComputopNotificationTransfer $computopNotificationTransfer
394
     *
395
     * @return \Generated\Shared\Transfer\ComputopNotificationTransfer
396
     */
397
    public function processNotification(
398
        ComputopNotificationTransfer $computopNotificationTransfer
399
    ): ComputopNotificationTransfer {
400
        return $this->getFactory()
401
            ->createNotificationProcessor()
402
            ->processNotification($computopNotificationTransfer);
403
    }
404
405
    /**
406
     * {@inheritDoc}
407
     *
408
     * @api
409
     *
410
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
411
     *
412
     * @return \Generated\Shared\Transfer\QuoteTransfer
413
     */
414
    public function expandQuoteWithDefaultShippingMethod(QuoteTransfer $quoteTransfer): QuoteTransfer
415
    {
416
        return $this->getFactory()
417
            ->createQuoteDefaultShippingMethodExpander()
418
            ->expandQuoteWithDefaultShippingMethod($quoteTransfer);
419
    }
420
}
421