CheckoutRestApiConfig   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 86
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 22
dl 0
loc 86
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A isAddressesMappedToAttributes() 0 3 1
A isShipmentMethodsMappedToAttributes() 0 3 1
A isPaymentProvidersMappedToAttributes() 0 3 1
A getRequiredCustomerRequestDataForGuestCheckout() 0 5 1
A getPaymentProviderMethodToStateMachineMapping() 0 5 1
1
<?php
2
3
/**
4
 * This file is part of the Spryker Commerce OS.
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
declare(strict_types = 1);
9
10
namespace Pyz\Glue\CheckoutRestApi;
11
12
use Generated\Shared\Transfer\RestCustomerTransfer;
13
use Spryker\Glue\CheckoutRestApi\CheckoutRestApiConfig as SprykerCheckoutRestApiConfig;
14
15
class CheckoutRestApiConfig extends SprykerCheckoutRestApiConfig
16
{
17
    /**
18
     * @var array<string, array<string>>
19
     */
20
    protected const PAYMENT_METHOD_REQUIRED_FIELDS = [
21
        'dummyPaymentCreditCard' => [
22
            'dummyPaymentCreditCard.cardType',
23
            'dummyPaymentCreditCard.cardNumber',
24
            'dummyPaymentCreditCard.nameOnCard',
25
            'dummyPaymentCreditCard.cardExpiresMonth',
26
            'dummyPaymentCreditCard.cardExpiresYear',
27
            'dummyPaymentCreditCard.cardSecurityCode',
28
        ],
29
    ];
30
31
    /**
32
     * @uses \Spryker\Shared\DummyPayment\DummyPaymentConfig::PROVIDER_NAME
33
     *
34
     * @var string
35
     */
36
    protected const DUMMY_PAYMENT_PROVIDER_NAME = 'DummyPayment';
37
38
    /**
39
     * @uses \Spryker\Shared\DummyPayment\DummyPaymentConfig::PAYMENT_METHOD_NAME_CREDIT_CARD
40
     *
41
     * @var string
42
     */
43
    protected const DUMMY_PAYMENT_PAYMENT_METHOD_NAME_CREDIT_CARD = 'Credit Card';
44
45
    /**
46
     * @uses \Spryker\Shared\DummyPayment\DummyPaymentConfig::PAYMENT_METHOD_CREDIT_CARD
47
     *
48
     * @var string
49
     */
50
    protected const PAYMENT_METHOD_CREDIT_CARD = 'dummyPaymentCreditCard';
51
52
    /**
53
     * @var bool
54
     */
55
    protected const IS_PAYMENT_PROVIDER_METHOD_TO_STATE_MACHINE_MAPPING_ENABLED = false;
56
57
    /**
58
     * @return array<array<string>>
59
     */
60
    public function getPaymentProviderMethodToStateMachineMapping(): array
61
    {
62
        return [
63
            static::DUMMY_PAYMENT_PROVIDER_NAME => [
64
                static::DUMMY_PAYMENT_PAYMENT_METHOD_NAME_CREDIT_CARD => static::PAYMENT_METHOD_CREDIT_CARD,
65
            ],
66
        ];
67
    }
68
69
    /**
70
     * @return bool
71
     */
72
    public function isShipmentMethodsMappedToAttributes(): bool
73
    {
74
        return false;
75
    }
76
77
    /**
78
     * @return bool
79
     */
80
    public function isPaymentProvidersMappedToAttributes(): bool
81
    {
82
        return false;
83
    }
84
85
    /**
86
     * @return bool
87
     */
88
    public function isAddressesMappedToAttributes(): bool
89
    {
90
        return false;
91
    }
92
93
    /**
94
     * @return list<string>
95
     */
96
    public function getRequiredCustomerRequestDataForGuestCheckout(): array
97
    {
98
        return array_merge(parent::getRequiredCustomerRequestDataForGuestCheckout(), [
0 ignored issues
show
Bug Best Practice introduced by
The expression return array_merge(paren...erTransfer::LAST_NAME)) returns the type array which is incompatible with the documented return type Pyz\Glue\CheckoutRestApi\list.
Loading history...
99
            RestCustomerTransfer::FIRST_NAME,
100
            RestCustomerTransfer::LAST_NAME,
101
        ]);
102
    }
103
}
104