Passed
Pull Request — master (#13)
by Dmitri
09:35 queued 04:15
created

PayolutionFacade::revertPartialPayment()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 9
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\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
     * @api
73
     *
74
     * @param \Generated\Shared\Transfer\PayolutionOmsOperationRequestTransfer $payolutionOmsOperationRequestTransfer
75
     *
76
     * @return \Generated\Shared\Transfer\PayolutionTransactionResponseTransfer
77
     */
78
    public function preAuthorizePartialPayment(PayolutionOmsOperationRequestTransfer $payolutionOmsOperationRequestTransfer): PayolutionTransactionResponseTransfer
79
    {
80
        return $this
81
            ->getFactory()
82
            ->createPaymentTransactionHandler()
83
            ->preAuthorizePayment(
84
                $payolutionOmsOperationRequestTransfer->getOrder(),
85
                $payolutionOmsOperationRequestTransfer->getIdPayment(),
86
                $payolutionOmsOperationRequestTransfer->getSelectedItems()
87
            );
88
    }
89
90
    /**
91
     * @api
92
     *
93
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
94
     * @param int $idPayment
95
     *
96
     * @return \Generated\Shared\Transfer\PayolutionTransactionResponseTransfer
97
     */
98
    public function reAuthorizePayment(OrderTransfer $orderTransfer, $idPayment)
99
    {
100
        return $this
101
            ->getFactory()
102
            ->createPaymentTransactionHandler()
103
            ->reAuthorizePayment($orderTransfer, $idPayment);
104
    }
105
106
    /**
107
     * @api
108
     *
109
     * @param \Generated\Shared\Transfer\PayolutionOmsOperationRequestTransfer $payolutionOmsOperationRequestTransfer
110
     *
111
     * @return \Generated\Shared\Transfer\PayolutionTransactionResponseTransfer
112
     */
113
    public function reAuthorizePartialPayment(PayolutionOmsOperationRequestTransfer $payolutionOmsOperationRequestTransfer): PayolutionTransactionResponseTransfer
114
    {
115
        return $this
116
            ->getFactory()
117
            ->createPaymentTransactionHandler()
118
            ->reAuthorizePayment(
119
                $payolutionOmsOperationRequestTransfer->getOrder(),
120
                $payolutionOmsOperationRequestTransfer->getIdPayment(),
121
                $payolutionOmsOperationRequestTransfer->getSelectedItems()
122
            );
123
    }
124
125
    /**
126
     * @api
127
     *
128
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
129
     * @param int $idPayment
130
     *
131
     * @return \Generated\Shared\Transfer\PayolutionTransactionResponseTransfer
132
     */
133
    public function revertPayment(OrderTransfer $orderTransfer, $idPayment)
134
    {
135
        return $this
136
            ->getFactory()
137
            ->createPaymentTransactionHandler()
138
            ->revertPayment($orderTransfer, $idPayment);
139
    }
140
141
    /**
142
     * @api
143
     *
144
     * @param \Generated\Shared\Transfer\PayolutionOmsOperationRequestTransfer $payolutionOmsOperationRequestTransfer
145
     *
146
     * @return \Generated\Shared\Transfer\PayolutionTransactionResponseTransfer
147
     */
148
    public function revertPartialPayment(PayolutionOmsOperationRequestTransfer $payolutionOmsOperationRequestTransfer): PayolutionTransactionResponseTransfer
149
    {
150
        return $this
151
            ->getFactory()
152
            ->createPaymentTransactionHandler()
153
            ->revertPayment(
154
                $payolutionOmsOperationRequestTransfer->getOrder(),
155
                $payolutionOmsOperationRequestTransfer->getIdPayment(),
156
                $payolutionOmsOperationRequestTransfer->getSelectedItems()
157
            );
158
    }
159
160
161
    /**
162
     * @api
163
     *
164
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
165
     * @param int $idPayment
166
     *
167
     * @return \Generated\Shared\Transfer\PayolutionTransactionResponseTransfer
168
     */
169
    public function capturePayment(OrderTransfer $orderTransfer, $idPayment)
170
    {
171
        return $this
172
            ->getFactory()
173
            ->createPaymentTransactionHandler()
174
            ->capturePayment($orderTransfer, $idPayment);
175
    }
176
177
    /**
178
     * @api
179
     *
180
     * @param \Generated\Shared\Transfer\PayolutionOmsOperationRequestTransfer $payolutionOmsOperationRequestTransfer
181
     *
182
     * @return \Generated\Shared\Transfer\PayolutionTransactionResponseTransfer
183
     */
184
    public function capturePartialPayment(PayolutionOmsOperationRequestTransfer $payolutionOmsOperationRequestTransfer): PayolutionTransactionResponseTransfer
185
    {
186
        return $this
187
            ->getFactory()
188
            ->createPaymentTransactionHandler()
189
            ->capturePayment(
190
                $payolutionOmsOperationRequestTransfer->getOrder(),
191
                $payolutionOmsOperationRequestTransfer->getIdPayment(),
192
                $payolutionOmsOperationRequestTransfer->getSelectedItems()
193
            );
194
    }
195
196
197
    /**
198
     * @api
199
     *
200
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
201
     * @param int $idPayment
202
     *
203
     * @return \Generated\Shared\Transfer\PayolutionTransactionResponseTransfer
204
     */
205
    public function refundPayment(OrderTransfer $orderTransfer, $idPayment)
206
    {
207
        return $this
208
            ->getFactory()
209
            ->createPaymentTransactionHandler()
210
            ->refundPayment($orderTransfer, $idPayment);
211
    }
212
213
    /**
214
     * @api
215
     *
216
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
217
     *
218
     * @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...
219
     */
220
    public function calculateInstallmentPayments(QuoteTransfer $quoteTransfer)
221
    {
222
        $payolutionResponseTransfer = $this
223
            ->getFactory()
224
            ->createPaymentCalculationHandler()
225
            ->calculateInstallmentPayments($quoteTransfer);
226
227
        return $payolutionResponseTransfer;
228
    }
229
230
    /**
231
     * @api
232
     *
233
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
234
     *
235
     * @return bool
236
     */
237
    public function isPreAuthorizationApproved(OrderTransfer $orderTransfer)
238
    {
239
        return $this
240
            ->getFactory()
241
            ->createTransactionStatusLog()
242
            ->isPreAuthorizationApproved($orderTransfer);
243
    }
244
245
    /**
246
     * @api
247
     *
248
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
249
     *
250
     * @return bool
251
     */
252
    public function isReAuthorizationApproved(OrderTransfer $orderTransfer)
253
    {
254
        return $this
255
            ->getFactory()
256
            ->createTransactionStatusLog()
257
            ->isReAuthorizationApproved($orderTransfer);
258
    }
259
260
    /**
261
     * @api
262
     *
263
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
264
     *
265
     * @return bool
266
     */
267
    public function isReversalApproved(OrderTransfer $orderTransfer)
268
    {
269
        return $this
270
            ->getFactory()
271
            ->createTransactionStatusLog()
272
            ->isReversalApproved($orderTransfer);
273
    }
274
275
    /**
276
     * @api
277
     *
278
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
279
     *
280
     * @return bool
281
     */
282
    public function isCaptureApproved(OrderTransfer $orderTransfer)
283
    {
284
        return $this
285
            ->getFactory()
286
            ->createTransactionStatusLog()
287
            ->isCaptureApproved($orderTransfer);
288
    }
289
290
    /**
291
     * @api
292
     *
293
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
294
     *
295
     * @return bool
296
     */
297
    public function isRefundApproved(OrderTransfer $orderTransfer)
298
    {
299
        return $this
300
            ->getFactory()
301
            ->createTransactionStatusLog()
302
            ->isRefundApproved($orderTransfer);
303
    }
304
}
305