Completed
Push — feature/eco-574/eco-2266-check... ( b72c03...e5ed68 )
by Ruslan
11s queued 10s
created

AfterPayFacade::getAvailablePaymentMethods()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
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\AfterPayAvailablePaymentMethodsTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...ePaymentMethodsTransfer 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\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...
13
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...
14
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...
15
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...
16
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...
17
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...
18
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...
19
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...
20
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...
21
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...
22
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...
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->getFactory()
65
            ->createValidateCustomerHandler()
66
            ->validateCustomer($validateCustomerRequestTransfer);
67
    }
68
69
    /**
70
     * {@inheritdoc}
71
     *
72
     * @api
73
     *
74
     * @param \Generated\Shared\Transfer\AfterPayValidateBankAccountRequestTransfer $validateBankAccountRequestTransfer
75
     *
76
     * @return \Generated\Shared\Transfer\AfterPayValidateBankAccountResponseTransfer
77
     */
78
    public function validateBankAccount(AfterPayValidateBankAccountRequestTransfer $validateBankAccountRequestTransfer): AfterPayValidateBankAccountResponseTransfer
79
    {
80
        return $this->getFactory()
81
            ->createValidateBankAccountHandler()
82
            ->validateBankAccount($validateBankAccountRequestTransfer);
83
    }
84
85
    /**
86
     * {@inheritdoc}
87
     *
88
     * @api
89
     *
90
     * @param \Generated\Shared\Transfer\AfterPayCustomerLookupRequestTransfer $customerLookupRequestTransfer
91
     *
92
     * @return \Generated\Shared\Transfer\AfterPayCustomerLookupResponseTransfer
93
     */
94
    public function lookupCustomer(AfterPayCustomerLookupRequestTransfer $customerLookupRequestTransfer): AfterPayCustomerLookupResponseTransfer
95
    {
96
        return $this->getFactory()
97
            ->createLookupCustomerHandler()
98
            ->lookupCustomer($customerLookupRequestTransfer);
99
    }
100
101
    /**
102
     * {@inheritdoc}
103
     *
104
     * @api
105
     *
106
     * @param \Generated\Shared\Transfer\AfterPayInstallmentPlansRequestTransfer $installmentPlansRequestTransfer
107
     *
108
     * @return \Generated\Shared\Transfer\AfterPayInstallmentPlansResponseTransfer
109
     */
110
    public function lookupInstallmentPlans(AfterPayInstallmentPlansRequestTransfer $installmentPlansRequestTransfer): AfterPayInstallmentPlansResponseTransfer
111
    {
112
        return $this->getFactory()
113
            ->createLookupInstallmentPlansHandler()
114
            ->lookupInstallmentPlans($installmentPlansRequestTransfer);
115
    }
116
117
    /**
118
     * {@inheritdoc}
119
     *
120
     * @api
121
     *
122
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
123
     * @param \Generated\Shared\Transfer\SaveOrderTransfer $saveOrderTransfer
124
     *
125
     * @return void
126
     */
127
    public function saveOrderPayment(QuoteTransfer $quoteTransfer, SaveOrderTransfer $saveOrderTransfer): void
128
    {
129
        $this->getFactory()
130
            ->createOrderSaver()
131
            ->saveOrderPayment($quoteTransfer, $saveOrderTransfer);
132
    }
133
134
    /**
135
     * {@inheritdoc}
136
     *
137
     * @api
138
     *
139
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
140
     * @param \Generated\Shared\Transfer\CheckoutResponseTransfer $checkoutResponseTransfer
141
     *
142
     * @return \Generated\Shared\Transfer\CheckoutResponseTransfer
143
     */
144
    public function postSaveHook(QuoteTransfer $quoteTransfer, CheckoutResponseTransfer $checkoutResponseTransfer): CheckoutResponseTransfer
145
    {
146
        return $this->getFactory()
147
            ->createPostSaveHook()
148
            ->execute($quoteTransfer, $checkoutResponseTransfer);
149
    }
