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

BancontactOnlineTransferSubForm::getPropertyPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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