Passed
Pull Request — master (#4)
by Aleksey
11:47 queued 02:44
created

CrefoPayFacade::executeCaptureOmsCommand()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 5
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\CrefoPay\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\CrefoPayNotificationTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...PayNotificationTransfer 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\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...
13
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...
14
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...
15
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...
16
use Spryker\Zed\Kernel\Business\AbstractFacade;
17
18
/**
19
 * @method \SprykerEco\Zed\CrefoPay\Business\CrefoPayBusinessFactory getFactory()
20
 * @method \SprykerEco\Zed\CrefoPay\Persistence\CrefoPayEntityManagerInterface getEntityManager()
21
 * @method \SprykerEco\Zed\CrefoPay\Persistence\CrefoPayRepositoryInterface getRepository()
22
 */
23
class CrefoPayFacade extends AbstractFacade implements CrefoPayFacadeInterface
24
{
25
    /**
26
     * {@inheritdoc}
27
     *
28
     * @api
29
     *
30
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
31
     *
32
     * @return \Generated\Shared\Transfer\QuoteTransfer
33
     */
34
    public function startCrefoPayTransaction(QuoteTransfer $quoteTransfer): QuoteTransfer
35
    {
36
        return $this->getFactory()
37
            ->createQuoteExpander()
38
            ->expand($quoteTransfer);
39
    }
40
41
    /**
42
     * {@inheritdoc}
43
     *
44
     * @api
45
     *
46
     * @param \Generated\Shared\Transfer\PaymentMethodsTransfer $paymentMethodsTransfer
47
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
48
     *
49
     * @return \Generated\Shared\Transfer\PaymentMethodsTransfer
50
     */
51
    public function filterPaymentMethods(
52
        PaymentMethodsTransfer $paymentMethodsTransfer,
53
        QuoteTransfer $quoteTransfer
54
    ): PaymentMethodsTransfer {
55
        return $this->getFactory()
56
            ->createPaymentMethodFilter()
57
            ->filterPaymentMethods($paymentMethodsTransfer, $quoteTransfer);
58
    }
59
60
    /**
61
     * {@inheritdoc}
62
     *
63
     * @api
64
     *
65
     * @param \Generated\Shared\Transfer\CrefoPayNotificationTransfer $notificationTransfer
66
     *
67
     * @return \Generated\Shared\Transfer\CrefoPayNotificationTransfer
68
     */
69
    public function processNotification(CrefoPayNotificationTransfer $notificationTransfer): CrefoPayNotificationTransfer
70
    {
71
        return $this->getFactory()
72
            ->createCrefoPayNotificationProcessor()
73
            ->processNotification($notificationTransfer);
74
    }
75
76
    /**
77
     * {@inheritdoc}
78
     *
79
     * @api
80
     *
81
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
82
     * @param \Generated\Shared\Transfer\SaveOrderTransfer $saveOrderTransfer
83
     *
84
     * @return void
85
     */
86
    public function saveOrderPayment(QuoteTransfer $quoteTransfer, SaveOrderTransfer $saveOrderTransfer): void
87
    {
88
        $this->getFactory()
89
            ->createOrderPaymentSaver()
90
            ->saveOrderPayment($quoteTransfer, $saveOrderTransfer);
91
    }
92
93
    /**
94
     * {@inheritdoc}
95
     *
96
     * @api
97
     *
98
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
99
     * @param \Generated\Shared\Transfer\CheckoutResponseTransfer $checkoutResponse
100
     *
101
     * @return void
102
     */
103
    public function executePostSaveHook(QuoteTransfer $quoteTransfer, CheckoutResponseTransfer $checkoutResponse): void
104
    {
105
        $this->getFactory()
106
            ->createCheckoutPostSaveHook()
107
            ->execute($quoteTransfer, $checkoutResponse);
108
    }
109
110
    /**
111
     * {@inheritdoc}
112
     *
113
     * @api
114
     *
115
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
116
     * @param int[] $salesOrderItemIds
117
     *
118
     * @return void
119
     */
120
    public function executeCancelOmsCommand(OrderTransfer $orderTransfer, array $salesOrderItemIds): void
121
    {
122
        $this->getFactory()
123
            ->createCancelOmsCommand()
124
            ->execute($orderTransfer, $salesOrderItemIds);
125
    }
126
127
    /**
128
     * {@inheritdoc}
129
     *
130
     * @api
131
     *
132
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
133
     * @param int $idSalesOrderItem
134
     *
135
     * @return void
136
     */
137
    public function executeCaptureOmsCommand(OrderTransfer $orderTransfer, int $idSalesOrderItem): void
138
    {
139
        $this->getFactory()
140
            ->createCaptureOmsCommand()
141
            ->execute($orderTransfer, $idSalesOrderItem);
142
    }
143
144
    /**
145
     * {@inheritdoc}
146
     *
147
     * @api
148
     *
149
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
150
     * @param int $idSalesOrderItem
151
     *
152
     * @return void
153
     */
154
    public function executeRefundOmsCommand(OrderTransfer $orderTransfer, int $idSalesOrderItem): void
155
    {
156
        $this->getFactory()
157
            ->createRefundOmsCommand()
158
            ->execute($orderTransfer, $idSalesOrderItem);
159
    }
160
161
    /**
162
     * {@inheritdoc}
163
     *
164
     * @api
165
     *
166
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
167
     * @param int[] $salesOrderItemIds
168
     *
169
     * @return void
170
     */
171
    public function executeFinishOmsCommand(OrderTransfer $orderTransfer, array $salesOrderItemIds): void
172
    {
173
        $this->getFactory()
174
            ->createFinishOmsCommand()
175
            ->execute($orderTransfer, $salesOrderItemIds);
176
    }
177
178
    /**
179
     * {@inheritdoc}
180
     *
181
     * @api
182
     *
183
     * @param int $idSalesOrderItem
184
     *
185
     * @return bool
186
     */
187
    public function checkIsReserveCallSuccessfulOmsCondition(int $idSalesOrderItem): bool
188
    {
189
        return $this->getFactory()
190
            ->createIsReserveCallSuccessfulOmsCondition()
191
            ->check($idSalesOrderItem);
192
    }
193
194
    /**
195
     * {@inheritdoc}
196
     *
197
     * @api
198
     *
199
     * @param int $idSalesOrderItem
200
     *
201
     * @return bool
202
     */
203
    public function checkIsAcknowledgePendingReceivedOmsCondition(int $idSalesOrderItem): bool
204
    {
205
        return $this->getFactory()
206
            ->createIsAcknowledgePendingReceivedOmsCondition()
207
            ->check($idSalesOrderItem);
208
    }
209
210
    /**
211
     * {@inheritdoc}
212
     *
213
     * @api
214
     *
215
     * @param int $idSalesOrderItem
216
     *
217
     * @return bool
218
     */
219
    public function checkIsMerchantPendingReceivedOmsCondition(int $idSalesOrderItem): bool
220
    {
221
        return $this->getFactory()
222
            ->createIsMerchantPendingReceivedOmsCondition()
223
            ->check($idSalesOrderItem);
224
    }
225
226
    /**
227
     * {@inheritdoc}
228
     *
229
     * @api
230
     *
231
     * @param int $idSalesOrderItem
232
     *
233
     * @return bool
234
     */
235
    public function checkIsCiaPendingReceivedOmsCondition(int $idSalesOrderItem): bool
236
    {
237
        return $this->getFactory()
238
            ->createIsCiaPendingReceivedOmsCondition()
239
            ->check($idSalesOrderItem);
240
    }
241
242
    /**
243
     * {@inheritdoc}
244
     *
245
     * @api
246
     *
247
     * @param int $idSalesOrderItem
248
     *
249
     * @return bool
250
     */
251
    public function checkIsCancelCallSuccessfulOmsCondition(int $idSalesOrderItem): bool
252
    {
253
        return $this->getFactory()
254
            ->createIsCancelCallSuccessfulOmsCondition()
255
            ->check($idSalesOrderItem);
256
    }
257
258
    /**
259
     * {@inheritdoc}
260
     *
261
     * @api
262
     *
263
     * @param int $idSalesOrderItem
264
     *
265
     * @return bool
266
     */
267
    public function checkIsCanceledReceivedOmsCondition(int $idSalesOrderItem): bool
268
    {
269
        return $this->getFactory()
270
            ->createIsCanceledReceivedOmsCondition()
271
            ->check($idSalesOrderItem);
272
    }
273
274
    /**
275
     * {@inheritdoc}
276
     *
277
     * @api
278
     *
279
     * @param int $idSalesOrderItem
280
     *
281
     * @return bool
282
     */
283
    public function checkIsExpiredReceivedOmsCondition(int $idSalesOrderItem): bool
284
    {
285
        return $this->getFactory()
286
            ->createIsExpiredReceivedOmsCondition()
287
            ->check($idSalesOrderItem);
288
    }
289
290
    /**
291
     * {@inheritdoc}
292
     *
293
     * @api
294
     *
295
     * @param int $idSalesOrderItem
296
     *
297
     * @return bool
298
     */
299
    public function checkIsCaptureCallSuccessfulOmsCondition(int $idSalesOrderItem): bool
300
    {
301
        return $this->getFactory()
302
            ->createIsCaptureCallSuccessfulOmsCondition()
303
            ->check($idSalesOrderItem);
304
    }
305
306
    /**
307
     * {@inheritdoc}
308
     *
309
     * @api
310
     *
311
     * @param int $idSalesOrderItem
312
     *
313
     * @return bool
314
     */
315
    public function checkIsPaidReceivedOmsCondition(int $idSalesOrderItem): bool
316
    {
317
        return $this->getFactory()
318
            ->createIsPaidReceivedOmsCondition()
319
            ->check($idSalesOrderItem);
320
    }
321
322
    /**
323
     * {@inheritdoc}
324
     *
325
     * @api
326
     *
327
     * @param int $idSalesOrderItem
328
     *
329
     * @return bool
330
     */
331
    public function checkIsFinishCallSuccessfulOmsCondition(int $idSalesOrderItem): bool
332
    {
333
        return $this->getFactory()
334
            ->createIsFinishCallSuccessfulOmsCondition()
335
            ->check($idSalesOrderItem);
336
    }
337
338
    /**
339
     * {@inheritdoc}
340
     *
341
     * @api
342
     *
343
     * @param int $idSalesOrderItem
344
     *
345
     * @return bool
346
     */
347
    public function checkIsRefundCallSuccessfulOmsCondition(int $idSalesOrderItem): bool
348
    {
349
        return $this->getFactory()
350
            ->createIsRefundCallSuccessfulOmsCondition()
351
            ->check($idSalesOrderItem);
352
    }
353
354
    /**
355
     * {@inheritdoc}
356
     *
357
     * @api
358
     *
359
     * @param int $idSalesOrderItem
360
     *
361
     * @return bool
362
     */
363
    public function checkIsChargeBackReceivedOmsCondition(int $idSalesOrderItem): bool
364
    {
365
        return $this->getFactory()
366
            ->createIsChargeBackReceivedOmsCondition()
367
            ->check($idSalesOrderItem);
368
    }
369
370
    /**
371
     * {@inheritdoc}
372
     *
373
     * @api
374
     *
375
     * @param int $idSalesOrderItem
376
     *
377
     * @return bool
378
     */
379
    public function checkIsDoneReceivedOmsCondition(int $idSalesOrderItem): bool
380
    {
381
        return $this->getFactory()
382
            ->createIsDoneReceivedOmsCondition()
383
            ->check($idSalesOrderItem);
384
    }
385
}
386