PayoneFacade   B
last analyzed

Complexity

Total Complexity 50

Size/Duplication

Total Lines 754
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 50
eloc 90
c 1
b 0
f 0
dl 0
loc 754
rs 8.4

49 Methods

Rating   Name   Duplication   Size   Complexity  
A isPaymentPaid() 0 5 1
A sendConsumerScoreRequest() 0 5 1
A isPaymentAppointed() 0 5 1
A filterPaymentMethods() 0 5 1
A isAuthorizationError() 0 3 1
A sendKlarnaStartSessionRequest() 0 6 1
A creditCardCheck() 0 3 1
A debitPayment() 0 3 1
A postSaveHook() 0 5 1
A isPaymentUnderpaid() 0 5 1
A isPaymentOther() 0 5 1
A isPaymentOverpaid() 0 5 1
A isPaymentNotificationAvailable() 0 5 1
A getPaymentDetail() 0 3 1
A isRefundError() 0 3 1
A isAuthorizationApproved() 0 3 1
A isRefundPossible() 0 3 1
A findPayoneOrderItemStatus() 0 5 1
A getPaymentLogs() 0 5 1
A isCaptureApproved() 0 3 1
A getFile() 0 3 1
A executePartialRefund() 0 3 1
A isPaymentRefund() 0 5 1
A saveOrderPayment() 0 3 1
A authorizePayment() 0 3 1
A isCaptureError() 0 3 1
A getInvoice() 0 3 1
A orderPostSave() 0 5 1
A preAuthorizePayment() 0 3 1
A executeCheckoutPostSaveHook() 0 7 1
A bankAccountCheck() 0 3 1
A getPaypalExpressCheckoutDetails() 0 3 1
A manageMandate() 0 3 1
A sendAddressCheckRequest() 0 5 1
A isAuthorizationRedirect() 0 3 1
A getSecurityInvoice() 0 3 1
A saveOrder() 0 3 1
A isPreAuthorizationError() 0 3 1
A isPaymentDataRequired() 0 3 1
A isPreauthorizationRedirect() 0 3 1
A processTransactionStatusUpdate() 0 9 2
A executePartialCapture() 0 6 1
A isPaymentCapture() 0 5 1
A isRefundApproved() 0 3 1
A isPreauthorizationApproved() 0 3 1
A updatePaymentDetail() 0 3 1
A initPaypalExpressCheckout() 0 3 1
A capturePayment() 0 3 1
A refundPayment() 0 3 1

How to fix   Complexity   

Complex Class

Complex classes like PayoneFacade often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use PayoneFacade, and based on these observations, apply Extract Interface, too.

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\Payone\Business;
9
10
use Generated\Shared\Transfer\AddressCheckResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...ssCheckResponseTransfer 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\CaptureResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\CaptureResponseTransfer 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\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...
13
use Generated\Shared\Transfer\ConsumerScoreResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...erScoreResponseTransfer 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\OrderCollectionTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\OrderCollectionTransfer 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\PaymentDetailTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\PaymentDetailTransfer 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\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...
18
use Generated\Shared\Transfer\PayoneBankAccountCheckTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...ankAccountCheckTransfer 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 Generated\Shared\Transfer\PayoneCaptureTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\PayoneCaptureTransfer 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...
20
use Generated\Shared\Transfer\PayoneCreditCardTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\PayoneCreditCardTransfer 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...
21
use Generated\Shared\Transfer\PayoneGetFileTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\PayoneGetFileTransfer 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...
22
use Generated\Shared\Transfer\PayoneGetInvoiceTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\PayoneGetInvoiceTransfer 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...
23
use Generated\Shared\Transfer\PayoneGetSecurityInvoiceTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...SecurityInvoiceTransfer 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...
24
use Generated\Shared\Transfer\PayoneInitPaypalExpressCheckoutRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...CheckoutRequestTransfer 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...
25
use Generated\Shared\Transfer\PayoneKlarnaStartSessionRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...tSessionRequestTransfer 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...
26
use Generated\Shared\Transfer\PayoneKlarnaStartSessionResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...SessionResponseTransfer 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...
27
use Generated\Shared\Transfer\PayoneManageMandateTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...neManageMandateTransfer 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...
28
use Generated\Shared\Transfer\PayonePartialOperationRequestTransfer;
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...
29
use Generated\Shared\Transfer\PayoneRefundTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\PayoneRefundTransfer 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...
30
use Generated\Shared\Transfer\PayoneTransactionStatusUpdateTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...ionStatusUpdateTransfer 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...
31
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...
32
use Generated\Shared\Transfer\RefundResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\RefundResponseTransfer 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...
33
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...
34
use Spryker\Zed\Kernel\Business\AbstractFacade;
35
36
/**
37
 * @method \SprykerEco\Zed\Payone\Business\PayoneBusinessFactory getFactory()
38
 * @method \SprykerEco\Zed\Payone\Persistence\PayoneEntityManagerInterface getEntityManager()
39
 * @method \SprykerEco\Zed\Payone\Persistence\PayoneRepositoryInterface getRepository()
40
 */
