executeCancelReservationOmsCommand()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 1
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\FirstData\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\FirstDataApiRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...tDataApiRequestTransfer 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\FirstDataApiResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...DataApiResponseTransfer 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\FirstDataNotificationTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...ataNotificationTransfer 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\FirstDataOmsCommandRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...sCommandRequestTransfer 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\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...
16
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...
17
use Generated\Shared\Transfer\RestCheckoutRequestAttributesTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...questAttributesTransfer 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...
18
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...
19
use Spryker\Zed\Kernel\Business\AbstractFacade;
20
21
/**
22
 * @method \SprykerEco\Zed\FirstData\Business\FirstDataBusinessFactory getFactory()
23
 * @method \SprykerEco\Zed\FirstData\Persistence\FirstDataEntityManagerInterface getEntityManager()
24
 * @method \SprykerEco\Zed\FirstData\Persistence\FirstDataRepositoryInterface getRepository()
25
 */
26
class FirstDataFacade extends AbstractFacade implements FirstDataFacadeInterface
27
{
28
    /**
29
     * {@inheritDoc}
30
     *
31
     * @api
32
     *
33
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
34
     * @param \Generated\Shared\Transfer\SaveOrderTransfer $saveOrderTransfer
35
     *
36
     * @return void
37
     */
38
    public function savePaymentEntities(QuoteTransfer $quoteTransfer, SaveOrderTransfer $saveOrderTransfer): void
39
    {
40
        $this->getFactory()
41
            ->createFirstDataOrderPaymentSaver()
42
            ->savePaymentEntities($quoteTransfer, $saveOrderTransfer);
43
    }
44
45
    /**
46
     * {@inheritDoc}
47
     *
48
     * @api
49
     *
50
     * @param \Generated\Shared\Transfer\FirstDataApiRequestTransfer $firstDataApiRequestTransfer
51
     *
52
     * @return \Generated\Shared\Transfer\FirstDataApiResponseTransfer
53
     */
54
    public function executeReservationOmsCommand(FirstDataApiRequestTransfer $firstDataApiRequestTransfer): FirstDataApiResponseTransfer
55
    {
56
        return $this->getFactory()
57
            ->createFirstDataApiClient()
58
            ->performApiRequest($firstDataApiRequestTransfer);
59
    }
60
61
    /**
62
     * {@inheritDoc}
63
     *
64
     * @api
65
     *
66
     * @param \Generated\Shared\Transfer\FirstDataOmsCommandRequestTransfer $firstDataOmsCommandRequestTransfer
67
     *
68
     * @return void
69
     */
70
    public function executeCancelReservationOmsCommand(FirstDataOmsCommandRequestTransfer $firstDataOmsCommandRequestTransfer): void
71
    {
72
        $this->getFactory()
73
            ->createCancelCommandExecutor()
74
            ->executeOmsCommand($firstDataOmsCommandRequestTransfer);
75
    }
76
77
    /**
78
     * {@inheritDoc}
79
     *
80
     * @api
81
     *
82
     * @param \Generated\Shared\Transfer\FirstDataOmsCommandRequestTransfer $firstDataOmsCommandRequestTransfer
83
     *
84
     * @return void
85
     */
86
    public function executeCaptureOmsCommand(FirstDataOmsCommandRequestTransfer $firstDataOmsCommandRequestTransfer): void
87
    {
88
        $this->getFactory()
89
            ->createCaptureCommandExecutor()
90
            ->executeOmsCommand($firstDataOmsCommandRequestTransfer);
91
    }
92
93
    /**
94
     * {@inheritDoc}
95
     *
96
     * @api
97
     *
98
     * @param \Generated\Shared\Transfer\FirstDataApiRequestTransfer $firstDataApiRequestTransfer
99
     *
100
     * @return \Generated\Shared\Transfer\FirstDataApiResponseTransfer
101
     */
102
    public function executeCancelOmsCommand(FirstDataApiRequestTransfer $firstDataApiRequestTransfer): FirstDataApiResponseTransfer
103
    {
104
        return $this->getFactory()
105
            ->createFirstDataApiClient()
106
            ->performApiRequest($firstDataApiRequestTransfer);
107
    }
108
109
    /**
110
     * {@inheritDoc}
111
     *
112
     * @api
113
     *
114
     * @param \Generated\Shared\Transfer\FirstDataApiRequestTransfer $firstDataApiRequestTransfer
115
     *
116
     * @return \Generated\Shared\Transfer\FirstDataApiResponseTransfer
117
     */
118
    public function executeRefundOmsCommand(FirstDataApiRequestTransfer $firstDataApiRequestTransfer): FirstDataApiResponseTransfer
119
    {
120
        return $this->getFactory()
121
            ->createFirstDataApiClient()
122
            ->performApiRequest($firstDataApiRequestTransfer);
123
    }
124
125
    /**
126
     * {@inheritDoc}
127
     *
128
     * @api
129
     *
130
     * @param \Generated\Shared\Transfer\RestCheckoutRequestAttributesTransfer $restCheckoutRequestAttributesTransfer
131
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
132
     *
133
     * @return \Generated\Shared\Transfer\QuoteTransfer
134
     */
135
    public function mapFirstDataPaymentToQuote(
136
        RestCheckoutRequestAttributesTransfer $restCheckoutRequestAttributesTransfer,
137
        QuoteTransfer $quoteTransfer
138
    ): QuoteTransfer {
139
        return $this->getFactory()
140
            ->createFirstDataPaymentQuoteMapper()
141
            ->mapFirstDataPaymentToQuote($restCheckoutRequestAttributesTransfer, $quoteTransfer);
142
    }
143
144
    /**
145
     * {@inheritDoc}
146
     *
147
     * @api
148
     *
149
     * @param \Generated\Shared\Transfer\FirstDataNotificationTransfer $firstDataNotificationTransfer
150
     *
151
     * @return \Generated\Shared\Transfer\FirstDataNotificationTransfer
152
     */
153
    public function processNotification(FirstDataNotificationTransfer $firstDataNotificationTransfer): FirstDataNotificationTransfer
154
    {
155
        return $this->getFactory()
156
            ->createNotificationProcessor()
157
            ->processNotification($firstDataNotificationTransfer);
158
    }
159
160
    /**
161
     * {@inheritDoc}
162
     *
163
     * @api
164
     *
165
     * @param string $transactionId
166
     *
167
     * @return bool
168
     */
169
    public function checkIfApprovedNotificationReceived(string $transactionId): bool
170
    {
171
        return $this->getFactory()
172
            ->createFirstDataNotificationChecker()
173
            ->checkIfApprovedNotificationReceived($transactionId);
174
    }
175
176
    /**
177
     * {@inheritDoc}
178
     *
179
     * @api
180
     *
181
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
182
     *
183
     * @return bool
184
     */
185
    public function checkPaymentAuthorizationTimeOut(OrderTransfer $orderTransfer): bool
186
    {
187
        return $this->getFactory()
188
            ->createPaymentAuthorizationTimeOutChecker()
189
            ->check($orderTransfer);
190
    }
191
192
    /**
193
     * {@inheritDoc}
194
     *
195
     * @api
196
     *
197
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
198
     * @param \Generated\Shared\Transfer\CheckoutResponseTransfer $checkoutResponseTransfer
199
     *
200
     * @return bool
201
     */
202
    public function checkFirstDataResponse(QuoteTransfer $quoteTransfer, CheckoutResponseTransfer $checkoutResponseTransfer): bool
203
    {
204
        return $this->getFactory()
205
            ->createFirstDataResponseValidator()
206
            ->validateFirstDataResponse($quoteTransfer, $checkoutResponseTransfer);
207
    }
208
209
    /**
210
     * {@inheritDoc}
211
     *
212
     * @api
213
     *
214
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
215
     *
216
     * @return \Generated\Shared\Transfer\OrderTransfer
217
     */
218
    public function loadPaymentDataByOrder(OrderTransfer $orderTransfer): OrderTransfer
219
    {
220
        return $this->getFactory()
221
            ->createOrderExpander()
222
            ->loadPaymentDataByOrder($orderTransfer);
223
    }
224
}
225