150
151
    /**
152
     * {@inheritdoc}
153
     *
154
     * @api
155
     *
156
     * @param \Generated\Shared\Transfer\AfterPayCallTransfer $afterPayCallTransfer
157
     *
158
     * @return \Generated\Shared\Transfer\AfterPayApiResponseTransfer
159
     */
160
    public function authorizePayment(AfterPayCallTransfer $afterPayCallTransfer): AfterPayApiResponseTransfer
161
    {
162
        return $this->getFactory()
163
            ->createAuthorizeTransactionHandler()
164
            ->authorize($afterPayCallTransfer);
165
    }
166
167
    /**
168
     * {@inheritdoc}
169
     *
170
     * @api
171
     *
172
     * @param \Generated\Shared\Transfer\ItemTransfer[] $items
173
     * @param \Generated\Shared\Transfer\AfterPayCallTransfer $afterPayCallTransfer
174
     *
175
     * @return void
176
     */
177
    public function capturePayment(array $items, AfterPayCallTransfer $afterPayCallTransfer): void
178
    {
179
        $this->getFactory()
180
            ->createCaptureTransactionHandler()
181
            ->capture($items, $afterPayCallTransfer);
182
    }
183
184
    /**
185
     * {@inheritdoc}
186
     *
187
     * @api
188
     *
189
     * @param \Generated\Shared\Transfer\ItemTransfer[] $items
190
     * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
191
     *
192
     * @return void
193
     */
194
    public function refundPayment(array $items, OrderTransfer $orderTransfer): void
195
    {
196
        $this->getFactory()
197
            ->createRefundTransactionHandler()
198
            ->refund($items, $orderTransfer);
199
    }
200
201
    /**
202
     * {@inheritdoc}
203
     *
204
     * @api
205
     *
206
     * @param \Generated\Shared\Transfer\ItemTransfer[] $items
207
     * @param \Generated\Shared\Transfer\AfterPayCallTransfer $afterPayCallTransfer
208
     *
209
     * @return void
210
     */
211
    public function cancelPayment(array $items, AfterPayCallTransfer $afterPayCallTransfer): void
212
    {
213
        $this->getFactory()
214
            ->createCancelTransactionHandler()
215
            ->cancel($items, $afterPayCallTransfer);
216
    }
217
218
    /**
219
     * {@inheritdoc}
220
     *
221
     * @api
222
     *
223
     * @param int $idSalesOrder
224
     *
225
     * @return \Generated\Shared\Transfer\AfterPayPaymentTransfer
226
     */
227
    public function getPaymentByIdSalesOrder(int $idSalesOrder): AfterPayPaymentTransfer
228
    {
229
        return $this->getFactory()
230
            ->createPaymentReader()
231
            ->getPaymentByIdSalesOrder($idSalesOrder);
232
    }
233
234
    /**
235
     * {@inheritdoc}
236
     *
237
     * @api
238
     *
239
     * @return string
240
     */
241
    public function getApiVersion(): string
242
    {
243
        return $this->getFactory()
244
            ->createApiAdapter()
245
            ->getApiVersion();
246
    }
247
248
    /**
249
     * {@inheritdoc}
250
     *
251
     * @api
252
     *
253
     * @return int
254
     */
255
    public function getApiStatus(): int
256
    {
257
        return $this->getFactory()
258
            ->createApiAdapter()
259
            ->getApiStatus();
260
    }
261
262
    /**
263
     * {@inheritdoc}
264
     *
265
     * @api
266
     *
267
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
268
     * @return \Generated\Shared\Transfer\AfterPayAvailablePaymentMethodsTransfer
269
     */
270
    public function getAvailablePaymentMethods(QuoteTransfer $quoteTransfer): AfterPayAvailablePaymentMethodsTransfer
271
    {
272
        return $this->getFactory()
273
            ->createPaymentMethodsProvider()
274
            ->getAvailablePaymentMethods($quoteTransfer);
275
    }
276
}
277