HeidelpayCreditCardHandlerPlugin::addToDataClass()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
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\Plugin;
9
10
use Generated\Shared\Transfer\QuoteTransfer;
11
use Spryker\Shared\Kernel\Transfer\AbstractTransfer;
12
use Spryker\Yves\Kernel\AbstractPlugin;
13
use Spryker\Yves\StepEngine\Dependency\Plugin\Handler\StepHandlerPluginInterface;
14
use Symfony\Component\HttpFoundation\Request;
15
16
/**
17
 * @method \SprykerEco\Yves\Heidelpay\HeidelpayFactory getFactory()
18
 */
19
class HeidelpayCreditCardHandlerPlugin extends AbstractPlugin implements StepHandlerPluginInterface
20
{
21
    /**
22
     * {@inheritdoc}
23
     *  - Expands QuoteTransfer with CreditCard payment method transfer.
24
     *  - Expands QuoteTransfer with registered credit cards.
25
     *
26
     * @api
27
     *
28
     * @param \Symfony\Component\HttpFoundation\Request $request
29
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
30
     *
31
     * @return \Generated\Shared\Transfer\QuoteTransfer
32
     */
33
    public function addToDataClass(Request $request, AbstractTransfer $quoteTransfer): QuoteTransfer
34
    {
35
        return $this->getFactory()
36
            ->createHeidelpayCreditCardHandler()
37
            ->addPaymentToQuote($quoteTransfer);
38
    }
39
}
40