41
class PayoneFacade extends AbstractFacade implements PayoneFacadeInterface
42
{
43
    /**
44
     * {@inheritDoc}
45
     *
46
     * @api
47
     *
48
     * @deprecated Use {@link \SprykerEco\Zed\Payone\Business\PayoneFacade::saveOrderPayment} instead.
49
     *
50
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
51
     * @param \Generated\Shared\Transfer\CheckoutResponseTransfer $checkoutResponse
52
     *
53
     * @return void
54
     */
55
    public function saveOrder(QuoteTransfer $quoteTransfer, CheckoutResponseTransfer $checkoutResponse)
56
    {
57
        $this->getFactory()->createOrderManager()->saveOrder($quoteTransfer, $checkoutResponse);
0 ignored issues
show
Deprecated Code introduced by
The function SprykerEco\Zed\Payone\Bu...derManager::saveOrder() has been deprecated: Use {@link \SprykerEco\Zed\Payone\Business\Order\OrderManager::saveOrderPayment()} instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

57
        /** @scrutinizer ignore-deprecated */ $this->getFactory()->createOrderManager()->saveOrder($quoteTransfer, $checkoutResponse);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
58
    }
59
60
    /**
61
     * {@inheritDoc}
62
     *
63
     * @api
64
     *
65
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
66
     * @param \Generated\Shared\Transfer\SaveOrderTransfer $saveOrderTransfer
67
     *
68
     * @return void
69
     */
70
    public function saveOrderPayment(QuoteTransfer $quoteTransfer, SaveOrderTransfer $saveOrderTransfer): void
71
    {
72
        $this->getFactory()->createOrderManager()->saveOrderPayment($quoteTransfer, $saveOrderTransfer);
73
    }
74
75
    /**
76
     * {@inheritDoc}
77
     *
78
     * @api
79
     *
80
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
81
     *
82
     * @return \Generated\Shared\Transfer\AuthorizationResponseTransfer
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...izationResponseTransfer 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...
83
     */
84
    public function authorizePayment(OrderTransfer $orderTransfer)
85
    {
86
        return $this->getFactory()->createPayoneAuthorizeRequestSender()->authorizePayment($orderTransfer);
87
    }
88
89
    /**
90
     * {@inheritDoc}
91
     *
92
     * @api
93
     *
94
     * @param int $idSalesOrder
95
     *
96
     * @return \Generated\Shared\Transfer\AuthorizationResponseTransfer
97
     */
98
    public function preAuthorizePayment($idSalesOrder)
99
    {
100
        return $this->getFactory()->createPayonePreAuthorizeRequestSender()->preAuthorizePayment($idSalesOrder);
101
    }
102
103
    /**
104
     * {@inheritDoc}
105
     *
106
     * @api
107
     *
108
     * @param \Generated\Shared\Transfer\PayoneCaptureTransfer $captureTransfer
109
     *
110
     * @return \Generated\Shared\Transfer\CaptureResponseTransfer
111
     */
112
    public function capturePayment(PayoneCaptureTransfer $captureTransfer): CaptureResponseTransfer
113
    {
114
        return $this->getFactory()->createPayoneCaptureRequestSender()->capturePayment($captureTransfer);
115
    }
116
117
    /**
118
     * {@inheritDoc}
119
     *
120
     * @api
121
     *
122
     * @param int $idPayment
123
     *
124
     * @return \Generated\Shared\Transfer\DebitResponseTransfer
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\DebitResponseTransfer 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...
125
     */
126
    public function debitPayment($idPayment)
127
    {
128
        return $this->getFactory()->createPayoneDebitRequestSender()->debitPayment($idPayment);
129
    }
130
131
    /**
132
     * {@inheritDoc}
133
     *
134
     * @api
135
     *
136
     * @param \Generated\Shared\Transfer\PayoneRefundTransfer $refundTransfer
137
     *
138
     * @return \Generated\Shared\Transfer\RefundResponseTransfer
139
     */
140
    public function refundPayment(PayoneRefundTransfer $refundTransfer)
141
    {
142
        return $this->getFactory()->createPayoneRefundRequestSender()->refundPayment($refundTransfer);
143
    }
144
145
    /**
146
     * {@inheritDoc}
147
     *
148
     * @api
149
     *
150
     * @param \Generated\Shared\Transfer\PayonePartialOperationRequestTransfer $payonePartialOperationRequestTransfer
151
     *
152
     * @return \Generated\Shared\Transfer\RefundResponseTransfer
153
     */
154
    public function executePartialRefund(PayonePartialOperationRequestTransfer $payonePartialOperationRequestTransfer): RefundResponseTransfer
155
    {
156
        return $this->getFactory()->createPayonePartialRefundRequestSender()->executePartialRefund($payonePartialOperationRequestTransfer);
157
    }
158
159
    /**
160
     * {@inheritDoc}
161
     *
162
     * @api
163
     *
164
     * @param \Generated\Shared\Transfer\PayoneCreditCardTransfer $creditCardData
165
     *
166
     * @return \Generated\Shared\Transfer\CreditCardCheckResponseTransfer
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...rdCheckResponseTransfer 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...
167
     */
168
    public function creditCardCheck(PayoneCreditCardTransfer $creditCardData)
169
    {
170
        return $this->getFactory()->createPayoneCreditCardChecker()->creditCardCheck($creditCardData);
171
    }
172
173
    /**
174
     * {@inheritDoc}
175
     *
176
     * @api
177
     *
178
     * @param \Generated\Shared\Transfer\PayoneBankAccountCheckTransfer $bankAccountCheckTransfer
179
     *
180
     * @return \Generated\Shared\Transfer\PayoneBankAccountCheckTransfer
181
     */
182
    public function bankAccountCheck(PayoneBankAccountCheckTransfer $bankAccountCheckTransfer)
183
    {
184
        return $this->getFactory()->createPayoneBankAccountChecker()->bankAccountCheck($bankAccountCheckTransfer);
185
    }
186
187
    /**
188
     * {@inheritDoc}
189
     *
190
     * @api
191
     *
192
     * @param \Generated\Shared\Transfer\PayoneManageMandateTransfer $manageMandateTransfer
193
     *
194
     * @return \Generated\Shared\Transfer\PayoneManageMandateTransfer
195
     */
196
    public function manageMandate(PayoneManageMandateTransfer $manageMandateTransfer)
197
    {
198
        return $this->getFactory()->createPayoneManageMandateMethodSender()->manageMandate($manageMandateTransfer);
199
    }
200
201
    /**
202
     * {@inheritDoc}
203
     *
204
     * @api
205
     *
206
     * @param \Generated\Shared\Transfer\PayoneGetFileTransfer $getFileTransfer
207
     *
208
     * @return \Generated\Shared\Transfer\PayoneGetFileTransfer
209
     */
210
    public function getFile(PayoneGetFileTransfer $getFileTransfer)
211
    {
212
        return $this->getFactory()->createPayoneFileReader()->getFile($getFileTransfer);
213
    }
214
215
    /**
216
     * {@inheritDoc}
217
     *
218
     * @api
219
     *
220
     * @param \Generated\Shared\Transfer\PayoneGetInvoiceTransfer $getInvoiceTransfer
221
     *
222
     * @return \Generated\Shared\Transfer\PayoneGetInvoiceTransfer
223
     */
224
    public function getInvoice(PayoneGetInvoiceTransfer $getInvoiceTransfer)
225
    {
226
        return $this->getFactory()->createPayoneInvoiceReader()->getInvoice($getInvoiceTransfer);
227
    }
228
229
    /**
230
     * {@inheritDoc}
231
     *
232
     * @api
233
     *
234
     * @param \Generated\Shared\Transfer\PayoneGetSecurityInvoiceTransfer $getSecurityInvoiceTransfer
235
     *
236
     * @return \Generated\Shared\Transfer\PayoneGetSecurityInvoiceTransfer
237
     */
238
    public function getSecurityInvoice(PayoneGetSecurityInvoiceTransfer $getSecurityInvoiceTransfer): PayoneGetSecurityInvoiceTransfer
239
    {
240
        return $this->getFactory()->createPayoneSecurityInvoiceReader()->getSecurityInvoice($getSecurityInvoiceTransfer);
241
    }
242
243
    /**
244
     * {@inheritDoc}
245
     *
246
     * @api
247
     *
248
     * @param \Generated\Shared\Transfer\PayoneTransactionStatusUpdateTransfer $transactionStatusUpdateTransfer
249
     *
250
     * @return \Generated\Shared\Transfer\PayoneTransactionStatusUpdateTransfer
251
     */
252
    public function processTransactionStatusUpdate(PayoneTransactionStatusUpdateTransfer $transactionStatusUpdateTransfer)
253
    {
254
        $transactionManager = $this->getFactory()->createTransactionStatusManager();
255
        $transactionTransfer = $this->getFactory()->createTransactionStatusRequest($transactionStatusUpdateTransfer);
256
        $response = $transactionManager->processTransactionStatusUpdate($transactionTransfer);
257
        $transactionStatusUpdateTransfer->setIsSuccess($response->isSuccess());
258
        $transactionStatusUpdateTransfer->setResponse($response->getStatus() . ($response->getErrorMessage() ? ': ' . $response->getErrorMessage() : ''));
259
260
        return $transactionStatusUpdateTransfer;
261
    }
262
263
    /**
264
     * {@inheritDoc}
265
     *
266
     * @api
267
     *
268
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
269
     *
270
     * @return bool
271
     */
272
    public function isAuthorizationApproved(OrderTransfer $orderTransfer)
273
    {
274
        return $this->getFactory()->createApiLogFinder()->isAuthorizationApproved($orderTransfer);
275
    }
276
277
    /**
278
     * {@inheritDoc}
279
     *
280
     * @api
281
     *
282
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
283
     *
284
     * @return bool
285
     */
286
    public function isAuthorizationRedirect(OrderTransfer $orderTransfer)
287
    {
288
        return $this->getFactory()->createApiLogFinder()->isAuthorizationRedirect($orderTransfer);
289
    }
290
291
    /**
292
     * {@inheritDoc}
293
     *
294
     * @api
295
     *
296
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
297
     *
298
     * @return bool
299
     */
300
    public function isPreauthorizationApproved(OrderTransfer $orderTransfer)
301
    {
302
        return $this->getFactory()->createApiLogFinder()->isPreAuthorizationApproved($orderTransfer);
303
    }
304
305
    /**
306
     * {@inheritDoc}
307
     *
308
     * @api
309
     *
310
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
311
     *
312
     * @return bool
313
     */
314
    public function isPreauthorizationRedirect(OrderTransfer $orderTransfer)
315
    {
316
        return $this->getFactory()->createApiLogFinder()->isPreAuthorizationRedirect($orderTransfer);
317
    }
318
319
    /**
320
     * {@inheritDoc}
321
     *
322
     * @api
323
     *
324
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
325
     *
326
     * @return bool
327
     */
328
    public function isPreAuthorizationError(OrderTransfer $orderTransfer)
329
    {
330
        return $this->getFactory()->createApiLogFinder()->isPreAuthorizationError($orderTransfer);
331
    }
332
333
    /**
334
     * {@inheritDoc}
335
     *
336
     * @api
337
     *
338
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
339
     *
340
     * @return bool
341
     */
342
    public function isAuthorizationError(OrderTransfer $orderTransfer)
343
    {
344
        return $this->getFactory()->createApiLogFinder()->isAuthorizationError($orderTransfer);
345
    }
346
347
    /**
348
     * {@inheritDoc}
349
     *
350
     * @api
351
     *
352
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
353
     *
354
     * @return bool
355
     */
356
    public function isCaptureApproved(OrderTransfer $orderTransfer)
357
    {
358
        return $this->getFactory()->createApiLogFinder()->isCaptureApproved($orderTransfer);
359
    }
360
361
    /**
362
     * {@inheritDoc}
363
     *
364
     * @api
365
     *
366
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
367
     *
368
     * @return bool
369
     */
370
    public function isCaptureError(OrderTransfer $orderTransfer)
371
    {
372
        return $this->getFactory()->createApiLogFinder()->isCaptureError($orderTransfer);
373
    }
374
375
    /**
376
     * {@inheritDoc}
377
     *
378
     * @api
379
     *
380
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
381
     *
382
     * @return bool
383
     */
384
    public function isRefundApproved(OrderTransfer $orderTransfer)
385
    {
386
        return $this->getFactory()->createApiLogFinder()->isRefundApproved($orderTransfer);
387
    }
388
389
    /**
390
     * {@inheritDoc}
391
     *
392
     * @api
393
     *
394
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
395
     *
396
     * @return bool
397
     */
398
    public function isRefundError(OrderTransfer $orderTransfer)
399
    {
400
        return $this->getFactory()->createApiLogFinder()->isRefundError($orderTransfer);
401
    }
402
403
    /**
404
     * {@inheritDoc}
405
     *
406
     * @api
407
     *
408
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
409
     *
410
     * @return bool
411
     */
412
    public function isRefundPossible(OrderTransfer $orderTransfer)
413
    {
414
        return $this->getFactory()->createRefundChecker()->isRefundPossible($orderTransfer);
415
    }
416
417
    /**
418
     * {@inheritDoc}
419
     *
420
     * @api
421
     *
422
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
423
     *
424
     * @return bool
425
     */
426
    public function isPaymentDataRequired(OrderTransfer $orderTransfer)
427
    {
428
        return $this->getFactory()->createPaymentDataChecker()->isPaymentDataRequired($orderTransfer);
429
    }
430
431
    /**
432
     * {@inheritDoc}
433
     *
434
     * @api
435
     *
436
     * @param int $idSalesOrder
437
     * @param int $idSalesOrderItem
438
     *
439
     * @return bool
440
     */
441
    public function isPaymentNotificationAvailable($idSalesOrder, $idSalesOrderItem)
442
    {
443
        return $this->getFactory()
444
            ->createTransactionStatusManager()
445
            ->isPaymentNotificationAvailable($idSalesOrder, $idSalesOrderItem);
446
    }
447
448
    /**
449
     * {@inheritDoc}
450
     *
451
     * @api
452
     *
453
     * @param int $idSalesOrder
454
     * @param int $idSalesOrderItem
455
     *
456
     * @return bool
457
     */
458
    public function isPaymentPaid($idSalesOrder, $idSalesOrderItem)
459
    {
460
        return $this->getFactory()
461
            ->createTransactionStatusManager()
462
            ->isPaymentPaid($idSalesOrder, $idSalesOrderItem);
463
    }
464
465
    /**
466
     * {@inheritDoc}
467
     *
468
     * @api
469
     *
470
     * @param int $idSalesOrder
471
     * @param int $idSalesOrderItem
472
     *
473
     * @return bool
474
     */
475
    public function isPaymentOverpaid($idSalesOrder, $idSalesOrderItem)
476
    {
477
        return $this->getFactory()
478
            ->createTransactionStatusManager()
479
            ->isPaymentOverpaid($idSalesOrder, $idSalesOrderItem);
480
    }
481
482
    /**
483
     * {@inheritDoc}
484
     *
485
     * @api
486
     *
487
     * @param int $idSalesOrder
488
     * @param int $idSalesOrderItem
489
     *
490
     * @return bool
491
     */
492
    public function isPaymentUnderpaid($idSalesOrder, $idSalesOrderItem)
493
    {
494
        return $this->getFactory()
495
            ->createTransactionStatusManager()
496
            ->isPaymentUnderpaid($idSalesOrder, $idSalesOrderItem);
497
    }
498
499
    /**
500
     * {@inheritDoc}
501
     *
502
     * @api
503
     *
504
     * @param int $idSalesOrder
505
     * @param int $idSalesOrderItem
506
     *
507
     * @return bool
508
     */
509
    public function isPaymentRefund($idSalesOrder, $idSalesOrderItem)
510
    {
511
        return $this->getFactory()
512
            ->createTransactionStatusManager()
513
            ->isPaymentRefund($idSalesOrder, $idSalesOrderItem);
514
    }
515
516
    /**
517
     * {@inheritDoc}
518
     *
519
     * @api
520
     *
521
     * @param int $idSalesOrder
522
     * @param int $idSalesOrderItem
523
     *
524
     * @return bool
525
     */
526
    public function isPaymentAppointed($idSalesOrder, $idSalesOrderItem)
527
    {
528
        return $this->getFactory()
529
            ->createTransactionStatusManager()
530
            ->isPaymentAppointed($idSalesOrder, $idSalesOrderItem);
531
    }
532
533
    /**
534
     * {@inheritDoc}
535
     *
536
     * @api
537
     *
538
     * @param int $idSalesOrder
539
     * @param int $idSalesOrderItem
540
     *
541
     * @return bool
542
     */
543
    public function isPaymentOther($idSalesOrder, $idSalesOrderItem)
544
    {
545
        return $this->getFactory()
546
            ->createTransactionStatusManager()
547
            ->isPaymentOther($idSalesOrder, $idSalesOrderItem);
548
    }
549
550
    /**
551
     * {@inheritDoc}
552
     *
553
     * @api
554
     *
555
     * @param int $idSalesOrder
556
     * @param int $idSalesOrderItem
557
     *
558
     * @return bool
559
     */
560
    public function isPaymentCapture($idSalesOrder, $idSalesOrderItem)
561
    {
562
        return $this->getFactory()
563
            ->createTransactionStatusManager()
564
            ->isPaymentCapture($idSalesOrder, $idSalesOrderItem);
565
    }
566
567
    /**
568
     * {@inheritDoc}
569
     *
570
     * @api
571
     *
572
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
573
     * @param \Generated\Shared\Transfer\CheckoutResponseTransfer $checkoutResponse
574
     *
575
     * @return \Generated\Shared\Transfer\CheckoutResponseTransfer
576
     */
577
    public function orderPostSave(QuoteTransfer $quoteTransfer, CheckoutResponseTransfer $checkoutResponse): CheckoutResponseTransfer
578
    {
579
        return $this->getFactory()
580
            ->createPostSaveHook()
581
            ->executePostSaveHook($quoteTransfer, $checkoutResponse);
582
    }
583
584
    /**
585
     * {@inheritDoc}
586
     *
587
     * @api
588
     *
589
     * @deprecated Use {@link \SprykerEco\Zed\Payone\Business\PayoneFacade::orderPostSave()} instead.
590
     *
591
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
592
     * @param \Generated\Shared\Transfer\CheckoutResponseTransfer $checkoutResponse
593
     *
594
     * @return \Generated\Shared\Transfer\CheckoutResponseTransfer
595
     */
596
    public function postSaveHook(QuoteTransfer $quoteTransfer, CheckoutResponseTransfer $checkoutResponse)
597
    {
598
        return $this->getFactory()
0 ignored issues
show
Deprecated Code introduced by
The function SprykerEco\Zed\Payone\Bu...aveHook::postSaveHook() has been deprecated: Use {@link \SprykerEco\Zed\Payone\Business\Payment\Hook\PostSaveHook::executePostSaveHook()} instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

598
        return /** @scrutinizer ignore-deprecated */ $this->getFactory()

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
599
            ->createPostSaveHook()
600
            ->postSaveHook($quoteTransfer, $checkoutResponse);
601
    }
602
603
    /**
604
     * {@inheritDoc}
605
     *
606
     * @api
607
     *
608
     * @deprecated Use {@link \SprykerEco\Zed\Payone\Business\PayoneFacade::orderPostSave()} instead.
609
     *
610
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
611
     * @param \Generated\Shared\Transfer\CheckoutResponseTransfer $checkoutResponse
612
     *
613
     * @return \Generated\Shared\Transfer\CheckoutResponseTransfer
614
     */
615
    public function executeCheckoutPostSaveHook(
616
        QuoteTransfer $quoteTransfer,
617
        CheckoutResponseTransfer $checkoutResponse
618
    ): CheckoutResponseTransfer {
619
        return $this->getFactory()
0 ignored issues
show
Deprecated Code introduced by
The function SprykerEco\Zed\Payone\Bu...eCheckoutPostSaveHook() has been deprecated: Use {@link \SprykerEco\Zed\Payone\Business\Payment\Hook\PostSaveHook::executePostSaveHook()} instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

619
        return /** @scrutinizer ignore-deprecated */ $this->getFactory()

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
620
            ->createPostSaveHook()
621
            ->executeCheckoutPostSaveHook($quoteTransfer, $checkoutResponse);
622
    }
623
624
    /**
625
     * {@inheritDoc}
626
     *
627
     * @api
628
     *
629
     * @param \Generated\Shared\Transfer\OrderCollectionTransfer $orderCollectionTransfer
630
     *
631
     * @return \Generated\Shared\Transfer\PayonePaymentLogCollectionTransfer
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...ntLogCollectionTransfer 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...
632
     */
633
    public function getPaymentLogs(OrderCollectionTransfer $orderCollectionTransfer)
634
    {
635
        $orders = $orderCollectionTransfer->getOrders();
636
637
        return $this->getRepository()->getPaymentLogs($orders);
638
    }
639
640
    /**
641
     * {@inheritDoc}
642
     *
643
     * @api
644
     *
645
     * @param int $idOrder
646
     *
647
     * @return \Generated\Shared\Transfer\PaymentDetailTransfer
648
     */
649
    public function getPaymentDetail($idOrder)
650
    {
651
        return $this->getRepository()->getPaymentDetail($idOrder);
652
    }
653
654
    /**
655
     * {@inheritDoc}
656
     *
657
     * @api
658
     *
659
     * @param \Generated\Shared\Transfer\PaymentDetailTransfer $paymentData
660
     * @param int $idOrder
661
     *
662
     * @return void
663
     */
664
    public function updatePaymentDetail(PaymentDetailTransfer $paymentData, $idOrder)
665
    {
666
        $this->getEntityManager()->updatePaymentDetail($paymentData, $idOrder);
667
    }
668
669
    /**
670
     * {@inheritDoc}
671
     *
672
     * @api
673
     *
674
     * @param \Generated\Shared\Transfer\PayoneInitPaypalExpressCheckoutRequestTransfer $requestTransfer
675
     *
676
     * @return \Generated\Shared\Transfer\PayonePaypalExpressCheckoutGenericPaymentResponseTransfer
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...PaymentResponseTransfer 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...
677
     */
678
    public function initPaypalExpressCheckout(PayoneInitPaypalExpressCheckoutRequestTransfer $requestTransfer)
679
    {
680
        return $this->getFactory()->createPayoneInitPaypalExpressCheckoutMethodSender()->initPaypalExpressCheckout($requestTransfer);
681
    }
682
683
    /**
684
     * {@inheritDoc}
685
     *
686
     * @api
687
     *
688
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
689
     *
690
     * @return \Generated\Shared\Transfer\PayonePaypalExpressCheckoutGenericPaymentResponseTransfer
691
     */
692
    public function getPaypalExpressCheckoutDetails(QuoteTransfer $quoteTransfer)
693
    {
694
        return $this->getFactory()->createPayonePaypalExpressCheckoutDetailsReader()->getPaypalExpressCheckoutDetails($quoteTransfer);
695
    }
696
697
    /**
698
     * {@inheritDoc}
699
     *
700
     * @api
701
     *
702
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
703
     *
704
     * @return \Generated\Shared\Transfer\AddressCheckResponseTransfer
705
     */
706
    public function sendAddressCheckRequest(QuoteTransfer $quoteTransfer): AddressCheckResponseTransfer
707
    {
708
        return $this->getFactory()
709
            ->createRiskCheckManager()
710
            ->sendAddressCheckRequest($quoteTransfer);
711
    }
712
713
    /**
714
     * {@inheritDoc}
715
     *
716
     * @api
717
     *
718
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
719
     *
720
     * @return \Generated\Shared\Transfer\ConsumerScoreResponseTransfer
721
     */
722
    public function sendConsumerScoreRequest(QuoteTransfer $quoteTransfer): ConsumerScoreResponseTransfer
723
    {
724
        return $this->getFactory()
725
            ->createRiskCheckManager()
726
            ->sendConsumerScoreRequest($quoteTransfer);
727
    }
728
729
    /**
730
     * {@inheritDoc}
731
     *
732
     * @api
733
     *
734
     * @param \Generated\Shared\Transfer\PaymentMethodsTransfer $paymentMethodsTransfer
735
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
736
     *
737
     * @return \Generated\Shared\Transfer\PaymentMethodsTransfer
738
     */
739
    public function filterPaymentMethods(PaymentMethodsTransfer $paymentMethodsTransfer, QuoteTransfer $quoteTransfer): PaymentMethodsTransfer
740
    {
741
        return $this->getFactory()
742
            ->createPaymentMethodFilter()
743
            ->filterPaymentMethods($paymentMethodsTransfer, $quoteTransfer);
744
    }
745
746
    /**
747
     * {@inheritDoc}
748
     *
749
     * @api
750
     *
751
     * @param int $idSalesOrder
752
     * @param int $idSalesOrderItem
753
     *
754
     * @return string|null
755
     */
756
    public function findPayoneOrderItemStatus(int $idSalesOrder, int $idSalesOrderItem): ?string
757
    {
758
        return $this->getFactory()
759
            ->createPayoneOrderItemStatusFinder()
760
            ->findPayoneOrderItemStatus($idSalesOrder, $idSalesOrderItem);
761
    }
762
763
    /**
764
     * {@inheritDoc}
765
     *
766
     * @api
767
     *
768
     * @param \Generated\Shared\Transfer\PayonePartialOperationRequestTransfer $payonePartialOperationRequestTransfer
769
     *
770
     * @return \Generated\Shared\Transfer\CaptureResponseTransfer
771
     */
772
    public function executePartialCapture(
773
        PayonePartialOperationRequestTransfer $payonePartialOperationRequestTransfer
774
    ): CaptureResponseTransfer {
775
        return $this->getFactory()
776
            ->createPayonePartialCaptureRequestSender()
777
            ->executePartialCapture($payonePartialOperationRequestTransfer);
778
    }
779
780
    /**
781
     * {@inheritDoc}
782
     *
783
     * @api
784
     *
785
     * @param \Generated\Shared\Transfer\PayoneKlarnaStartSessionRequestTransfer $payoneKlarnaStartSessionRequestTransfer
786
     *
787
     * @return \Generated\Shared\Transfer\PayoneKlarnaStartSessionResponseTransfer
788
     */
789
    public function sendKlarnaStartSessionRequest(
790
        PayoneKlarnaStartSessionRequestTransfer $payoneKlarnaStartSessionRequestTransfer
791
    ): PayoneKlarnaStartSessionResponseTransfer {
792
        return $this->getFactory()
793
            ->createPayoneKlarnaStartSessionMethodSender()
794
            ->sendKlarnaStartSessionRequest($payoneKlarnaStartSessionRequestTransfer);
795
    }
796
}
797