PayolutionFacade::preAuthorizePartialPayment()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 9
rs 10
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\Payolution\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\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...
12
use Generated\Shared\Transfer\PayolutionOmsOperationRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...perationRequestTransfer 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\PayolutionTransactionResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...sactionResponseTransfer 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 Spryker\Zed\Kernel\Business\AbstractFacade;
16
17
/**
18
 * @method \SprykerEco\Zed\Payolution\Business\PayolutionBusinessFactory getFactory()
19
 */
20
class PayolutionFacade extends AbstractFacade implements PayolutionFacadeInterface
21
{
22
    /**
23
     * @api
24
     *
25
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
26
     * @param \Generated\Shared\Transfer\CheckoutResponseTransfer $checkoutResponseTransfer
27
     *
28
     * @return void
29
     */
30
    public function saveOrderPayment(QuoteTransfer $quoteTransfer, CheckoutResponseTransfer $checkoutResponseTransfer)
31
    {
32
        $this
33
             ->getFactory()
34
             ->createOrderSaver()
35
             ->saveOrderPayment($quoteTransfer, $checkoutResponseTransfer);
36
    }
37
38
    /**
39
     * @api
40
     *
41
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
42
     *
43
     * @return \Generated\Shared\Transfer\PayolutionTransactionResponseTransfer
44
     */
45
    public function preCheckPayment(QuoteTransfer $quoteTransfer)
46
    {
47
        $payolutionResponseTransfer = $this
48
            ->getFactory()
49
            ->createPaymentTransactionHandler()
50
            ->preCheckPayment($quoteTransfer);
51
52
        return $payolutionResponseTransfer;
53
    }
54
55
    /**
56
     * @api
57
     *
58
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
59
     * @param int $idPayment
60
     *
61
     * @return \Generated\Shared\Transfer\PayolutionTransactionResponseTransfer
62
     */
63
    public function preAuthorizePayment(OrderTransfer $orderTransfer, $idPayment)
64
    {
65
        return $this
66
            ->getFactory()
67
            ->createPaymentTransactionHandler()
68
            ->preAuthorizePayment($orderTransfer, $idPayment);
69
    }
70
71
    /**
72
     * {@inheritDoc}
73
     *
74
     * @api
75
     *
76
     * @param \Generated\Shared\Transfer\PayolutionOmsOperationRequestTransfer $payolutionOmsOperationRequestTransfer
77
     *
78
     * @return \Generated\Shared\Transfer\PayolutionTransactionResponseTransfer
79
     */
80
    public function preAuthorizePartialPayment(PayolutionOmsOperationRequestTransfer $payolutionOmsOperationRequestTransfer): PayolutionTransactionResponseTransfer
81
    {
82
        return $this
83
            ->getFactory()
84
            ->createPaymentTransactionHandler()
85
            ->preAuthorizePayment(
86
                $payolutionOmsOperationRequestTransfer->getOrder(),
87
                $payolutionOmsOperationRequestTransfer->getIdPayment(),
88
                $payolutionOmsOperationRequestTransfer->getSelectedItems()
89
            );
90
    }
91
92
    /**
93
     * @api
94
     *
95
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
96
     * @param int $idPayment
97
     *
98
     * @return \Generated\Shared\Transfer\PayolutionTransactionResponseTransfer
99
     */
100
    public function reAuthorizePayment(OrderTransfer $orderTransfer, $idPayment)
101
    {
102
        return $this
103
            ->getFactory()
104
            ->createPaymentTransactionHandler()
105
            ->reAuthorizePayment($orderTransfer, $idPayment);
106
    }
107
108
    /**
109
     * {@inheritDoc}
110
     *
111
     * @api
112
     *
113
     * @param \Generated\Shared\Transfer\PayolutionOmsOperationRequestTransfer $payolutionOmsOperationRequestTransfer
114
     *
115
     * @return \Generated\Shared\Transfer\PayolutionTransactionResponseTransfer
116
     */
117
    public function reAuthorizePartialPayment(PayolutionOmsOperationRequestTransfer $payolutionOmsOperationRequestTransfer): PayolutionTransactionResponseTransfer
118
    {
119
        return $this
120
            ->getFactory()
121
            ->createPaymentTransactionHandler()
122
            ->reAuthorizePayment(
123
                $payolutionOmsOperationRequestTransfer->getOrder(),
124
                $payolutionOmsOperationRequestTransfer->getIdPayment(),
125
                $payolutionOmsOperationRequestTransfer->getSelectedItems()
126
            );
127
    }
128
129
    /**
130
     * @api
131
     *
132
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
133
     * @param int $idPayment
134
     *
135
     * @return \Generated\Shared\Transfer\PayolutionTransactionResponseTransfer
136
     */
137
    public function revertPayment(OrderTransfer $orderTransfer, $idPayment)
138
    {
139
        return $this
140
            ->getFactory()
141
            ->createPaymentTransactionHandler()
142
            ->revertPayment($orderTransfer, $idPayment);
143
    }
144
145
    /**
146
     * {@inheritDoc}
147
     *
148
     * @api
149
     *
150
     * @param \Generated\Shared\Transfer\PayolutionOmsOperationRequestTransfer $payolutionOmsOperationRequestTransfer
151
     *
152
     * @return \Generated\Shared\Transfer\PayolutionTransactionResponseTransfer
153
     */
154
    public function revertPartialPayment(PayolutionOmsOperationRequestTransfer $payolutionOmsOperationRequestTransfer): PayolutionTransactionResponseTransfer
155
    {
156
        return $this
157
            ->getFactory()
158
            ->createPaymentTransactionHandler()
159
            ->revertPayment(
160
                $payolutionOmsOperationRequestTransfer->getOrder(),
161
                $payolutionOmsOperationRequestTransfer->getIdPayment(),
162
                $payolutionOmsOperationRequestTransfer->getSelectedItems()
163
            );
164
    }
165
166
167
    /**
168
     * @api
169
     *
170
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
171
     * @param int $idPayment
172
     *
173
     * @return \Generated\Shared\Transfer\PayolutionTransactionResponseTransfer
174
     */
175
    public function capturePayment(OrderTransfer $orderTransfer, $idPayment)
176
    {
177
        return $this
178
            ->getFactory()
179
            ->createPaymentTransactionHandler()
180
            ->capturePayment($orderTransfer, $idPayment);
181
    }
182
183
    /**
184
     * {@inheritDoc}
185
     *
186
     * @api
187
     *
188
     * @param \Generated\Shared\Transfer\PayolutionOmsOperationRequestTransfer $payolutionOmsOperationRequestTransfer
189
     *
190
     * @return \Generated\Shared\Transfer\PayolutionTransactionResponseTransfer
191
     */
192
    public function capturePartialPayment(PayolutionOmsOperationRequestTransfer $payolutionOmsOperationRequestTransfer): PayolutionTransactionResponseTransfer
193
    {
194
        return $this
195
            ->getFactory()
196
            ->createPaymentTransactionHandler()
197
            ->capturePayment(
198
                $payolutionOmsOperationRequestTransfer->getOrder(),
199
                $payolutionOmsOperationRequestTransfer->getIdPayment(),
200
                $payolutionOmsOperationRequestTransfer->getSelectedItems()
201
            );
202
    }
203
204
205
    /**
206
     * @api
207
     *
208
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
209
     * @param int $idPayment
210
     *
211
     * @return \Generated\Shared\Transfer\PayolutionTransactionResponseTransfer
212
     */
213
    public function refundPayment(OrderTransfer $orderTransfer, $idPayment)
214
    {
215
        return $this
216
            ->getFactory()
217
            ->createPaymentTransactionHandler()
218
            ->refundPayment($orderTransfer, $idPayment);
219
    }
220
221
    /**
222
     * @api
223
     *
224
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
225
     *
226
     * @return \Generated\Shared\Transfer\PayolutionCalculationResponseTransfer
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...ulationResponseTransfer 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...
227
     */
228
    public function calculateInstallmentPayments(QuoteTransfer $quoteTransfer)
229
    {
230
        $payolutionResponseTransfer = $this
231
            ->getFactory()
232
            ->createPaymentCalculationHandler()
233
            ->calculateInstallmentPayments($quoteTransfer);
234
235
        return $payolutionResponseTransfer;
236
    }
237
238
    /**
239
     * @api
240
     *
241
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
242
     *
243
     * @return bool
244
     */
245
    public function isPreAuthorizationApproved(OrderTransfer $orderTransfer)
246
    {
247
        return $this
248
            ->getFactory()
249
            ->createTransactionStatusLog()
250
            ->isPreAuthorizationApproved($orderTransfer);
251
    }
252
253
    /**
254
     * @api
255
     *
256
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
257
     *
258
     * @return bool
259
     */
260
    public function isReAuthorizationApproved(OrderTransfer $orderTransfer)
261
    {
262
        return $this
263
            ->getFactory()
264
            ->createTransactionStatusLog()
265
            ->isReAuthorizationApproved($orderTransfer);
266
    }
267
268
    /**
269
     * @api
270
     *
271
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
272
     *
273
     * @return bool
274
     */
275
    public function isReversalApproved(OrderTransfer $orderTransfer)
276
    {
277
        return $this
278
            ->getFactory()
279
            ->createTransactionStatusLog()
280
            ->isReversalApproved($orderTransfer);
281
    }
282
283
    /**
284
     * @api
285
     *
286
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
287
     *
288
     * @return bool
289
     */
290
    public function isCaptureApproved(OrderTransfer $orderTransfer)
291
    {
292
        return $this
293
            ->getFactory()
294
            ->createTransactionStatusLog()
295
            ->isCaptureApproved($orderTransfer);
296
    }
297
298
    /**
299
     * @api
300
     *
301
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
302
     *
303
     * @return bool
304
     */
305
    public function isRefundApproved(OrderTransfer $orderTransfer)
306
    {
307
        return $this
308
            ->getFactory()
309
            ->createTransactionStatusLog()
310
            ->isRefundApproved($orderTransfer);
311
    }
312
}
313