1 | <?php |
||
23 | class ResultCode { |
||
24 | /** |
||
25 | * Customer processing error. |
||
26 | * |
||
27 | * Error or cancellation of customer at supplier. For example, the customer |
||
28 | * abandoned their transaction at the supplier. |
||
29 | * |
||
30 | * @var int |
||
31 | */ |
||
32 | const CUSTOMER_ERROR = -10; |
||
33 | |||
34 | /** |
||
35 | * Declined. |
||
36 | * |
||
37 | * Declines, etc. In these cases the processing was performed correctly, |
||
38 | * but the end-result for the customer is not. |
||
39 | * |
||
40 | * @var int |
||
41 | */ |
||
42 | const DECLINED = -4; |
||
43 | |||
44 | /** |
||
45 | * Failed. |
||
46 | * |
||
47 | * The transaction failed because of a processing error at Payvision. |
||
48 | * |
||
49 | * @var int |
||
50 | */ |
||
51 | const FAILED = -2; |
||
52 | |||
53 | /** |
||
54 | * Ok. |
||
55 | * |
||
56 | * The transaction was processed successfully. |
||
57 | * |
||
58 | * @var int |
||
59 | */ |
||
60 | const OK = 0; |
||
61 | |||
62 | /** |
||
63 | * Waiting. |
||
64 | * |
||
65 | * The transaction was initiated successfully, but a payment was not yet made by the |
||
66 | * customer or not yet confirmed by the bank. Occurs for brands for which customers |
||
67 | * have to make a payment separately (like Boletos) or where the bank does not |
||
68 | * immediately confirm a payment (like SEPA). |
||
69 | * |
||
70 | * @var int |
||
71 | */ |
||
72 | const WAITING = 1; |
||
73 | |||
74 | /** |
||
75 | * Pending. |
||
76 | * |
||
77 | * Pending transaction, the payment was initiated and waiting for the customer to |
||
78 | * complete the payment at the bank or payment processor. |
||
79 | * |
||
80 | * @var int |
||
81 | */ |
||
82 | const PENDING = 2; |
||
83 | |||
84 | /** |
||
85 | * Timeout. |
||
86 | * |
||
87 | * The payment timeout expired before the customer completed the payment. |
||
88 | * |
||
89 | * @var int |
||
90 | */ |
||
91 | const TIMEOUT = 4; |
||
92 | |||
93 | /** |
||
94 | * Transform Payvision result code to WordPress payment status. |
||
95 | * |
||
96 | * @param int|null $result_code Payvision result code. |
||
97 | * @return string|null WordPress payment status. |
||
98 | */ |
||
99 | 9 | public static function to_core( $result_code ) { |
|
117 | } |
||
118 |