SofortMapper   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 10
c 1
b 0
f 0
dl 0
loc 23
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createTransferWithUnencryptedValues() 0 16 1
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Yves\Computop\Mapper\Init\PostPlace;
9
10
use Generated\Shared\Transfer\ComputopSofortPaymentTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...opSofortPaymentTransfer 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\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...
12
use Spryker\Yves\Router\Router\Router;
13
use SprykerEco\Shared\Computop\ComputopConfig;
14
use SprykerEco\Yves\Computop\Mapper\Init\AbstractMapper;
15
use SprykerEco\Yves\Computop\Plugin\Router\ComputopRouteProviderPlugin;
16
17
class SofortMapper extends AbstractMapper
18
{
19
    /**
20
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
21
     *
22
     * @return \Generated\Shared\Transfer\ComputopSofortPaymentTransfer
23
     */
24
    protected function createTransferWithUnencryptedValues(QuoteTransfer $quoteTransfer)
25
    {
26
        $computopPaymentTransfer = new ComputopSofortPaymentTransfer();
27
28
        $computopPaymentTransfer->setCapture(
29
            $this->getCaptureType(ComputopConfig::PAYMENT_METHOD_SOFORT)
30
        );
31
        $computopPaymentTransfer->setTransId($this->generateTransId($quoteTransfer));
32
        $computopPaymentTransfer->setUrlSuccess(
33
            $this->router->generate(ComputopRouteProviderPlugin::SOFORT_SUCCESS, [], Router::ABSOLUTE_URL)
34
        );
35
        $computopPaymentTransfer->setOrderDesc(
36
            $this->computopApiService->getDescriptionValue($quoteTransfer->getItems()->getArrayCopy())
37
        );
38
39
        return $computopPaymentTransfer;
40
    }
41
}
42