|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* MIT License |
|
5
|
|
|
* For full license information, please view the LICENSE file that was distributed with this source code. |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
namespace SprykerEco\Glue\FirstData; |
|
9
|
|
|
|
|
10
|
|
|
use Spryker\Zed\Kernel\AbstractBundleConfig; |
|
11
|
|
|
use SprykerEco\Shared\FirstData\FirstDataConfig as SharedFirstDataConfig; |
|
12
|
|
|
use SprykerEco\Shared\FirstData\FirstDataConstants; |
|
13
|
|
|
|
|
14
|
|
|
class FirstDataConfig extends AbstractBundleConfig |
|
15
|
|
|
{ |
|
16
|
|
|
public const RESPONSE_CODE_INVALID_FIRST_DATA_PAYMENT_OID = '1109'; |
|
17
|
|
|
public const RESPONSE_CODE_INVALID_FIRST_DATA_PAYMENT_TRANSACTION_ID = '1110'; |
|
18
|
|
|
|
|
19
|
|
|
public const RESPONSE_DETAILS_FIRST_DATA_PAYMENT_TRANSACTION_ID_MISSING = 'firstDataTransactionData.transaction_id field is missing.'; |
|
20
|
|
|
public const RESPONSE_DETAILS_FIRST_DATA_PAYMENT_OID_MISSING = 'firstDataTransactionData.oid field is missing.'; |
|
21
|
|
|
|
|
22
|
|
|
public const RESOURCE_FIRST_DATA_NOTIFICATIONS = 'first-data-notifications'; |
|
23
|
|
|
|
|
24
|
|
|
protected const IS_3D_SECURE = false; |
|
25
|
|
|
protected const MOBILE_MODE = false; |
|
26
|
|
|
protected const ASSIGN_TOKEN = true; |
|
27
|
|
|
protected const DECLINE_HOSTED_DATA_DUPLICATES = false; |
|
28
|
|
|
protected const TIMEZONE = 'Etc/UTC'; |
|
29
|
|
|
protected const CHECKOUT_OPTION = 'combinedpage'; |
|
30
|
|
|
protected const LANGUAGE = 'en_US'; |
|
31
|
|
|
protected const TOKEN_TYPE = 'MULTIPAY'; |
|
32
|
|
|
protected const TRANSACTION_TYPE = 'preauth'; |
|
33
|
|
|
protected const TRANSACTION_DATE_TIME_FORMAT = 'Y:m:d-H:i:s'; |
|
34
|
|
|
protected const CURRENCY_ISO_NUMBERS = [ |
|
35
|
|
|
'USD' => '840', |
|
36
|
|
|
'EUR' => '978', |
|
37
|
|
|
]; |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* @api |
|
41
|
|
|
* |
|
42
|
|
|
* @return string |
|
43
|
|
|
*/ |
|
44
|
|
|
public function getHmacHashAlgo(): string |
|
45
|
|
|
{ |
|
46
|
|
|
return $this->get(FirstDataConstants::HMACHASH_ALGO); |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
/** |
|
50
|
|
|
* @api |
|
51
|
|
|
* |
|
52
|
|
|
* @return string |
|
53
|
|
|
*/ |
|
54
|
|
|
public function getStoreName(): string |
|
55
|
|
|
{ |
|
56
|
|
|
return $this->get(FirstDataConstants::STORE_NAME); |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
/** |
|
60
|
|
|
* @api |
|
61
|
|
|
* |
|
62
|
|
|
* @return string |
|
63
|
|
|
*/ |
|
64
|
|
|
public function getResponseFailUrl(): string |
|
65
|
|
|
{ |
|
66
|
|
|
return $this->get(FirstDataConstants::RESPONSE_FAIL_URL); |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
/** |
|
70
|
|
|
* @api |
|
71
|
|
|
* |
|
72
|
|
|
* @return string |
|
73
|
|
|
*/ |
|
74
|
|
|
public function getResponseSuccessUrl(): string |
|
75
|
|
|
{ |
|
76
|
|
|
return $this->get(FirstDataConstants::RESPONSE_SUCCESS_URL); |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
/** |
|
80
|
|
|
* @api |
|
81
|
|
|
* |
|
82
|
|
|
* @return string |
|
83
|
|
|
*/ |
|
84
|
|
|
public function getTransactionNotificationUrl(): string |
|
85
|
|
|
{ |
|
86
|
|
|
return $this->get(FirstDataConstants::TRANSACTION_NOTIFICATION_URL); |
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
|
|
/** |
|
90
|
|
|
* @api |
|
91
|
|
|
* |
|
92
|
|
|
* @return string |
|
93
|
|
|
*/ |
|
94
|
|
|
public function getMethodNameCreditCard(): string |
|
95
|
|
|
{ |
|
96
|
|
|
return SharedFirstDataConfig::PAYMENT_METHOD_KEY_CREDIT_CARD; |
|
97
|
|
|
} |
|
98
|
|
|
|
|
99
|
|
|
/** |
|
100
|
|
|
* @api |
|
101
|
|
|
* |
|
102
|
|
|
* @return string |
|
103
|
|
|
*/ |
|
104
|
|
|
public function getTransactionType(): string |
|
105
|
|
|
{ |
|
106
|
|
|
return static::TRANSACTION_TYPE; |
|
107
|
|
|
} |
|
108
|
|
|
|
|
109
|
|
|
/** |
|
110
|
|
|
* @api |
|
111
|
|
|
* |
|
112
|
|
|
* @return string |
|
113
|
|
|
*/ |
|
114
|
|
|
public function getCheckoutOption(): string |
|
115
|
|
|
{ |
|
116
|
|
|
return static::CHECKOUT_OPTION; |
|
117
|
|
|
} |
|
118
|
|
|
|
|
119
|
|
|
/** |
|
120
|
|
|
* @api |
|
121
|
|
|
* |
|
122
|
|
|
* @return string |
|
123
|
|
|
*/ |
|
124
|
|
|
public function getDateTimeFormat(): string |
|
125
|
|
|
{ |
|
126
|
|
|
return static::TRANSACTION_DATE_TIME_FORMAT; |
|
127
|
|
|
} |
|
128
|
|
|
|
|
129
|
|
|
/** |
|
130
|
|
|
* @api |
|
131
|
|
|
* |
|
132
|
|
|
* @return bool |
|
133
|
|
|
*/ |
|
134
|
|
|
public function getIs3dSecure(): bool |
|
135
|
|
|
{ |
|
136
|
|
|
return static::IS_3D_SECURE; |
|
137
|
|
|
} |
|
138
|
|
|
|
|
139
|
|
|
/** |
|
140
|
|
|
* @api |
|
141
|
|
|
* |
|
142
|
|
|
* @return bool |
|
143
|
|
|
*/ |
|
144
|
|
|
public function getMobileMode(): bool |
|
145
|
|
|
{ |
|
146
|
|
|
return static::MOBILE_MODE; |
|
147
|
|
|
} |
|
148
|
|
|
|
|
149
|
|
|
/** |
|
150
|
|
|
* @api |
|
151
|
|
|
* |
|
152
|
|
|
* @return bool |
|
153
|
|
|
*/ |
|
154
|
|
|
public function getAssignToken(): bool |
|
155
|
|
|
{ |
|
156
|
|
|
return static::ASSIGN_TOKEN; |
|
157
|
|
|
} |
|
158
|
|
|
|
|
159
|
|
|
/** |
|
160
|
|
|
* @api |
|
161
|
|
|
* |
|
162
|
|
|
* @return bool |
|
163
|
|
|
*/ |
|
164
|
|
|
public function getDeclineHostedDataDuplicates(): bool |
|
165
|
|
|
{ |
|
166
|
|
|
return static::DECLINE_HOSTED_DATA_DUPLICATES; |
|
167
|
|
|
} |
|
168
|
|
|
|
|
169
|
|
|
/** |
|
170
|
|
|
* @api |
|
171
|
|
|
* |
|
172
|
|
|
* @param string $code |
|
173
|
|
|
* |
|
174
|
|
|
* @return string |
|
175
|
|
|
*/ |
|
176
|
|
|
public function getIsoNumberByCode(string $code): string |
|
177
|
|
|
{ |
|
178
|
|
|
return static::CURRENCY_ISO_NUMBERS[$code]; |
|
179
|
|
|
} |
|
180
|
|
|
|
|
181
|
|
|
/** |
|
182
|
|
|
* @api |
|
183
|
|
|
* |
|
184
|
|
|
* @return string |
|
185
|
|
|
*/ |
|
186
|
|
|
public function getTimezone(): string |
|
187
|
|
|
{ |
|
188
|
|
|
return static::TIMEZONE; |
|
189
|
|
|
} |
|
190
|
|
|
|
|
191
|
|
|
/** |
|
192
|
|
|
* @api |
|
193
|
|
|
* |
|
194
|
|
|
* @return string |
|
195
|
|
|
*/ |
|
196
|
|
|
public function getLanguage(): string |
|
197
|
|
|
{ |
|
198
|
|
|
return static::LANGUAGE; |
|
199
|
|
|
} |
|
200
|
|
|
|
|
201
|
|
|
/** |
|
202
|
|
|
* @api |
|
203
|
|
|
* |
|
204
|
|
|
* @return string |
|
205
|
|
|
*/ |
|
206
|
|
|
public function getTokenType(): string |
|
207
|
|
|
{ |
|
208
|
|
|
return static::TOKEN_TYPE; |
|
209
|
|
|
} |
|
210
|
|
|
|
|
211
|
|
|
/** |
|
212
|
|
|
* @api |
|
213
|
|
|
* |
|
214
|
|
|
* @return int |
|
215
|
|
|
*/ |
|
216
|
|
|
public function getAdditionAuthPercentageBuffer(): int |
|
217
|
|
|
{ |
|
218
|
|
|
return $this->get(FirstDataConstants::ADDITIONAL_AUTH_PERCENTAGE_BUFFER, 0); |
|
219
|
|
|
} |
|
220
|
|
|
|
|
221
|
|
|
/** |
|
222
|
|
|
* @api |
|
223
|
|
|
* |
|
224
|
|
|
* @return string |
|
225
|
|
|
*/ |
|
226
|
|
|
public function getFirstDataPaymentProcessingLink(): string |
|
227
|
|
|
{ |
|
228
|
|
|
return $this->get(FirstDataConstants::FIRST_DATA_PAYMENT_PROCESSING_LINK); |
|
229
|
|
|
} |
|
230
|
|
|
} |
|
231
|
|
|
|