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
|
|
|
declare(strict_types=1); |
10
|
|
|
|
11
|
|
|
namespace Moip\Magento2\Model; |
12
|
|
|
|
13
|
|
|
use Magento\Quote\Model\QuoteIdMaskFactory; |
|
|
|
|
14
|
|
|
use Moip\Magento2\Api\Data\MoipInterestInterface; |
15
|
|
|
use Moip\Magento2\Api\GuestMoipInterestManagementInterface; |
16
|
|
|
use Moip\Magento2\Api\MoipInterestManagementInterface; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Class MoipInterestManagement - Calc Insterest by Installment. |
20
|
|
|
*/ |
21
|
|
|
class GuestMoipInterestManagement implements GuestMoipInterestManagementInterface |
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* @var \Magento\Quote\Model\QuoteIdMaskFactory |
25
|
|
|
*/ |
26
|
|
|
protected $quoteIdMaskFactory; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var \Magento\Checkout\Api\ShippingInformationManagementInterface |
|
|
|
|
30
|
|
|
*/ |
31
|
|
|
protected $moipInterestInterface; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @param \Magento\Quote\Model\QuoteIdMaskFactory $quoteIdMaskFactory |
35
|
|
|
* @param \Moip\Magento2\Api\MoipInterestManagementInterface $moipInterestInterface |
36
|
|
|
* @codeCoverageIgnore |
37
|
|
|
*/ |
38
|
|
|
public function __construct( |
39
|
|
|
QuoteIdMaskFactory $quoteIdMaskFactory, |
40
|
|
|
MoipInterestManagementInterface $moipInterestInterface |
41
|
|
|
) { |
42
|
|
|
$this->quoteIdMaskFactory = $quoteIdMaskFactory; |
43
|
|
|
$this->moipInterestInterface = $moipInterestInterface; |
|
|
|
|
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* {@inheritDoc} |
48
|
|
|
*/ |
49
|
|
|
public function saveMoipInterest( |
50
|
|
|
$cartId, |
51
|
|
|
MoipInterestInterface $moipInterest |
52
|
|
|
) { |
53
|
|
|
/** @var $quoteIdMask \Magento\Quote\Model\QuoteIdMask */ |
54
|
|
|
$quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id'); |
55
|
|
|
|
56
|
|
|
return $this->moipInterestInterface->saveMoipInterest( |
57
|
|
|
$quoteIdMask->getQuoteId(), |
58
|
|
|
$moipInterest |
59
|
|
|
); |
60
|
|
|
} |
61
|
|
|
} |
62
|
|
|
|
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