RatepayFacade::installmentConfiguration()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 6
rs 10
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\Ratepay\Business;
9
10
use Generated\Shared\Transfer\CartChangeTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\CartChangeTransfer 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\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...
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\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...
14
use Generated\Shared\Transfer\RatepayPaymentInitTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...epayPaymentInitTransfer 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\RatepayPaymentRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...yPaymentRequestTransfer 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\RatepayResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\RatepayResponseTransfer 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\Ratepay\Business\RatepayBusinessFactory getFactory()
21
 */
22
class RatepayFacade extends AbstractFacade implements RatepayFacadeInterface
23
{
24
    /**
25
     * {@inheritdoc}
26
     *
27
     * @api
28
     *
29
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
30
     * @param \Generated\Shared\Transfer\CheckoutResponseTransfer $checkoutResponseTransfer
31
     *
32
     * @return void
33
     */
34
    public function saveOrderPayment(QuoteTransfer $quoteTransfer, CheckoutResponseTransfer $checkoutResponseTransfer)
35
    {
36
        $this->getFactory()
37
             ->createOrderSaver($quoteTransfer, $checkoutResponseTransfer)
38
             ->saveOrderPayment();
39
    }
40
41
    /**
42
     * {@inheritdoc}
43
     *
44
     * @api
45
     *
46
     * @param \Generated\Shared\Transfer\RatepayPaymentInitTransfer $ratepayPaymentInitTransfer
47
     *
48
     * @return \Generated\Shared\Transfer\RatepayResponseTransfer
49
     */
50
    public function initPayment(RatepayPaymentInitTransfer $ratepayPaymentInitTransfer)
51
    {
52
        return $this->getFactory()
53
            ->createInitPaymentTransactionHandler()
54
            ->request($ratepayPaymentInitTransfer);
55
    }
56
57
    /**
58
     * @api
59
     *
60
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
61
     * @param \Generated\Shared\Transfer\CheckoutResponseTransfer $checkoutResponse
62
     *
63
     * @return \Generated\Shared\Transfer\CheckoutResponseTransfer
64
     */
65
    public function postSaveHook(QuoteTransfer $quoteTransfer, CheckoutResponseTransfer $checkoutResponse)
66
    {
67
        return $this->getFactory()
68
            ->createPostSaveHook()
69
            ->postSaveHook($quoteTransfer, $checkoutResponse);
70
    }
71
72
    /**
73
     * {@inheritdoc}
74
     *
75
     * @api
76
     *
77
     * @param \Generated\Shared\Transfer\RatepayPaymentRequestTransfer $ratepayPaymentRequestTransfer
78
     *
79
     * @return \Generated\Shared\Transfer\RatepayResponseTransfer
80
     */
81
    public function requestPayment(RatepayPaymentRequestTransfer $ratepayPaymentRequestTransfer)
82
    {
83
        return $this->getFactory()
84
            ->createRequestPaymentTransactionHandler()
85
            ->request($ratepayPaymentRequestTransfer);
86
    }
87
88
    /**
89
     * {@inheritdoc}
90
     *
91
     * @api
92
     *
93
     * @param \Generated\Shared\Transfer\RatepayResponseTransfer $ratepayPaymentResponseTransfer
94
     * @param int $orderId
95
     *
96
     * @return void
97
     */
98
    public function updatePaymentMethodByPaymentResponse(RatepayResponseTransfer $ratepayPaymentResponseTransfer, $orderId)
99
    {
100
        $this->getFactory()
101
            ->createPaymentMethodSaver()
102
            ->updatePaymentMethodByPaymentResponse($ratepayPaymentResponseTransfer, $orderId);
103
    }
104
105
    /**
106
     * {@inheritdoc}
107
     *
108
     * @api
109
     *
110
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
111
     *
112
     * @return \Generated\Shared\Transfer\RatepayResponseTransfer
113
     */
114
    public function confirmPayment(OrderTransfer $orderTransfer)
115
    {
116
        return $this
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getFactory...request($orderTransfer) returns the type Spryker\Shared\Kernel\Transfer\AbstractTransfer which is incompatible with the documented return type Generated\Shared\Transfer\RatepayResponseTransfer.
Loading history...
117
            ->getFactory()
118
            ->createConfirmPaymentTransactionHandler()
119
            ->request($orderTransfer);
120
    }
121
122
    /**
123
     * {@inheritdoc}
124
     *
125
     * @api
126
     *
127
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
128
     * @param \Generated\Shared\Transfer\OrderTransfer $partialOrderTransfer
129
     * @param \Generated\Shared\Transfer\ItemTransfer[] $orderItems
130
     *
131
     * @return \Generated\Shared\Transfer\RatepayResponseTransfer
132
     */
133
    public function confirmDelivery(
134
        OrderTransfer $orderTransfer,
135
        OrderTransfer $partialOrderTransfer,
136
        array $orderItems
137
    ) {
138
        return $this
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getFactory...rTransfer, $orderItems) returns the type Spryker\Shared\Kernel\Transfer\AbstractTransfer which is incompatible with the documented return type Generated\Shared\Transfer\RatepayResponseTransfer.
Loading history...
139
            ->getFactory()
140
            ->createConfirmDeliveryTransactionHandler()
141
            ->request($orderTransfer, $partialOrderTransfer, $orderItems);
142
    }
143
144
    /**
145
     * {@inheritdoc}
146
     *
147
     * @api
148
     *
149
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
150
     * @param \Generated\Shared\Transfer\OrderTransfer $partialOrderTransfer
151
     * @param \Generated\Shared\Transfer\ItemTransfer[] $orderItems
152
     *
153
     * @return \Generated\Shared\Transfer\RatepayResponseTransfer
154
     */
