HeidelpayHandler   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 6
dl 0
loc 15
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A addPaymentToQuote() 0 8 1
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