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

ShippingAddressDataQuoteUpdater::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 6
rs 9.4285
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\QuoteTransfer;
11
12
class ShippingAddressDataQuoteUpdater extends QuoteUpdaterAbstract
13
{
14
15
    /**
16
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
17
     *
18
     * @return \Generated\Shared\Transfer\QuoteTransfer
19
     */
20
    public function update(QuoteTransfer $quoteTransfer)
21
    {
22
        $amazonCallTransfer = $this->convertQuoteTransferToAmazonPayTransfer($quoteTransfer);
23
        $apiResponse = $this->executionAdapter->call($amazonCallTransfer);
24
25
        if ($apiResponse->getHeader()->getIsSuccess()) {
26
            $quoteTransfer->setShippingAddress($apiResponse->getShippingAddress());
27
        }
28
29
        return $quoteTransfer;
30
    }
31
32
}
33