EpsOnlineTransferDataProvider::getOptions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
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\DataProvider;
9
10
use Generated\Shared\Transfer\PaymentTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\PaymentTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Generated\Shared\Transfer\PayonePaymentTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\PayonePaymentTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use Spryker\Shared\Kernel\Transfer\AbstractTransfer;
13
use Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface;
14
use SprykerEco\Yves\Payone\Form\EpsOnlineTransferSubForm;
15
16
class EpsOnlineTransferDataProvider implements StepEngineFormDataProviderInterface
17
{
18
    /**
19
     * @param \Spryker\Shared\Kernel\Transfer\AbstractTransfer|\Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\QuoteTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
20
     *
21
     * @return \Spryker\Shared\Kernel\Transfer\AbstractTransfer
22
     */
23
    public function getData(AbstractTransfer $quoteTransfer)
24
    {
25
        /** @var \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer */
26
        if ($quoteTransfer->getPayment() === null) {
27
            $paymentTransfer = new PaymentTransfer();
28
            $paymentTransfer->setPayone(new PayonePaymentTransfer());
29
            $quoteTransfer->setPayment($paymentTransfer);
30
        }
31
32
        return $quoteTransfer;
33
    }
34
35
    /**
36
     * @param \Spryker\Shared\Kernel\Transfer\AbstractTransfer $quoteTransfer
37
     *
38
     * @return array
39
     */
40
    public function getOptions(AbstractTransfer $quoteTransfer)
41
    {
42
        return [
43
            EpsOnlineTransferSubForm::OPTION_BANK_COUNTRIES => $this->getBankCountries(),
44
            EpsOnlineTransferSubForm::OPTION_BANK_GROUP_TYPES => $this->getBankGroupTypes(),
45
        ];
46
    }
47
48
    /**
49
     * @return array
50
     */
51
    protected function getBankCountries()
52
    {
53
        return [
54
            'AT' => 'Austria',
55
        ];
56
    }
57
58
    /**
59
     * @return array
60
     */
61
    protected function getBankGroupTypes()
62
    {
63
        return [
64
            'Commercial credit cooperatives (Volksbank)' => 'ARZ_OVB',
65
            'Bank for doctors and independent professions' => 'ARZ_BAF',
66
            'Hypo state bank Lower Austria' => 'ARZ_NLH',
67
            'Hypo state bank Voralberg' => 'ARZ_VLH',
68
            'Bankhaus Carl Spängler & Co. AG' => 'ARZ_BCS',
69
            'Hypo bank Tyrol' => 'ARZ_HTB',
70
            'Hypo Alpe Adria' => 'ARZ_HAA',
71
            'Investkredit bank' => 'ARZ_IKB',
72
            'Österreichische Apotheker' => 'ARZ_OAB',
73
            'Immobank' => 'ARZ_IMB',
74
            'Gärtnerbank' => 'ARZ_GRB',
75
            'HYPO Investment bank' => 'ARZ_HIB',
76
            'Bank Austria' => 'BA_AUS',
77
            'BAWAG' => 'BAWAG_BWG',
78
            'PSK Bank' => 'BAWAG_PSK',
79
            'easybank' => 'BAWAG_ESY',
80
            'Sparda Bank' => 'BAWAG_SPD',
81
            'Erste Bank' => 'SPARDAT_EBS',
82
            'Bank Burgenland' => 'SPARDAT_BBL',
83
            'Raiffeisen bank' => 'RAC_RAC',
84
            'Hypo bank Upper Austria' => 'HRAC_OOS',
85
            'Hypo bank Salzburg' => 'HRAC_SLB',
86
            'Hypo bank Styria' => 'HRAC_STM',
87
            'Bankhaus Schelhammer' => 'EPS_SCHEL',
88
            'Oberbank AG' => 'EPS_OBAG',
89
            'Schoellerbank AG' => 'EPS_SCHOELLER',
90
            'Sparda-Bank Linz' => 'EPS_SPDLI',
91
            'Sparda-Bank Villach' => 'EPS_SPDVI',
92
            'VR-Bank Brunau' => 'EPS_VRBB',
93
        ];
94
    }
95
}
96