HeidelpayHandler::addPaymentToQuote()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 1
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Yves\Heidelpay\Handler;
9
10
use Generated\Shared\Transfer\QuoteTransfer;
11
use SprykerEco\Shared\Heidelpay\HeidelpayConfig;
12
13
class HeidelpayHandler implements HeidelpayHandlerInterface
14
{
15
    /**
16
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
17
     *
18
     * @return \Generated\Shared\Transfer\QuoteTransfer
19
     */
20
    public function addPaymentToQuote(QuoteTransfer $quoteTransfer): QuoteTransfer
21
    {
22
        $paymentSelection = $quoteTransfer->getPayment()->getPaymentSelection();
23
        $quoteTransfer->getPayment()
24
            ->setPaymentProvider(HeidelpayConfig::PROVIDER_NAME)
25
            ->setPaymentMethod($paymentSelection);
26
27
        return $quoteTransfer;
28
    }
29
}
30