1 | <?php |
||
8 | class ResponseCode extends Model |
||
9 | { |
||
10 | protected static $fields = ResponseCodeFields::class; |
||
11 | |||
12 | /** |
||
13 | * A response code that is generated by the Payment Server to indicate the status of the transaction. |
||
14 | * vpc_TxnResponseCode |
||
15 | * A vpc_TxnResponseCode of “0” (zero) indicates that the transaction was processed successfully and |
||
16 | * approved by the acquiring bank. Any other value indicates the transaction was declined. |
||
17 | * |
||
18 | * Required |
||
19 | * |
||
20 | * @var int |
||
21 | */ |
||
22 | private $txnResponseCode; |
||
23 | |||
24 | /** |
||
25 | * Human readable message for the error code. |
||
26 | * @var String |
||
27 | */ |
||
28 | private $message; |
||
29 | |||
30 | /** |
||
31 | * The subsequent fields are relevant to the card provider. |
||
32 | * If the card could not be charged then the txnResponseCode will show that there was an error, |
||
33 | * These fields are kept for posterity. |
||
34 | * @var String |
||
35 | */ |
||
36 | private $AVSResultCode; |
||
37 | private $acqAVSRespCode; |
||
38 | private $acqCSCRespCode; |
||
39 | private $acqResponseCode; |
||
40 | private $CSCResultCode; |
||
41 | |||
42 | 15 | public function __construct($txnResponseCode, $message, $AVSResultCode = '', $acqAVSRespCode |
|
54 | |||
55 | 3 | public function isSuccess() : bool |
|
62 | |||
63 | 6 | public function getErrorMessage() : string |
|
67 | |||
68 | 3 | public function toJson() : string |
|
72 | |||
73 | 3 | public function toArray() : array |
|
86 | } |
||
87 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.