1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Copyright © Wirecard Brasil. All rights reserved. |
4
|
|
|
* |
5
|
|
|
* @author Bruno Elisei <[email protected]> |
6
|
|
|
* See COPYING.txt for license details. |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
namespace Moip\Magento2\Model\Ui\Vault\Adminhtml; |
10
|
|
|
|
11
|
|
|
|
12
|
|
|
use Magento\Framework\View\Element\Template; |
|
|
|
|
13
|
|
|
use Magento\Vault\Api\Data\PaymentTokenInterface; |
|
|
|
|
14
|
|
|
use Magento\Vault\Model\Ui\TokenUiComponentInterfaceFactory; |
|
|
|
|
15
|
|
|
use Magento\Vault\Model\Ui\TokenUiComponentProviderInterface; |
|
|
|
|
16
|
|
|
use Moip\Magento2\Model\Ui\ConfigProviderCc; |
17
|
|
|
|
18
|
|
|
class TokenUiComponentProvider implements TokenUiComponentProviderInterface |
19
|
|
|
{ |
20
|
|
|
/** |
21
|
|
|
* @var TokenUiComponentInterfaceFactory |
22
|
|
|
*/ |
23
|
|
|
private $componentFactory; |
24
|
|
|
|
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* TokenUiComponentProvider constructor. |
28
|
|
|
* |
29
|
|
|
* @param TokenUiComponentInterfaceFactory $componentFactory |
30
|
|
|
*/ |
31
|
|
|
public function __construct( |
32
|
|
|
TokenUiComponentInterfaceFactory $componentFactory |
33
|
|
|
) { |
34
|
|
|
$this->componentFactory = $componentFactory; |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @inheritdoc |
39
|
|
|
*/ |
40
|
|
|
public function getComponentForToken(PaymentTokenInterface $paymentToken) |
41
|
|
|
{ |
42
|
|
|
$details = json_decode($paymentToken->getTokenDetails() ?: '{}', true); |
43
|
|
|
$component = $this->componentFactory->create( |
44
|
|
|
[ |
45
|
|
|
'config' => [ |
46
|
|
|
'code' => ConfigProviderCc::VAULT_CODE, |
47
|
|
|
TokenUiComponentProviderInterface::COMPONENT_DETAILS => $details, |
48
|
|
|
TokenUiComponentProviderInterface::COMPONENT_PUBLIC_HASH => $paymentToken->getPublicHash(), |
49
|
|
|
'template' => 'Moip_Magento2::form/vault.phtml' |
50
|
|
|
], |
51
|
|
|
'name' => Template::class |
52
|
|
|
] |
53
|
|
|
); |
54
|
|
|
return $component; |
55
|
|
|
} |
56
|
|
|
} |
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