Passed
Push — feature/ECO-807-travis-ci ( 7b7181...a6fc91 )
by Andrey
03:17
created

QuoteUpdaterAbstract::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Apache OSL-2
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\Amazonpay\Business\Quote;
9
10
use Generated\Shared\Transfer\AmazonpayCallTransfer;
11
use Generated\Shared\Transfer\QuoteTransfer;
12
use SprykerEco\Zed\Amazonpay\Business\Api\Adapter\CallAdapterInterface;
13
14
abstract class QuoteUpdaterAbstract implements QuoteUpdaterInterface
15
{
16
17
    /**
18
     * @var \SprykerEco\Zed\Amazonpay\Business\Api\Adapter\CallAdapterInterface
19
     */
20
    protected $executionAdapter;
21
22
    /**
23
     * @param \SprykerEco\Zed\Amazonpay\Business\Api\Adapter\CallAdapterInterface $executionAdapter
24
     */
25
    public function __construct(
26
        CallAdapterInterface $executionAdapter
27
    ) {
28
        $this->executionAdapter = $executionAdapter;
29
    }
30
31
    /**
32
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
33
     *
34
     * @return \Generated\Shared\Transfer\AmazonpayCallTransfer
35
     */
36
    protected function convertQuoteTransferToAmazonPayTransfer(QuoteTransfer $quoteTransfer)
37
    {
38
        $amazonpayCallTransfer = new AmazonpayCallTransfer();
39
        $amazonpayCallTransfer->setAmazonpayPayment($quoteTransfer->getAmazonpayPayment())
40
            ->setRequestedAmount($quoteTransfer->getTotals()->getGrandTotal());
41
42
        return $amazonpayCallTransfer;
43
    }
44
45
}
46