Passed
Push — feature/eco-574/eco-2266-check... ( 7e1004...8cf5ab )
by Aleksey
04:15
created

AfterPayFacade::filterPaymentMethods()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Zed\AfterPay\Business;
9
10
use Generated\Shared\Transfer\AfterPayApiResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...rPayApiResponseTransfer 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\AfterPayCallTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\AfterPayCallTransfer 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\AfterPayCustomerLookupRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...erLookupRequestTransfer 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\AfterPayCustomerLookupResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...rLookupResponseTransfer 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\AfterPayInstallmentPlansRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...entPlansRequestTransfer 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\AfterPayInstallmentPlansResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...ntPlansResponseTransfer 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\AfterPayPaymentTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\AfterPayPaymentTransfer 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\AfterPayValidateBankAccountRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...kAccountRequestTransfer 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\AfterPayValidateBankAccountResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...AccountResponseTransfer 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\AfterPayValidateCustomerRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...CustomerRequestTransfer 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\AfterPayValidateCustomerResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...ustomerResponseTransfer 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\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...
22
use Generated\Shared\Transfer\ItemTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\ItemTransfer 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\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...
24
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...
25
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...
26
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...
27
use Spryker\Zed\Kernel\Business\AbstractFacade;
28
29
/**
30
 * @method \SprykerEco\Zed\AfterPay\Business\AfterPayBusinessFactory getFactory()
31
 */
