Passed
Pull Request — feature/eco-3623-payone-pay-u-... (#41)
by Roman
30:51
created

ComputopConfig::getSalutationMap()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 7
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\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
    /**
19
     * @var string
20
     */
21
    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.
22
23
    /**
24
     * @var string
25
     */
26
    public const RESPONSE_ENCRYPT_TYPE = 'encrypt';
27
28
    /**
29
     * @var string
30
     */
31
    protected const EASY_CREDIT_SUCCESS_ACTION = 'checkout-summary';
32
33
    /**
34
     * @api
35
     *
36
     * @return string
37
     */
38
    public function getEasyCreditSuccessAction(): string
39
    {
40
        return static::EASY_CREDIT_SUCCESS_ACTION;
41
    }
42
43
    /**
44
     * @api
45
     *
46
     * @return string
47
     */
48
    public function getCallbackSuccessOrderRedirectPath(): string
49
    {
50
        return 'checkout-summary';
51
    }
52
53
    /**
54
     * @api
55
     *
56
     * @return string
57
     */
58
    public function getCallbackSuccessCaptureRedirectPath(): string
59
    {
60
        return 'checkout-success';
61
    }
62
63
    /**
64
     * @api
65
     *
66
     * @return string
67
     */
68
    public function getCallbackFailureRedirectPath(): string
69
    {
70
        return 'checkout-payment';
71
    }
72
73
    /**
74
     * @api
75
     *
76
     * @return string[]
77
     */
78
    public function getPaymentMethodsWithoutOrderCall(): array
79
    {
80
        return $this->get(ComputopConstants::PAYMENT_METHODS_WITHOUT_ORDER_CALL);
81
    }
82
83
    /**
84
     * @api
85
     *
86
     * @return string
87
     */
88
    public function getBaseUrlSsl(): string
89
    {
90
        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

90
        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...
91
    }
92
93
    /**
94
     * @api
95
     *
96
     * @return string
97
     */
98
    public function getMerchantId(): string
99
    {
100
        return $this->get(ComputopApiConstants::MERCHANT_ID);
101
    }
102
103
    /**
104
     * @api
105
     *
106
     * @return string
107
     */
108
    public function getPaydirektShopKey(): string
109
    {
110
        return $this->get(ComputopConstants::PAYDIREKT_SHOP_KEY);
111
    }
112
113
    /**
114
     * @api
115
     *
116
     * @return string
117
     */
118
    public function getBlowfishPassword(): string
119
    {
120
        return $this->get(ComputopApiConstants::BLOWFISH_PASSWORD);
121
    }
122
123
    /**
124
     * @api
125
     *
126
     * @return string
127
     */
128
    public function getPaypalInitActionUrl(): string
129
    {
130
        return $this->get(ComputopConstants::PAYPAL_INIT_ACTION);
131
    }
132
133
    /**
134
     * @api
135
     *
136
     * @return string
137
     */
138
    public function getDirectDebitInitActionUrl(): string
139
    {
140
        return $this->get(ComputopConstants::DIRECT_DEBIT_INIT_ACTION);
141
    }
142
143
    /**
144
     * @api
145
     *
146
     * @return string
147
     */
148
    public function getCreditCardInitActionUrl(): string
149
    {
150
        return $this->get(ComputopConstants::CREDIT_CARD_INIT_ACTION);
151
    }
152
153
    /**
154
     * @api
155
     *
156
     * @return string
157
     */
158
    public function getPayNowInitActionUrl(): string
159
    {
160
        return $this->get(ComputopConstants::PAY_NOW_INIT_ACTION);
161
    }
162
163
    /**
164
     * @api
165
     *
166
     * @return string
167
     */
168
    public function getEasyCreditInitActionUrl(): string
169
    {
170
        return $this->get(ComputopConstants::EASY_CREDIT_INIT_ACTION);
171
    }
172
173
    /**
174
     * Specification:
175
     * - Returns PayU CEE Single init action URL.
176
     *
177
     * @api
178
     *
179
     * @return string
180
     */
181
    public function getPayuCeeSingleInitActionUrl(): string
182
    {
183
        return $this->get(ComputopConstants::PAYU_CEE_SINGLE_INIT_ACTION);
184
    }
185
186
    /**
187
     * @api
188
     *
189
     * @return bool
190
     */
191
    public function getCreditCardTemplateEnabled(): bool
192
    {
193
        return $this->get(ComputopConstants::CREDIT_CARD_TEMPLATE_ENABLED);
194
    }
195
196
    /**
197
     * @api
198
     *
199
     * @return string[]
200
     */
201
    public function getPaymentMethodsCaptureTypes(): array
202
    {
203
        return $this->get(ComputopApiConstants::PAYMENT_METHODS_CAPTURE_TYPES);
204
    }
205
206
    /**
207
     * @api
208
     *
209
     * @return string
210
     */
211
    public function getCreditCardTxType(): string
212
    {
213
        return $this->get(ComputopConstants::CREDIT_CARD_TX_TYPE);
214
    }
215
216
    /**
217
     * @api
218
     *
219
     * @return string
220
     */
221
    public function getPayNowTxType(): string
222
    {
223
        return $this->get(ComputopConstants::PAY_NOW_TX_TYPE);
224
    }
225
226
    /**
227
     * @api
228
     *
229
     * @return string
230
     */
231
    public function getPayPalTxType(): string
232
    {
233
        return $this->get(ComputopConstants::PAY_PAL_TX_TYPE);
234
    }
235
236
    /**
237
     * @api
238
     *
239
     * @return string
240
     */
241
    public function getEtiId(): string
242
    {
243
        return SharedComputopConfig::COMPUTOP_MODULE_VERSION;
244
    }
245
246
    /**
247
     * @return array<string, string>
248
     */
249
    public function getSalutationMap(): array
250
    {
251
        return [
252
            'Mr' => 'Mr',
253
            'Mrs' => 'Mrs',
254
            'Ms' => 'Miss',
255
            'Dr' => 'Mr',
256
        ];
257
    }
258
}
259