155
    public function cancelPayment(
156
        OrderTransfer $orderTransfer,
157
        OrderTransfer $partialOrderTransfer,
158
        array $orderItems
159
    ) {
160
        return $this
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getFactory...rTransfer, $orderItems) returns the type Spryker\Shared\Kernel\Transfer\AbstractTransfer which is incompatible with the documented return type Generated\Shared\Transfer\RatepayResponseTransfer.
Loading history...
161
            ->getFactory()
162
            ->createCancelPaymentTransactionHandler()
163
            ->request($orderTransfer, $partialOrderTransfer, $orderItems);
164
    }
165
166
    /**
167
     * {@inheritdoc}
168
     *
169
     * @api
170
     *
171
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
172
     * @param \Generated\Shared\Transfer\OrderTransfer $partialOrderTransfer
173
     * @param \Generated\Shared\Transfer\ItemTransfer[] $orderItems
174
     *
175
     * @return \Generated\Shared\Transfer\RatepayResponseTransfer
176
     */
177
    public function refundPayment(
178
        OrderTransfer $orderTransfer,
179
        OrderTransfer $partialOrderTransfer,
180
        array $orderItems
181
    ) {
182
        return $this
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getFactory...rTransfer, $orderItems) returns the type Spryker\Shared\Kernel\Transfer\AbstractTransfer which is incompatible with the documented return type Generated\Shared\Transfer\RatepayResponseTransfer.
Loading history...
183
            ->getFactory()
184
            ->createRefundPaymentTransactionHandler()
185
            ->request($orderTransfer, $partialOrderTransfer, $orderItems);
186
    }
187
188
    /**
189
     * {@inheritdoc}
190
     *
191
     * @api
192
     *
193
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
194
     *
195
     * @return \Generated\Shared\Transfer\RatepayInstallmentConfigurationResponseTransfer
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...urationResponseTransfer 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...
196
     */
197
    public function installmentConfiguration(QuoteTransfer $quoteTransfer)
198
    {
199
        return $this
200
            ->getFactory()
201
            ->createInstallmentConfigurationTransactionHandler()
202
            ->request($quoteTransfer);
203
    }
204
205
    /**
206
     * {@inheritdoc}
207
     *
208
     * @api
209
     *
210
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
211
     *
212
     * @return \Generated\Shared\Transfer\RatepayInstallmentCalculationResponseTransfer
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...
213
     */
214
    public function installmentCalculation(QuoteTransfer $quoteTransfer)
215
    {
216
        return $this
217
            ->getFactory()
218
            ->createInstallmentCalculationTransactionHandler()
219
            ->request($quoteTransfer);
220
    }
221
222
    /**
223
     * {@inheritdoc}
224
     *
225
     * @api
226
     *
227
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
228
     *
229
     * @return bool
230
     */
231
    public function isPaymentRequestSuccess(OrderTransfer $orderTransfer)
232
    {
233
        return $this
234
            ->getFactory()
235
            ->createStatusTransaction()
236
            ->isPaymentRequestSuccess($orderTransfer);
237
    }
238
239
    /**
240
     * {@inheritdoc}
241
     *
242
     * @api
243
     *
244
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
245
     *
246
     * @return bool
247
     */
248
    public function isPaymentConfirmed(OrderTransfer $orderTransfer)
249
    {
250
        return $this
251
            ->getFactory()
252
            ->createStatusTransaction()
253
            ->isPaymentConfirmed($orderTransfer);
254
    }
255
256
    /**
257
     * {@inheritdoc}
258
     *
259
     * @api
260
     *
261
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
262
     *
263
     * @return bool
264
     */
265
    public function isDeliveryConfirmed(OrderTransfer $orderTransfer)
266
    {
267
        return $this
268
            ->getFactory()
269
            ->createStatusTransaction()
270
            ->isDeliveryConfirmed($orderTransfer);
271
    }
272
273
    /**
274
     * {@inheritdoc}
275
     *
276
     * @api
277
     *
278
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
279
     *
280
     * @return bool
281
     */
282
    public function isRefundApproved(OrderTransfer $orderTransfer)
283
    {
284
        return $this
285
            ->getFactory()
286
            ->createStatusTransaction()
287
            ->isRefundApproved($orderTransfer);
288
    }
289
290
    /**
291
     * {@inheritdoc}
292
     *
293
     * @api
294
     *
295
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
296
     *
297
     * @return bool
298
     */
299
    public function isCancellationConfirmed(OrderTransfer $orderTransfer)
300
    {
301
        return $this
302
            ->getFactory()
303
            ->createStatusTransaction()
304
            ->isCancellationConfirmed($orderTransfer);
305
    }
306
307
    /**
308
     * {@inheritdoc}
309
     *
310
     * @api
311
     *
312
     * @param \Generated\Shared\Transfer\CartChangeTransfer $change
313
     *
314
     * @return \Generated\Shared\Transfer\CartChangeTransfer
315
     */
316
    public function expandItems(CartChangeTransfer $change)
317
    {
318
        return $this->getFactory()
319
            ->createProductExpander()
320
            ->expandItems($change);
321
    }
322
323
    /**
324
     * {@inheritdoc}
325
     *
326
     * @api
327
     *
328
     * @return void
329
     */
330
    public function install()
331
    {
332
        $this->getFactory()
333
            ->createInstaller()
334
            ->install();
335
    }
336
337
    /**
338
     * {@inheritdoc}
339
     *
340
     * @api
341
     *
342
     * @return \Generated\Shared\Transfer\RatepayResponseTransfer
343
     */
344
    public function requestProfile()
345
    {
346
        return $this
347
            ->getFactory()
348
            ->createRequestProfileTransactionHandler()
349
            ->request();
350
    }
351
}
352