32
class AfterPayFacade extends AbstractFacade implements AfterPayFacadeInterface
33
{
34
    /**
35
     * {@inheritdoc}
36
     *
37
     * @api
38
     *
39
     * @param \Generated\Shared\Transfer\PaymentMethodsTransfer $paymentMethodsTransfer
40
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
41
     *
42
     * @return \Generated\Shared\Transfer\PaymentMethodsTransfer
43
     */
44
    public function filterPaymentMethods(
45
        PaymentMethodsTransfer $paymentMethodsTransfer,
46
        QuoteTransfer $quoteTransfer
47
    ): PaymentMethodsTransfer {
48
        return $this->getFactory()
49
            ->createPaymentMethodsFilter()
50
            ->filterPaymentMethods($paymentMethodsTransfer, $quoteTransfer);
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     *
56
     * @api
57
     *
58
     * @param \Generated\Shared\Transfer\AfterPayValidateCustomerRequestTransfer $validateCustomerRequestTransfer
59
     *
60
     * @return \Generated\Shared\Transfer\AfterPayValidateCustomerResponseTransfer
61
     */
62
    public function validateCustomerAddress(AfterPayValidateCustomerRequestTransfer $validateCustomerRequestTransfer): AfterPayValidateCustomerResponseTransfer
63
    {
64
        return $this
65
            ->getFactory()
66
            ->createValidateCustomerHandler()
67
            ->validateCustomer($validateCustomerRequestTransfer);
68
    }
69
70
    /**
71
     * {@inheritdoc}
72
     *
73
     * @api
74
     *
75
     * @param \Generated\Shared\Transfer\AfterPayValidateBankAccountRequestTransfer $validateBankAccountRequestTransfer
76
     *
77
     * @return \Generated\Shared\Transfer\AfterPayValidateBankAccountResponseTransfer
78
     */
79
    public function validateBankAccount(AfterPayValidateBankAccountRequestTransfer $validateBankAccountRequestTransfer): AfterPayValidateBankAccountResponseTransfer
80
    {
81
        return $this
82
            ->getFactory()
83
            ->createValidateBankAccountHandler()
84
            ->validateBankAccount($validateBankAccountRequestTransfer);
85
    }
86
87
    /**
88
     * {@inheritdoc}
89
     *
90
     * @api
91
     *
92
     * @param \Generated\Shared\Transfer\AfterPayCustomerLookupRequestTransfer $customerLookupRequestTransfer
93
     *
94
     * @return \Generated\Shared\Transfer\AfterPayCustomerLookupResponseTransfer
95
     */
96
    public function lookupCustomer(AfterPayCustomerLookupRequestTransfer $customerLookupRequestTransfer): AfterPayCustomerLookupResponseTransfer
97
    {
98
        return $this
99
            ->getFactory()
100
            ->createLookupCustomerHandler()
101
            ->lookupCustomer($customerLookupRequestTransfer);
102
    }
103
104
    /**
105
     * {@inheritdoc}
106
     *
107
     * @api
108
     *
109
     * @param \Generated\Shared\Transfer\AfterPayInstallmentPlansRequestTransfer $installmentPlansRequestTransfer
110
     *
111
     * @return \Generated\Shared\Transfer\AfterPayInstallmentPlansResponseTransfer
112
     */
113
    public function lookupInstallmentPlans(AfterPayInstallmentPlansRequestTransfer $installmentPlansRequestTransfer): AfterPayInstallmentPlansResponseTransfer
114
    {
115
        return $this
116
            ->getFactory()
117
            ->createLookupInstallmentPlansHandler()
118
            ->lookupInstallmentPlans($installmentPlansRequestTransfer);
119
    }
120
121
    /**
122
     * {@inheritdoc}
123
     *
124
     * @api
125
     *
126
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
127
     * @param \Generated\Shared\Transfer\SaveOrderTransfer $saveOrderTransfer
128
     *
129
     * @return void
130
     */
131
    public function saveOrderPayment(QuoteTransfer $quoteTransfer, SaveOrderTransfer $saveOrderTransfer): void
132
    {
133
        $this
134
            ->getFactory()
135
            ->createOrderSaver()
136
            ->saveOrderPayment($quoteTransfer, $saveOrderTransfer);
137
    }
138
139
    /**
140
     * {@inheritdoc}
141
     *
142
     * @api
143
     *
144
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
145
     * @param \Generated\Shared\Transfer\CheckoutResponseTransfer $checkoutResponseTransfer
146
     *
147
     * @return \Generated\Shared\Transfer\CheckoutResponseTransfer
148
     */
149
    public function postSaveHook(QuoteTransfer $quoteTransfer, CheckoutResponseTransfer $checkoutResponseTransfer): CheckoutResponseTransfer
150
    {
151
        return $this
152
            ->getFactory()
153
            ->createPostSaveHook()
154
            ->execute($quoteTransfer, $checkoutResponseTransfer);
155
    }
156
157
    /**
158
     * {@inheritdoc}
159
     *
160
     * @api
161
     *
162
     * @param \Generated\Shared\Transfer\AfterPayCallTransfer $orderTransfer
163
     *
164
     * @return \Generated\Shared\Transfer\AfterPayApiResponseTransfer
165
     */
166
    public function authorizePayment(AfterPayCallTransfer $afterPayCallTransfer): AfterPayApiResponseTransfer
167
    {
168
        return $this
169
            ->getFactory()
170
            ->createAuthorizeTransactionHandler()
171
            ->authorize($afterPayCallTransfer);
172
    }
173
174
    /**
175
     * {@inheritdoc}
176
     *
177
     * @api
178
     *
179
     * @param \Generated\Shared\Transfer\ItemTransfer $itemTransfer
180
     * @param \Generated\Shared\Transfer\AfterPayCallTransfer $afterPayCallTransfer
181
     *
182
     * @return void
183
     */
184
    public function capturePayment(ItemTransfer $itemTransfer, AfterPayCallTransfer $afterPayCallTransfer): void
185
    {
186
        $this
187
            ->getFactory()
188
            ->createCaptureTransactionHandler()
189
            ->capture($itemTransfer, $afterPayCallTransfer);
190
    }
191
192
    /**
193
     * {@inheritdoc}
194
     *
195
     * @api
196
     *
197
     * @param \Generated\Shared\Transfer\ItemTransfer $itemTransfer
198
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
199
     *
200
     * @return void
201
     */
202
    public function refundPayment(ItemTransfer $itemTransfer, OrderTransfer $orderTransfer): void
203
    {
204
        $this
205
            ->getFactory()
206
            ->createRefundTransactionHandler()
207
            ->refund($itemTransfer, $orderTransfer);
208
    }
209
210
    /**
211
     * {@inheritdoc}
212
     *
213
     * @api
214
     *
215
     * @param \Generated\Shared\Transfer\ItemTransfer $itemTransfer
216
     * @param \Generated\Shared\Transfer\AfterPayCallTransfer $afterPayCallTransfer
217
     *
218
     * @return void
219
     */
220
    public function cancelPayment(ItemTransfer $itemTransfer, AfterPayCallTransfer $afterPayCallTransfer): void
221
    {
222
        $this
223
            ->getFactory()
224
            ->createCancelTransactionHandler()
225
            ->cancel($itemTransfer, $afterPayCallTransfer);
226
    }
227
228
    /**
229
     * {@inheritdoc}
230
     *
231
     * @api
232
     *
233
     * @param int $idSalesOrder
234
     *
235
     * @return \Generated\Shared\Transfer\AfterPayPaymentTransfer
236
     */
237
    public function getPaymentByIdSalesOrder(int $idSalesOrder): AfterPayPaymentTransfer
238
    {
239
        return $this
240
            ->getFactory()
241
            ->createPaymentReader()
242
            ->getPaymentByIdSalesOrder($idSalesOrder);
243
    }
244
245
    /**
246
     * {@inheritdoc}
247
     *
248
     * @api
249
     *
250
     * @return string
251
     */
252
    public function getApiVersion(): string
253
    {
254
        return $this
255
            ->getFactory()
256
            ->createApiAdapter()
257
            ->getApiVersion();
258
    }
259
260
    /**
261
     * {@inheritdoc}
262
     *
263
     * @api
264
     *
265
     * @return int
266
     */
267
    public function getApiStatus(): int
268
    {
269
        return $this
270
            ->getFactory()
271
            ->createApiAdapter()
272
            ->getApiStatus();
273
    }
274
}
275