Passed
Pull Request — master (#23)
by Volodymyr
48:37
created

BancontactOnlineTransferSubForm   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 41
c 0
b 0
f 0
wmc 3
lcom 0
cbo 2
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A getPropertyPath() 0 4 1
A addOnlineBankTransferType() 0 13 1
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Yves\Payone\Form;
9
10
use Generated\Shared\Transfer\PaymentTransfer;
11
use SprykerEco\Shared\Payone\PayoneApiConstants;
12
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
13
use Symfony\Component\Form\FormBuilderInterface;
14
15
class BancontactOnlineTransferSubForm extends OnlineTransferSubForm
16
{
17
    public const PAYMENT_METHOD = 'bancontact_online_transfer';
18
    public const OPTION_BANK_COUNTRIES = 'bancontact online transfer bank countries';
19
20
    /**
21
     * @return string
22
     */
23
    public function getName(): string
24
    {
25
        return PaymentTransfer::PAYONE_BANCONTACT_ONLINE_TRANSFER;
26
    }
27
28
    /**
29
     * @return string
30
     */
31
    public function getPropertyPath(): string
32
    {
33
        return PaymentTransfer::PAYONE_BANCONTACT_ONLINE_TRANSFER;
34
    }
35
36
    /**
37
     * @param \Symfony\Component\Form\FormBuilderInterface $builder
38
     * @param array $options
39
     *
40
     * @return $this
41
     */
42
    public function addOnlineBankTransferType(FormBuilderInterface $builder, array $options): self
43
    {
44
        $builder->add(
45
            static::FIELD_ONLINE_BANK_TRANSFER_TYPE,
46
            HiddenType::class,
47
            [
48
                'label' => false,
49
                'data' => PayoneApiConstants::ONLINE_BANK_TRANSFER_TYPE_BANCONTACT,
50
            ]
51
        );
52
53
        return $this;
54
    }
55
}
56