Passed
Push — feature/eco-2300/crefopay-cred... ( 3c5e73...5287a1 )
by Aleksey
01:15
created

CrefoPayConfig::getSuccessResultCodes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
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\Zed\CrefoPay;
9
10
use Spryker\Zed\Kernel\AbstractBundleConfig;
0 ignored issues
show
Bug introduced by
The type Spryker\Zed\Kernel\AbstractBundleConfig was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use SprykerEco\Shared\CrefoPay\CrefoPayConstants;
12
13
/**
14
 * @method \SprykerEco\Shared\CrefoPay\CrefoPayConfig getSharedConfig()
15
 */
16
class CrefoPayConfig extends AbstractBundleConfig
17
{
18
    protected const NOTIFICATION_TRANSACTION_STATUS_ACKNOWLEDGE_PENDING = 'ACKNOWLEDGEPENDING';
19
    protected const NOTIFICATION_TRANSACTION_STATUS_FRAUD_PENDING = 'FRAUDPENDING';
20
    protected const NOTIFICATION_TRANSACTION_STATUS_FRAUD_CANCELLED = 'FRAUDCANCELLED';
21
    protected const NOTIFICATION_TRANSACTION_STATUS_CIA_PENDING = 'CIAPENDING';
22
    protected const NOTIFICATION_TRANSACTION_STATUS_MERCHANT_PENDING = 'MERCHANTPENDING';
23
    protected const NOTIFICATION_TRANSACTION_STATUS_CANCELLED = 'CANCELLED';
24
    protected const NOTIFICATION_TRANSACTION_STATUS_EXPIRED = 'EXPIRED';
25
    protected const NOTIFICATION_TRANSACTION_STATUS_IN_PROGRESS = 'INPROGRESS';
26
    protected const NOTIFICATION_TRANSACTION_STATUS_DONE = 'DONE';
27
28
    protected const NOTIFICATION_ORDER_STATUS_PAY_PENDING = 'PAYPENDING';
29
    protected const NOTIFICATION_ORDER_STATUS_PAID = 'PAID';
30
    protected const NOTIFICATION_ORDER_STATUS_CLEARED = 'CLEARED';
31
    protected const NOTIFICATION_ORDER_STATUS_PAYMENT_FAILED = 'PAYMENTFAILED';
32
    protected const NOTIFICATION_ORDER_STATUS_CHARGE_BACK = 'CHARGEBACK';
33
    protected const NOTIFICATION_ORDER_STATUS_IN_DUNNING = 'INDUNNING';
34
    protected const NOTIFICATION_ORDER_STATUS_IN_COLLECTION = 'IN_COLLECTION';
35
36
    protected const OMS_STATUS_NEW = 'new';
37
    protected const OMS_STATUS_RESERVED = 'reserved';
38
    protected const OMS_STATUS_AUTHORIZED = 'authorized';
39
    protected const OMS_STATUS_WAITING_FOR_CAPTURE = 'waiting for capture';
40
    protected const OMS_STATUS_WAITING_FOR_CASH = 'waiting for cash';
41
    protected const OMS_STATUS_CAPTURE_PENDING = 'capture pending';
42
    protected const OMS_STATUS_CAPTURED = 'captured';
43
    protected const OMS_STATUS_CANCELLATION_PENDING = 'cancellation pending';
44
    protected const OMS_STATUS_CANCELED = 'canceled';
45
    protected const OMS_STATUS_REFUNDED = 'refunded';
46
    protected const OMS_STATUS_MONEY_REDUCED = 'money reduced';
47
    protected const OMS_STATUS_EXPIRED = 'expired';
48
    protected const OMS_STATUS_DONE = 'done';
49
50
    protected const OMS_EVENT_CANCEL = 'cancel';
51
    protected const OMS_EVENT_NO_CANCELLATION = 'no cancellation';
52
    protected const OMS_EVENT_FINISH = 'finish';
53
54
    protected const CREFO_PAY_API_CAPTURE_ID_LENGTH = 30;
55
56
    protected const CREFO_PAY_AUTOMATIC_OMS_TRIGGER = 'CREFO_PAY_AUTOMATIC_OMS_TRIGGER';
57
58
    /**
59
     * @return string
60
     */
61
    public function getMerchantId(): string
62
    {
63
        return $this->get(CrefoPayConstants::MERCHANT_ID);
64
    }
65
66
    /**
67
     * @return string
68
     */
69
    public function getStoreId(): string
70
    {
71
        return $this->get(CrefoPayConstants::STORE_ID);
72
    }
73
74
    /**
75
     * @return string
76
     */
77
    public function getAutoCapture(): string
78
    {
79
        return $this->get(CrefoPayConstants::AUTO_CAPTURE);
80
    }
81
82
    /**
83
     * @return string
84
     */
85
    public function getRefundDescription(): string
86
    {
87
        return $this->get(CrefoPayConstants::REFUND_DESCRIPTION);
88
    }
89
90
    /**
91
     * @return string
92
     */
93
    public function getProviderName(): string
94
    {
95
        return $this->getSharedConfig()->getProviderName();
96
    }
97
98
    /**
99
     * @return string
100
     */
101
    public function getIntegrationType(): string
102
    {
103
        return $this->getSharedConfig()->getIntegrationType();
104
    }
105
106
    /**
107
     * @return string
108
     */
109
    public function getContext(): string
110
    {
111
        return $this->getSharedConfig()->getContext();
112
    }
113
114
    /**
115
     * @return string
116
     */
117
    public function getUserType(): string
118
    {
119
        return $this->getSharedConfig()->getUserType();
120
    }
121
122
    /**
123
     * @return int
124
     */
125
    public function getUserRiskClass(): int
126
    {
127
        return $this->getSharedConfig()->getUserRiskClass();
128
    }
129
130
    /**
131
     * @return string
132
     */
133
    public function getProductTypeDefault(): string
134
    {
135
        return $this->getSharedConfig()->getProductTypeDefault();
136
    }
137
138
    /**
139
     * @return string
140
     */
141
    public function getProductRiskClass(): string
142
    {
143
        return $this->getSharedConfig()->getProductRiskClass();
144
    }
145
146
    /**
147
     * @return string[]
148
     */
149
    public function getInternalToExternalPaymentMethodNamesMapping(): array
150
    {
151
        return [
152
            $this->getSharedConfig()->getCrefoPayPaymentMethodBill() => $this->getSharedConfig()->getExternalPaymentMethodBill(),
153
            $this->getSharedConfig()->getCrefoPayPaymentMethodCashOnDelivery() => $this->getSharedConfig()->getExternalPaymentMethodCashOnDelivery(),
154
            $this->getSharedConfig()->getCrefoPayPaymentMethodDirectDebit() => $this->getSharedConfig()->getExternalPaymentMethodDirectDebit(),
155
            $this->getSharedConfig()->getCrefoPayPaymentMethodPayPal() => $this->getSharedConfig()->getExternalPaymentMethodPayPal(),
156
            $this->getSharedConfig()->getCrefoPayPaymentMethodPrepaid() => $this->getSharedConfig()->getExternalPaymentMethodPrepaid(),
157
            $this->getSharedConfig()->getCrefoPayPaymentMethodSofort() => $this->getSharedConfig()->getExternalPaymentMethodSofort(),
158
            $this->getSharedConfig()->getCrefoPayPaymentMethodCreditCard() => $this->getSharedConfig()->getExternalPaymentMethodCreditCard(),
159
            $this->getSharedConfig()->getCrefoPayPaymentMethodCreditCard3D() => $this->getSharedConfig()->getExternalPaymentMethodCreditCard3D(),
160
        ];
161
    }
162
163
    /**
164
     * @return string
165
     */
166
    public function getNotificationTransactionStatusAcknowledgePending(): string
167
    {
168
        return static::NOTIFICATION_TRANSACTION_STATUS_ACKNOWLEDGE_PENDING;
169
    }
170
171
    /**
172
     * @return string
173
     */
174
    public function getNotificationTransactionStatusMerchantPending(): string
175
    {
176
        return static::NOTIFICATION_TRANSACTION_STATUS_MERCHANT_PENDING;
177
    }
178
179
    /**
180
     * @return string
181
     */
182
    public function getNotificationTransactionStatusCiaPending(): string
183
    {
184
        return static::NOTIFICATION_TRANSACTION_STATUS_CIA_PENDING;
185
    }
186
187
    /**
188
     * @return string
189
     */
190
    public function getNotificationTransactionStatusCancelled(): string
191
    {
192
        return static::NOTIFICATION_TRANSACTION_STATUS_CANCELLED;
193
    }
194
195
    /**
196
     * @return string
197
     */
198
    public function getNotificationTransactionStatusExpired(): string
199
    {
200
        return static::NOTIFICATION_TRANSACTION_STATUS_EXPIRED;
201
    }
202
203
    /**
204
     * @return string
205
     */
206
    public function getNotificationTransactionStatusDone(): string
207
    {
208
        return static::NOTIFICATION_TRANSACTION_STATUS_DONE;
209
    }
210
211
    /**
212
     * @return string
213
     */
214
    public function getNotificationOrderStatusPayPending(): string
215
    {
216
        return static::NOTIFICATION_ORDER_STATUS_PAY_PENDING;
217
    }
218
219
    /**
220
     * @return string
221
     */
222
    public function getNotificationOrderStatusPaid(): string
223
    {
224
        return static::NOTIFICATION_ORDER_STATUS_PAID;
225
    }
226
227
    /**
228
     * @return string
229
     */
230
    public function getNotificationOrderStatusChargeBack(): string
231
    {
232
        return static::NOTIFICATION_ORDER_STATUS_CHARGE_BACK;
233
    }
234
235
    /**
236
     * @return string
237
     */
238
    public function getOmsStatusNew(): string
239
    {
240
        return static::OMS_STATUS_NEW;
241
    }
242
243
    /**
244
     * @return string
245
     */
246
    public function getOmsStatusReserved(): string
247
    {
248
        return static::OMS_STATUS_RESERVED;
249
    }
250
251
    /**
252
     * @return string
253
     */
254
    public function getOmsStatusAuthorized(): string
255
    {
256
        return static::OMS_STATUS_AUTHORIZED;
257
    }
258
259
    /**
260
     * @return string
261
     */
262
    public function getOmsStatusWaitingForCapture(): string
263
    {
264
        return static::OMS_STATUS_WAITING_FOR_CAPTURE;
265
    }
266
267
    /**
268
     * @return string
269
     */
270
    public function getOmsStatusWaitingForCash(): string
271
    {
272
        return static::OMS_STATUS_WAITING_FOR_CASH;
273
    }
274
275
    /**
276
     * @return string
277
     */
278
    public function getOmsStatusCapturePending(): string
279
    {
280
        return static::OMS_STATUS_CAPTURE_PENDING;
281
    }
282
283
    /**
284
     * @return string
285
     */
286
    public function getOmsStatusCaptured(): string
287
    {
288
        return static::OMS_STATUS_CAPTURED;
289
    }
290
291
    /**
292
     * @return string
293
     */
294
    public function getOmsStatusCancellationPending(): string
295
    {
296
        return static::OMS_STATUS_CANCELLATION_PENDING;
297
    }
298
299
    /**
300
     * @return string
301
     */
302
    public function getOmsStatusCanceled(): string
303
    {
304
        return static::OMS_STATUS_CANCELED;
305
    }
306
307
    /**
308
     * @return string
309
     */
310
    public function getOmsStatusRefunded(): string
311
    {
312
        return static::OMS_STATUS_REFUNDED;
313
    }
314
315
    /**
316
     * @return string
317
     */
318
    public function getOmsStatusMoneyReduced(): string
319
    {
320
        return static::OMS_STATUS_MONEY_REDUCED;
321
    }
322
323
    /**
324
     * @return string
325
     */
326
    public function getOmsStatusExpired(): string
327
    {
328
        return static::OMS_STATUS_EXPIRED;
329
    }
330
331
    /**
332
     * @return string
333
     */
334
    public function getOmsStatusDone(): string
335
    {
336
        return static::OMS_STATUS_DONE;
337
    }
338
339
    /**
340
     * @return string
341
     */
342
    public function getOmsEventCancel(): string
343
    {
344
        return static::OMS_EVENT_CANCEL;
345
    }
346
347
    /**
348
     * @return string
349
     */
350
    public function getOmsEventNoCancellation(): string
351
    {
352
        return static::OMS_EVENT_NO_CANCELLATION;
353
    }
354
355
    /**
356
     * @return string
357
     */
358
    public function getOmsEventFinish(): string
359
    {
360
        return static::OMS_EVENT_FINISH;
361
    }
362
363
    /**
364
     * @return string[]
365
     */
366
    public function getNotificationTransactionToOmsStatusMapping(): array
367
    {
368
        return [
369
            $this->getNotificationTransactionStatusAcknowledgePending() => $this->getOmsStatusAuthorized(),
370
            $this->getNotificationTransactionStatusMerchantPending() => $this->getOmsStatusWaitingForCapture(),
371
            $this->getNotificationTransactionStatusCiaPending() => $this->getOmsStatusWaitingForCash(),
372
            $this->getNotificationTransactionStatusCancelled() => $this->getOmsStatusCanceled(),
373
            $this->getNotificationTransactionStatusExpired() => $this->getOmsStatusExpired(),
374
            $this->getNotificationTransactionStatusDone() => $this->getOmsStatusDone(),
375
        ];
376
    }
377
378
    /**
379
     * @return string[]
380
     */
381
    public function getNotificationOrderToOmsStatusMapping(): array
382
    {
383
        return [
384
            $this->getNotificationOrderStatusPayPending() => $this->getOmsStatusCapturePending(),
385
            $this->getNotificationOrderStatusPaid() => $this->getOmsStatusCaptured(),
386
            $this->getNotificationOrderStatusChargeBack() => $this->getOmsStatusRefunded(),
387
        ];
388
    }
389
390
    /**
391
     * @return int
392
     */
393
    public function getCrefoPayApiCaptureIdLength(): int
394
    {
395
        return static::CREFO_PAY_API_CAPTURE_ID_LENGTH;
396
    }
397
398
    /**
399
     * @return string
400
     */
401
    public function getCrefoPayAutomaticOmsTrigger(): string
402
    {
403
        return static::CREFO_PAY_AUTOMATIC_OMS_TRIGGER;
404
    }
405
}
406