• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mlocati / PayWay / 5212705470

pending completion
5212705470

push

github

mlocati
Initial version

1803 of 1803 new or added lines in 47 files covered. (100.0%)

1313 of 1803 relevant lines covered (72.82%)

1.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

41.04
/src/Verify/Response.php
1
<?php
2

3
namespace MLocati\PayWay\Verify;
4

5
use JsonSerializable;
6
use MLocati\PayWay\Service;
7

8
class Response implements JsonSerializable
9
{
10
    use Service\BasePaymentInitResponseTrait {
11
        jsonSerialize as jsonSerializeBasePaymentInitResponse;
12
    }
13

14
    /**
15
     * @var string
16
     */
17
    private $paymentID = '';
18

19
    /**
20
     * @var int|null
21
     */
22
    private $tranID;
23

24
    /**
25
     * @var string
26
     */
27
    private $authCode = '';
28

29
    /**
30
     * @var string
31
     */
32
    private $enrStatus = '';
33

34
    /**
35
     * @var string
36
     */
37
    private $authStatus = '';
38

39
    /**
40
     * @var string
41
     */
42
    private $eci = '';
43

44
    /**
45
     * @var string
46
     */
47
    private $brand = '';
48

49
    /**
50
     * @var string
51
     */
52
    private $acquirerID = '';
53

54
    /**
55
     * @var string
56
     */
57
    private $maskedPan = '';
58

59
    /**
60
     * @var string
61
     */
62
    private $addInfo1 = '';
63

64
    /**
65
     * @var string
66
     */
67
    private $addInfo2 = '';
68

69
    /**
70
     * @var string
71
     */
72
    private $addInfo3 = '';
73

74
    /**
75
     * @var string
76
     */
77
    private $addInfo4 = '';
78

79
    /**
80
     * @var string
81
     */
82
    private $addInfo5 = '';
83

84
    /**
85
     * @var string
86
     */
87
    private $payInstrToken = '';
88

89
    /**
90
     * @var int|null
91
     */
92
    private $expireMonth;
93

94
    /**
95
     * @var int|null
96
     */
97
    private $expireYear;
98

99
    /**
100
     * @var \MLocati\PayWay\Service\Level3Info|null
101
     */
102
    private $level3Info;
103

104
    /**
105
     * @var int|null
106
     */
107
    private $additionalFee;
108

109
    /**
110
     * @var string
111
     */
112
    private $status = '';
113

114
    /**
115
     * @var string
116
     */
117
    private $accountName = '';
118

119
    /**
120
     * @var string
121
     */
122
    private $nssResult = '';
123

124
    /**
125
     * @var string
126
     */
127
    private $topUpID = '';
128

129
    /**
130
     * @var string
131
     */
132
    private $payloadContent; // byte[]
133

134
    /**
135
     * @var string
136
     */
137
    private $payloadContentType = '';
138

139
    /**
140
     * @var array
141
     */
142
    private $payTraceData = [];
143

144
    /**
145
     * @var array
146
     */
147
    private $payAddData = [];
148

149
    /**
150
     * @var string
151
     */
152
    private $payUserRef = '';
153

154
    /**
155
     * @var string
156
     */
157
    private $shopUserMobilePhone = '';
158

159
    /**
160
     * @var string
161
     *
162
     * @see \MLocati\PayWay\Dictionary\ScaExemptionType
163
     */
164
    private $scaExemptionType = '';
165

166
    /**
167
     * @return string
168
     */
169
    public function getPaymentID()
170
    {
171
        return $this->paymentID;
1✔
172
    }
173

174
    /**
175
     * @param string $value
176
     *
177
     * @return $this
178
     */
179
    public function setPaymentID($value)
180
    {
181
        $this->paymentID = (string) $value;
1✔
182

183
        return $this;
1✔
184
    }
185

186
    /**
187
     * @return int|null
188
     */
189
    public function getTranID()
190
    {
191
        return $this->tranID;
×
192
    }
193

194
    /**
195
     * @param int|null $value
196
     *
197
     * @return $this
198
     */
199
    public function setTranID($value)
200
    {
201
        $this->tranID = $value === null || $value === '' ? null : (int) $value;
1✔
202

203
        return $this;
1✔
204
    }
205

206
    /**
207
     * @return string
208
     */
209
    public function getAuthCode()
210
    {
211
        return $this->authCode;
×
212
    }
213

214
    /**
215
     * @param string $value
216
     *
217
     * @return $this
218
     */
219
    public function setAuthCode($value)
220
    {
221
        $this->authCode = (string) $value;
1✔
222

223
        return $this;
1✔
224
    }
225

226
    /**
227
     * @return string
228
     */
229
    public function getEnrStatus()
230
    {
231
        return $this->enrStatus;
×
232
    }
233

234
    /**
235
     * @param string $value
236
     *
237
     * @return $this
238
     */
239
    public function setEnrStatus($value)
240
    {
241
        $this->enrStatus = (string) $value;
1✔
242

243
        return $this;
1✔
244
    }
245

246
    /**
247
     * @return string
248
     */
249
    public function getEci()
250
    {
251
        return $this->eci;
×
252
    }
253

254
    /**
255
     * @param string $value
256
     *
257
     * @return $this
258
     */
259
    public function setEci($value)
260
    {
261
        $this->eci = (string) $value;
×
262

263
        return $this;
×
264
    }
265

266
    /**
267
     * @return string
268
     */
269
    public function getAuthStatus()
270
    {
271
        return $this->authStatus;
×
272
    }
273

274
    /**
275
     * @param string $value
276
     *
277
     * @return $this
278
     */
279
    public function setAuthStatus($value)
280
    {
281
        $this->authStatus = (string) $value;
1✔
282

283
        return $this;
1✔
284
    }
285

286
    /**
287
     * @return string
288
     */
289
    public function getBrand()
290
    {
291
        return $this->brand;
×
292
    }
293

294
    /**
295
     * @param string $value
296
     *
297
     * @return $this
298
     */
299
    public function setBrand($value)
300
    {
301
        $this->brand = (string) $value;
1✔
302

303
        return $this;
1✔
304
    }
305

306
    /**
307
     * @return string
308
     */
309
    public function getAcquirerID()
310
    {
311
        return $this->acquirerID;
×
312
    }
313

314
    /**
315
     * @param string $value
316
     *
317
     * @return $this
318
     */
319
    public function setAcquirerID($value)
320
    {
321
        $this->acquirerID = (string) $value;
×
322

323
        return $this;
×
324
    }
325

326
    /**
327
     * @return string
328
     */
329
    public function getMaskedPan()
330
    {
331
        return $this->maskedPan;
×
332
    }
333

334
    /**
335
     * @param string $value
336
     *
337
     * @return $this
338
     */
339
    public function setMaskedPan($value)
340
    {
341
        $this->maskedPan = (string) $value;
1✔
342

343
        return $this;
1✔
344
    }
345

346
    /**
347
     * @return string
348
     */
349
    public function getAddInfo1()
350
    {
351
        return $this->addInfo1;
×
352
    }
353

354
    /**
355
     * @param string $value
356
     *
357
     * @return $this
358
     */
359
    public function setAddInfo1($value)
360
    {
361
        $this->addInfo1 = (string) $value;
×
362

363
        return $this;
×
364
    }
365

366
    /**
367
     * @return string
368
     */
369
    public function getAddInfo2()
370
    {
371
        return $this->addInfo2;
×
372
    }
373

374
    /**
375
     * @param string $value
376
     *
377
     * @return $this
378
     */
379
    public function setAddInfo2($value)
380
    {
381
        $this->addInfo2 = (string) $value;
×
382

383
        return $this;
×
384
    }
385

386
    /**
387
     * @return string
388
     */
389
    public function getAddInfo3()
390
    {
391
        return $this->addInfo3;
×
392
    }
393

394
    /**
395
     * @param string $value
396
     *
397
     * @return $this
398
     */
399
    public function setAddInfo3($value)
400
    {
401
        $this->addInfo3 = (string) $value;
×
402

403
        return $this;
×
404
    }
405

406
    /**
407
     * @return string
408
     */
409
    public function getAddInfo4()
410
    {
411
        return $this->addInfo4;
×
412
    }
413

414
    /**
415
     * @param string $value
416
     *
417
     * @return $this
418
     */
419
    public function setAddInfo4($value)
420
    {
421
        $this->addInfo4 = (string) $value;
×
422

423
        return $this;
×
424
    }
425

426
    /**
427
     * @return string
428
     */
429
    public function getAddInfo5()
430
    {
431
        return $this->addInfo5;
×
432
    }
433

434
    /**
435
     * @param string $value
436
     *
437
     * @return $this
438
     */
439
    public function setAddInfo5($value)
440
    {
441
        $this->addInfo5 = (string) $value;
×
442

443
        return $this;
×
444
    }
445

446
    /**
447
     * @return string
448
     */
449
    public function getPayInstrToken()
450
    {
451
        return $this->payInstrToken;
×
452
    }
453

454
    /**
455
     * @param string $value
456
     *
457
     * @return $this
458
     */
459
    public function setPayInstrToken($value)
460
    {
461
        $this->payInstrToken = (string) $value;
1✔
462

463
        return $this;
1✔
464
    }
465

466
    /**
467
     * @return int|null
468
     */
469
    public function getExpireMonth()
470
    {
471
        return $this->expireMonth;
×
472
    }
473

474
    /**
475
     * @param int|null $value
476
     *
477
     * @return $this
478
     */
479
    public function setExpireMonth($value)
480
    {
481
        $this->expireMonth = $value === null || $value === '' ? null : (int) $value;
1✔
482

483
        return $this;
1✔
484
    }
485

486
    /**
487
     * @return int|null
488
     */
489
    public function getExpireYear()
490
    {
491
        return $this->expireYear;
×
492
    }
493

494
    /**
495
     * @param int|null $value
496
     *
497
     * @return $this
498
     */
499
    public function setExpireYear($value)
500
    {
501
        $this->expireYear = $value === null || $value === '' ? null : (int) $value;
1✔
502

503
        return $this;
1✔
504
    }
505

506
    /**
507
     * @return \MLocati\PayWay\Service\Level3Info
508
     */
509
    public function getLevel3Info()
510
    {
511
        if ($this->level3Info === null) {
×
512
            $this->level3Info = new Service\Level3Info();
×
513
        }
514

515
        return $this->level3Info;
×
516
    }
517

518
    /**
519
     * @return $this
520
     */
521
    public function setLevel3Info(Service\Level3Info $value)
522
    {
523
        $this->level3Info = $value;
1✔
524

525
        return $this;
1✔
526
    }
527

528
    /**
529
     * @return float|int|null
530
     *
531
     * @example 0.07 EUR = 0.07
532
     * @example 1.00 EUR = 1
533
     * @example 12.05 EUR = 12.05
534
     *
535
     * @see \MLocati\PayWay\Verify\Response::getAdditionalFeeAsCents()
536
     */
537
    public function getAdditionalFeeAsFloat()
538
    {
539
        return $this->additionalFee === null ? null : ((float) $this->additionalFee) / 100.;
×
540
    }
541

542
    /**
543
     * @param float|int|null $value
544
     *
545
     * @return $this
546
     *
547
     * @example 0.07 EUR = 0.07
548
     * @example 1.00 EUR = 1
549
     * @example 12.05 EUR = 12.05
550
     *
551
     * @see \MLocati\PayWay\Verify\Response::setAdditionalFeeAsCents()
552
     */
553
    public function setAdditionalFeeAsFloat($value)
554
    {
555
        return $this->setAdditionalFeeAsCents(empty($value) ? $value : round((float) $value * 100.));
×
556
    }
557

558
    /**
559
     * @var int|null
560
     *
561
     * @example 0.07 EUR = 7
562
     * @example 1.00 EUR = 100
563
     * @example 12.05 EUR = 1205
564
     *
565
     * @see \MLocati\PayWay\Verify\Response::getAdditionalFeeAsFloat()
566
     */
567
    public function getAdditionalFeeAsCents()
568
    {
569
        return $this->additionalFee;
×
570
    }
571

572
    /**
573
     * @param int|null $value
574
     *
575
     * @return $this
576
     *
577
     * @example 0.07 EUR = 7
578
     * @example 1.00 EUR = 100
579
     * @example 12.05 EUR = 1205
580
     *
581
     * @see \MLocati\PayWay\Verify\Response::setAdditionalFeeAsFloat()
582
     */
583
    public function setAdditionalFeeAsCents($value)
584
    {
585
        $this->additionalFee = $value === null || $value === '' ? null : (int) $value;
×
586

587
        return $this;
×
588
    }
589

590
    /**
591
     * @return string
592
     */
593
    public function getStatus()
594
    {
595
        return $this->status;
×
596
    }
597

598
    /**
599
     * @param string $value
600
     *
601
     * @return $this
602
     */
603
    public function setStatus($value)
604
    {
605
        $this->status = (string) $value;
×
606

607
        return $this;
×
608
    }
609

610
    /**
611
     * @return string
612
     */
613
    public function getAccountName()
614
    {
615
        return $this->accountName;
×
616
    }
617

618
    /**
619
     * @param string $value
620
     *
621
     * @return $this
622
     */
623
    public function setAccountName($value)
624
    {
625
        $this->accountName = (string) $value;
×
626

627
        return $this;
×
628
    }
629

630
    /**
631
     * @return string
632
     */
633
    public function getNssResult()
634
    {
635
        return $this->nssResult;
×
636
    }
637

638
    /**
639
     * @param string $value
640
     *
641
     * @return $this
642
     */
643
    public function setNssResult($value)
644
    {
645
        $this->nssResult = (string) $value;
×
646

647
        return $this;
×
648
    }
649

650
    /**
651
     * @return string
652
     */
653
    public function getTopUpID()
654
    {
655
        return $this->topUpID;
×
656
    }
657

658
    /**
659
     * @param string $value
660
     *
661
     * @return $this
662
     */
663
    public function setTopUpID($value)
664
    {
665
        $this->topUpID = (string) $value;
×
666

667
        return $this;
×
668
    }
669

670
    /**
671
     * @return string
672
     */
673
    public function getPayloadContent()
674
    {
675
        return $this->payloadContent;
×
676
    }
677

678
    /**
679
     * @param string $value
680
     *
681
     * @return $this
682
     */
683
    public function setPayloadContent($value)
684
    {
685
        $this->payloadContent = (string) $value;
×
686

687
        return $this;
×
688
    }
689

690
    /**
691
     * @return string
692
     */
693
    public function getPayloadContentType()
694
    {
695
        return $this->payloadContentType;
×
696
    }
697

698
    /**
699
     * @param string $value
700
     *
701
     * @return $this
702
     */
703
    public function setPayloadContentType($value)
704
    {
705
        $this->payloadContentType = (string) $value;
×
706

707
        return $this;
×
708
    }
709

710
    /**
711
     * @return array
712
     */
713
    public function getPayTraceData()
714
    {
715
        return $this->payTraceData;
×
716
    }
717

718
    /**
719
     * @return $this
720
     */
721
    public function setPayTraceData(array $value)
722
    {
723
        $this->payTraceData = [];
×
724
        foreach ($value as $key => $item) {
×
725
            $this->addPayTraceData($key, $item);
×
726
        }
727

728
        return $this;
×
729
    }
730

731
    /**
732
     * @param string $key
733
     * @param string $value
734
     *
735
     * @return $this
736
     */
737
    public function addPayTraceData($key, $value)
738
    {
739
        $this->payTraceData[(string) $key] = (string) $value;
×
740

741
        return $this;
×
742
    }
743

744
    /**
745
     * @return array
746
     */
747
    public function getPayAddData()
748
    {
749
        return $this->payAddData;
×
750
    }
751

752
    /**
753
     * @return $this
754
     */
755
    public function setPayAddData(array $value)
756
    {
757
        $this->payAddData = [];
×
758
        foreach ($value as $key => $item) {
×
759
            $this->addPayAddData($key, $item);
×
760
        }
761

762
        return $this;
×
763
    }
764

765
    /**
766
     * @param string $key
767
     * @param string $value
768
     *
769
     * @return $this
770
     */
771
    public function addPayAddData($key, $value)
772
    {
773
        $this->payAddData[(string) $key] = (string) $value;
×
774

775
        return $this;
×
776
    }
777

778
    /**
779
     * @return string
780
     */
781
    public function getPayUserRef()
782
    {
783
        return $this->payUserRef;
×
784
    }
785

786
    /**
787
     * @param string $value
788
     *
789
     * @return $this
790
     */
791
    public function setPayUserRef($value)
792
    {
793
        $this->payUserRef = (string) $value;
×
794

795
        return $this;
×
796
    }
797

798
    /**
799
     * @return string
800
     */
801
    public function getShopUserMobilePhone()
802
    {
803
        return $this->shopUserMobilePhone;
×
804
    }
805

806
    /**
807
     * @param string $value
808
     *
809
     * @return $this
810
     */
811
    public function setShopUserMobilePhone($value)
812
    {
813
        $this->shopUserMobilePhone = (string) $value;
×
814

815
        return $this;
×
816
    }
817

818
    /**
819
     * @return string
820
     *
821
     * @see \MLocati\PayWay\Dictionary\ScaExemptionType
822
     */
823
    public function getScaExemptionType()
824
    {
825
        return $this->scaExemptionType;
×
826
    }
827

828
    /**
829
     * @param string $value
830
     *
831
     * @return $this
832
     *
833
     * @see \MLocati\PayWay\Dictionary\ScaExemptionType
834
     */
835
    public function setScaExemptionType($value)
836
    {
837
        $this->scaExemptionType = (string) $value;
×
838

839
        return $this;
×
840
    }
841

842
    /**
843
     * {@inheritdoc}
844
     *
845
     * @see \JsonSerializable::jsonSerialize()
846
     */
847
    #[\ReturnTypeWillChange]
848
    public function jsonSerialize()
849
    {
850
        return $this->jsonSerializeBasePaymentInitResponse() + $this->cleanupJson([
2✔
851
            'paymentID' => $this->paymentID,
2✔
852
            'tranID' => $this->tranID,
2✔
853
            'authCode' => $this->authCode,
2✔
854
            'enrStatus' => $this->enrStatus,
2✔
855
            'authStatus' => $this->authStatus,
2✔
856
            'eci' => $this->eci,
2✔
857
            'brand' => $this->brand,
2✔
858
            'acquirerID' => $this->acquirerID,
2✔
859
            'maskedPan' => $this->maskedPan,
2✔
860
            'addInfo1' => $this->addInfo1,
2✔
861
            'addInfo2' => $this->addInfo2,
2✔
862
            'addInfo3' => $this->addInfo3,
2✔
863
            'addInfo4' => $this->addInfo4,
2✔
864
            'addInfo5' => $this->addInfo5,
2✔
865
            'payInstrToken' => $this->payInstrToken,
2✔
866
            'expireMonth' => $this->expireMonth,
2✔
867
            'expireYear' => $this->expireYear,
2✔
868
            'level3Info' => $this->level3Info === null ? null : $this->level3Info->jsonSerialize(),
2✔
869
            'additionalFee' => $this->additionalFee,
2✔
870
            'status' => $this->status,
2✔
871
            'accountName' => $this->accountName,
2✔
872
            'nssResult' => $this->nssResult,
2✔
873
            'topUpID' => $this->topUpID,
2✔
874
            'payloadContent' => $this->payloadContent,
2✔
875
            'payloadContentType' => $this->payloadContentType,
2✔
876
            'payTraceData' => $this->payTraceData,
2✔
877
            'payAddData' => $this->payAddData,
2✔
878
            'payUserRef' => $this->payUserRef,
2✔
879
            'shopUserMobilePhone' => $this->shopUserMobilePhone,
2✔
880
            'scaExemptionType' => $this->scaExemptionType,
2✔
881
        ]);
2✔
882
    }
883
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc