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
|
|
|
* @var int |
35
|
|
|
*/ |
36
|
|
|
protected const PAYPAL_MAX_ORDER_DESCRIPTION_ITEMS = 98; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var array<string, string> |
40
|
|
|
*/ |
41
|
|
|
protected const SALUTATION_MAP = [ |
42
|
|
|
'Mr' => 'Mr', |
43
|
|
|
'Mrs' => 'Mrs', |
44
|
|
|
'Ms' => 'Miss', |
45
|
|
|
'Dr' => 'Mr', |
46
|
|
|
]; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @var string |
50
|
|
|
*/ |
51
|
|
|
protected const SALUTATION_DEFAULT = 'Mr'; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @api |
55
|
|
|
* |
56
|
|
|
* @return string |
57
|
|
|
*/ |
58
|
|
|
public function getEasyCreditSuccessAction(): string |
59
|
|
|
{ |
60
|
|
|
return static::EASY_CREDIT_SUCCESS_ACTION; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @api |
65
|
|
|
* |
66
|
|
|
* @return string |
67
|
|
|
*/ |
68
|
|
|
public function getCallbackSuccessOrderRedirectPath(): string |
69
|
|
|
{ |
70
|
|
|
return 'checkout-summary'; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @api |
75
|
|
|
* |
76
|
|
|
* @return string |
77
|
|
|
*/ |
78
|
|
|
public function getCallbackSuccessCaptureRedirectPath(): string |
79
|
|
|
{ |
80
|
|
|
return 'checkout-success'; |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* @api |
85
|
|
|
* |
86
|
|
|
* @return string |
87
|
|
|
*/ |
88
|
|
|
public function getCallbackFailureRedirectPath(): string |
89
|
|
|
{ |
90
|
|
|
return 'checkout-payment'; |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* @api |
95
|
|
|
* |
96
|
|
|
* @return array<string> |
97
|
|
|
*/ |
98
|
|
|
public function getPaymentMethodsWithoutOrderCall(): array |
99
|
|
|
{ |
100
|
|
|
return $this->get(ComputopConstants::PAYMENT_METHODS_WITHOUT_ORDER_CALL); |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* @api |
105
|
|
|
* |
106
|
|
|
* @return string |
107
|
|
|
*/ |
108
|
|
|
public function getBaseUrlSsl(): string |
109
|
|
|
{ |
110
|
|
|
return $this->get(ApplicationConstants::BASE_URL_SSL_YVES); |
|
|
|
|
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* @api |
115
|
|
|
* |
116
|
|
|
* @return string |
117
|
|
|
*/ |
118
|
|
|
public function getMerchantId(): string |
119
|
|
|
{ |
120
|
|
|
return $this->get(ComputopApiConstants::MERCHANT_ID); |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* @api |
125
|
|
|
* |
126
|
|
|
* @return string |
127
|
|
|
*/ |
128
|
|
|
public function getPaydirektShopKey(): string |
129
|
|
|
{ |
130
|
|
|
return $this->get(ComputopConstants::PAYDIREKT_SHOP_KEY); |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
/** |
134
|
|
|
* @api |
135
|
|
|
* |
136
|
|
|
* @return string |
137
|
|
|
*/ |
138
|
|
|
public function getBlowfishPassword(): string |
139
|
|
|
{ |
140
|
|
|
return $this->get(ComputopApiConstants::BLOWFISH_PASSWORD); |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* @api |
145
|
|
|
* |
146
|
|
|
* @return string |
147
|
|
|
*/ |
148
|
|
|
public function getPaypalInitActionUrl(): string |
149
|
|
|
{ |
150
|
|
|
return $this->get(ComputopConstants::PAYPAL_INIT_ACTION); |
151
|
|
|
} |
152
|
|
|
|
153
|
|
|
/** |
154
|
|
|
* @api |
155
|
|
|
* |
156
|
|
|
* @return string |
157
|
|
|
*/ |
158
|
|
|
public function getDirectDebitInitActionUrl(): string |
159
|
|
|
{ |
160
|
|
|
return $this->get(ComputopConstants::DIRECT_DEBIT_INIT_ACTION); |
161
|
|
|
} |
162
|
|
|
|
163
|
|
|
/** |
164
|
|
|
* @api |
165
|
|
|
* |
166
|
|
|
* @return string |
167
|
|
|
*/ |
168
|
|
|
public function getCreditCardInitActionUrl(): string |
169
|
|
|
{ |
170
|
|
|
return $this->get(ComputopConstants::CREDIT_CARD_INIT_ACTION); |
171
|
|
|
} |
172
|
|
|
|
173
|
|
|
/** |
174
|
|
|
* @api |
175
|
|
|
* |
176
|
|
|
* @return string |
177
|
|
|
*/ |
178
|
|
|
public function getPayNowInitActionUrl(): string |
179
|
|
|
{ |
180
|
|
|
return $this->get(ComputopConstants::PAY_NOW_INIT_ACTION); |
181
|
|
|
} |
182
|
|
|
|
183
|
|
|
/** |
184
|
|
|
* @api |
185
|
|
|
* |
186
|
|
|
* @return string |
187
|
|
|
*/ |
188
|
|
|
public function getEasyCreditInitActionUrl(): string |
189
|
|
|
{ |
190
|
|
|
return $this->get(ComputopConstants::EASY_CREDIT_INIT_ACTION); |
191
|
|
|
} |
192
|
|
|
|
193
|
|
|
/** |
194
|
|
|
* Specification: |
195
|
|
|
* - Returns PayU CEE Single init action URL. |
196
|
|
|
* |
197
|
|
|
* @api |
198
|
|
|
* |
199
|
|
|
* @return string |
200
|
|
|
*/ |
201
|
|
|
public function getPayuCeeSingleInitActionUrl(): string |
202
|
|
|
{ |
203
|
|
|
return $this->get(ComputopConstants::PAYU_CEE_SINGLE_INIT_ACTION); |
204
|
|
|
} |
205
|
|
|
|
206
|
|
|
/** |
207
|
|
|
* @api |
208
|
|
|
* |
209
|
|
|
* @return bool |
210
|
|
|
*/ |
211
|
|
|
public function getCreditCardTemplateEnabled(): bool |
212
|
|
|
{ |
213
|
|
|
return $this->get(ComputopConstants::CREDIT_CARD_TEMPLATE_ENABLED); |
214
|
|
|
} |
215
|
|
|
|
216
|
|
|
/** |
217
|
|
|
* @api |
218
|
|
|
* |
219
|
|
|
* @return array<string> |
220
|
|
|
*/ |
221
|
|
|
public function getPaymentMethodsCaptureTypes(): array |
222
|
|
|
{ |
223
|
|
|
return $this->get(ComputopApiConstants::PAYMENT_METHODS_CAPTURE_TYPES); |
224
|
|
|
} |
225
|
|
|
|
226
|
|
|
/** |
227
|
|
|
* @api |
228
|
|
|
* |
229
|
|
|
* @return string |
230
|
|
|
*/ |
231
|
|
|
public function getCreditCardTxType(): string |
232
|
|
|
{ |
233
|
|
|
return $this->get(ComputopConstants::CREDIT_CARD_TX_TYPE); |
234
|
|
|
} |
235
|
|
|
|
236
|
|
|
/** |
237
|
|
|
* @api |
238
|
|
|
* |
239
|
|
|
* @return string |
240
|
|
|
*/ |
241
|
|
|
public function getPayNowTxType(): string |
242
|
|
|
{ |
243
|
|
|
return $this->get(ComputopConstants::PAY_NOW_TX_TYPE); |
244
|
|
|
} |
245
|
|
|
|
246
|
|
|
/** |
247
|
|
|
* @api |
248
|
|
|
* |
249
|
|
|
* @return string |
250
|
|
|
*/ |
251
|
|
|
public function getPayPalTxType(): string |
252
|
|
|
{ |
253
|
|
|
return $this->get(ComputopConstants::PAY_PAL_TX_TYPE); |
254
|
|
|
} |
255
|
|
|
|
256
|
|
|
/** |
257
|
|
|
* @api |
258
|
|
|
* |
259
|
|
|
* @return string |
260
|
|
|
*/ |
261
|
|
|
public function getEtiId(): string |
262
|
|
|
{ |
263
|
|
|
return SharedComputopConfig::COMPUTOP_MODULE_VERSION; |
264
|
|
|
} |
265
|
|
|
|
266
|
|
|
/** |
267
|
|
|
* {@inheriDoc} |
268
|
|
|
* |
269
|
|
|
* @api |
270
|
|
|
* |
271
|
|
|
* @return int |
272
|
|
|
*/ |
273
|
|
|
public function getMaxOrderDescriptionItemsForPayPalPaymentPage(): int |
274
|
|
|
{ |
275
|
|
|
return static::PAYPAL_MAX_ORDER_DESCRIPTION_ITEMS; |
276
|
|
|
} |
277
|
|
|
|
278
|
|
|
/** |
279
|
|
|
* {@inheriDoc} |
280
|
|
|
* |
281
|
|
|
* @api |
282
|
|
|
* |
283
|
|
|
* @return string |
284
|
|
|
*/ |
285
|
|
|
public function getPayPalMethod(): string |
286
|
|
|
{ |
287
|
|
|
return $this->get(ComputopConstants::PAY_PAL_EXPRESS_PAYPAL_METHOD); |
288
|
|
|
} |
289
|
|
|
|
290
|
|
|
/** |
291
|
|
|
* @api |
292
|
|
|
* |
293
|
|
|
* @return array<string, string> |
294
|
|
|
*/ |
295
|
|
|
public function getSalutationMap(): array |
296
|
|
|
{ |
297
|
|
|
return static::SALUTATION_MAP; |
298
|
|
|
} |
299
|
|
|
|
300
|
|
|
/** |
301
|
|
|
* @api |
302
|
|
|
* |
303
|
|
|
* @return string |
304
|
|
|
*/ |
305
|
|
|
public function getSalutationDefault(): string |
306
|
|
|
{ |
307
|
|
|
return static::SALUTATION_DEFAULT; |
308
|
|
|
} |
309
|
|
|
} |
310
|
|
|
|
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.