1 | <?php |
||
2 | /** |
||
3 | * Copyright © 2013-2017 Magento, Inc. All rights reserved. |
||
4 | * See COPYING.txt for license details. |
||
5 | */ |
||
6 | |||
7 | namespace Moip\Magento2\Gateway\Request; |
||
8 | |||
9 | use Magento\Payment\Gateway\Data\PaymentDataObjectInterface; |
||
0 ignored issues
–
show
|
|||
10 | use Magento\Payment\Gateway\Request\BuilderInterface; |
||
0 ignored issues
–
show
The type
Magento\Payment\Gateway\Request\BuilderInterface 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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
11 | use Magento\Vault\Model\Ui\VaultConfigProvider; |
||
0 ignored issues
–
show
The type
Magento\Vault\Model\Ui\VaultConfigProvider 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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
12 | |||
13 | class VaultDataBuilder implements BuilderInterface |
||
14 | { |
||
15 | /** |
||
16 | * Additional options in request to gateway. |
||
17 | */ |
||
18 | const OPTIONS = 'options'; |
||
19 | |||
20 | /** |
||
21 | * The option that determines whether the payment method associated with |
||
22 | * the successful transaction should be stored in the Vault. |
||
23 | */ |
||
24 | const STORE_IN_VAULT_ON_SUCCESS = 'storeInVaultOnSuccess'; |
||
25 | |||
26 | /** |
||
27 | * @inheritdoc |
||
28 | */ |
||
29 | public function build(array $buildSubject): array |
||
30 | { |
||
31 | if (!isset($buildSubject['payment']) |
||
32 | || !$buildSubject['payment'] instanceof PaymentDataObjectInterface |
||
33 | ) { |
||
34 | throw new \InvalidArgumentException('Payment data object should be provided'); |
||
35 | } |
||
36 | $result = []; |
||
37 | $paymentDO = $buildSubject['payment']; |
||
38 | $payment = $paymentDO->getPayment(); |
||
39 | if ($payment->getMethod() === 'moip_magento2_cc') { |
||
40 | if (!empty($data[$payment->getAdditionalInformation(VaultConfigProvider::IS_ACTIVE_CODE)])) { |
||
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
|
|||
41 | $result[self::OPTIONS] = [ |
||
42 | self::STORE_IN_VAULT_ON_SUCCESS => true, |
||
43 | ]; |
||
44 | } |
||
45 | } |
||
46 | |||
47 | return $result; |
||
48 | } |
||
49 | } |
||
50 |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths