Passed
Push — feature/eco-3656/eco-3658-fix-... ( 54b10f...cebc8b )
by
unknown
05:12
created

ComputopConfig   A

Complexity

Total Complexity 21

Size/Duplication

Total Lines 219
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 21
eloc 26
c 1
b 0
f 0
dl 0
loc 219
rs 10

21 Methods

Rating   Name   Duplication   Size   Complexity  
A getBaseUrlSsl() 0 3 1
A getPayNowTxType() 0 3 1
A getEtiId() 0 3 1
A getEasyCreditInitActionUrl() 0 3 1
A getPaydirektShopKey() 0 3 1
A getCreditCardInitActionUrl() 0 3 1
A getMerchantId() 0 3 1
A getPayNowInitActionUrl() 0 3 1
A getMaxOrderDescriptionItemsForPayPalPaymentPage() 0 3 1
A getEasyCreditSuccessAction() 0 3 1
A getCreditCardTemplateEnabled() 0 3 1
A getCallbackFailureRedirectPath() 0 3 1
A getPaymentMethodsWithoutOrderCall() 0 3 1
A getBlowfishPassword() 0 3 1
A getCallbackSuccessCaptureRedirectPath() 0 3 1
A getPaymentMethodsCaptureTypes() 0 3 1
A getPaypalInitActionUrl() 0 3 1
A getCreditCardTxType() 0 3 1
A getCallbackSuccessOrderRedirectPath() 0 3 1
A getDirectDebitInitActionUrl() 0 3 1
A getPayPalTxType() 0 3 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\Computop;
9
10
use Spryker\Shared\Application\ApplicationConstants;
11
use Spryker\Yves\Kernel\AbstractBundleConfig;
12
use SprykerEco\Shared\Computop\ComputopConfig as SharedComputopConfig;
13
use SprykerEco\Shared\Computop\ComputopConstants;
14
use SprykerEco\Shared\ComputopApi\ComputopApiConstants;
15
16
class ComputopConfig extends AbstractBundleConfig implements ComputopConfigInterface
17
{
18
    public const FINISH_AUTH = 'Y'; //Only with ETM: Transmit value <Y> in order to stop the renewal of guaranteed authorizations and rest amounts after partial captures.
19
    public const RESPONSE_ENCRYPT_TYPE = 'encrypt';
20
21
    protected const EASY_CREDIT_SUCCESS_ACTION = 'checkout-summary';
22
    protected const PAYPAL_MAX_ORDER_DESCRIPTION_ITEMS = 98;
23
24
25
    /**
26
     * @api
27
     *
28
     * @return string
29
     */
30
    public function getEasyCreditSuccessAction(): string
31
    {
32
        return static::EASY_CREDIT_SUCCESS_ACTION;
33
    }
34
35
    /**
36
     * @api
37
     *
38
     * @return string
39
     */
40
    public function getCallbackSuccessOrderRedirectPath(): string
41
    {
42
        return 'checkout-summary';
43
    }
44
45
    /**
46
     * @api
47
     *
48
     * @return string
49
     */
50
    public function getCallbackSuccessCaptureRedirectPath(): string
51
    {
52
        return 'checkout-success';
53
    }
54
55
    /**
56
     * @api
57
     *
58
     * @return string
59
     */
60
    public function getCallbackFailureRedirectPath(): string
61
    {
62
        return 'checkout-payment';
63
    }
64
65
    /**
66
     * @api
67
     *
68
     * @return string[]
69
     */
70
    public function getPaymentMethodsWithoutOrderCall(): array
71
    {
72
        return $this->get(ComputopConstants::PAYMENT_METHODS_WITHOUT_ORDER_CALL);
73
    }
74
75
    /**
76
     * @api
77
     *
78
     * @return string
79
     */
80
    public function getBaseUrlSsl(): string
81
    {
82
        return $this->get(ApplicationConstants::BASE_URL_SSL_YVES);
0 ignored issues
show
Deprecated Code introduced by
The constant Spryker\Shared\Applicati...ants::BASE_URL_SSL_YVES has been deprecated: Use {@link \Spryker\Shared\Application\ApplicationConstants::BASE_URL_YVES} instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

82
        return $this->get(/** @scrutinizer ignore-deprecated */ ApplicationConstants::BASE_URL_SSL_YVES);

This class constant has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the constant will be removed from the class and what other constant to use instead.

Loading history...
83
    }
84
85
    /**
86
     * @api
87
     *
88
     * @return string
89
     */
90
    public function getMerchantId(): string
91
    {
92
        return $this->get(ComputopApiConstants::MERCHANT_ID);
93
    }
94
95
    /**
96
     * @api
97
     *
98
     * @return string
99
     */
100
    public function getPaydirektShopKey(): string
101
    {
102
        return $this->get(ComputopConstants::PAYDIREKT_SHOP_KEY);
103
    }
104
105
    /**
106
     * @api
107
     *
108
     * @return string
109
     */
110
    public function getBlowfishPassword(): string
111
    {
112
        return $this->get(ComputopApiConstants::BLOWFISH_PASSWORD);
113
    }
114
115
    /**
116
     * @api
117
     *
118
     * @return string
119
     */
120
    public function getPaypalInitActionUrl(): string
121
    {
122
        return $this->get(ComputopConstants::PAYPAL_INIT_ACTION);
123
    }
124
125
    /**
126
     * @api
127
     *
128
     * @return string
129
     */
130
    public function getDirectDebitInitActionUrl(): string
131
    {
132
        return $this->get(ComputopConstants::DIRECT_DEBIT_INIT_ACTION);
133
    }
134
135
    /**
136
     * @api
137
     *
138
     * @return string
139
     */
140
    public function getCreditCardInitActionUrl(): string
141
    {
142
        return $this->get(ComputopConstants::CREDIT_CARD_INIT_ACTION);
143
    }
144
145
    /**
146
     * @api
147
     *
148
     * @return string
149
     */
150
    public function getPayNowInitActionUrl(): string
151
    {
152
        return $this->get(ComputopConstants::PAY_NOW_INIT_ACTION);
153
    }
154
155
    /**
156
     * @api
157
     *
158
     * @return string
159
     */
160
    public function getEasyCreditInitActionUrl(): string
161
    {
162
        return $this->get(ComputopConstants::EASY_CREDIT_INIT_ACTION);
163
    }
164
165
    /**
166
     * @api
167
     *
168
     * @return bool
169
     */
170
    public function getCreditCardTemplateEnabled(): bool
171
    {
172
        return $this->get(ComputopConstants::CREDIT_CARD_TEMPLATE_ENABLED);
173
    }
174
175
    /**
176
     * @api
177
     *
178
     * @return string[]
179
     */
180
    public function getPaymentMethodsCaptureTypes(): array
181
    {
182
        return $this->get(ComputopApiConstants::PAYMENT_METHODS_CAPTURE_TYPES);
183
    }
184
185
    /**
186
     * @api
187
     *
188
     * @return string
189
     */
190
    public function getCreditCardTxType(): string
191
    {
192
        return $this->get(ComputopConstants::CREDIT_CARD_TX_TYPE);
193
    }
194
195
    /**
196
     * @api
197
     *
198
     * @return string
199
     */
200
    public function getPayNowTxType(): string
201
    {
202
        return $this->get(ComputopConstants::PAY_NOW_TX_TYPE);
203
    }
204
205
    /**
206
     * @api
207
     *
208
     * @return string
209
     */
210
    public function getPayPalTxType(): string
211
    {
212
        return $this->get(ComputopConstants::PAY_PAL_TX_TYPE);
213
    }
214
215
    /**
216
     * @api
217
     *
218
     * @return string
219
     */
220
    public function getEtiId(): string
221
    {
222
        return SharedComputopConfig::COMPUTOP_MODULE_VERSION;
223
    }
224
225
    /**
226
     * {@inheriDoc}
227
     *
228
     * @api
229
     *
230
     * @return int
231
     */
232
    public function getMaxOrderDescriptionItemsForPayPalPaymentPage(): int
233
    {
234
        return static::PAYPAL_MAX_ORDER_DESCRIPTION_ITEMS;
235
    }
236
}
237