1 | <?php |
||
20 | class PaymentResponse { |
||
21 | /** |
||
22 | * Redirect. |
||
23 | * |
||
24 | * @var RedirectDetails|null |
||
25 | */ |
||
26 | public $redirect; |
||
27 | |||
28 | /** |
||
29 | * Transaction. |
||
30 | * |
||
31 | * @var TransactionResponse|null |
||
32 | */ |
||
33 | public $transaction; |
||
34 | |||
35 | /** |
||
36 | * The result of the payment. |
||
37 | * |
||
38 | * @link https://developers.acehubpaymentservices.com/v3.3/reference#result-codes-2 |
||
39 | * @var int |
||
40 | */ |
||
41 | private $result; |
||
42 | |||
43 | /** |
||
44 | * A short description of the result. |
||
45 | * |
||
46 | * @var string |
||
47 | */ |
||
48 | private $description; |
||
49 | |||
50 | /** |
||
51 | * Header. |
||
52 | * |
||
53 | * @var ResponseHeader |
||
54 | */ |
||
55 | private $header; |
||
56 | |||
57 | /** |
||
58 | * Error. |
||
59 | * |
||
60 | * @var Error|null |
||
61 | */ |
||
62 | private $error; |
||
63 | |||
64 | /** |
||
65 | * Construct and initialize payment response |
||
66 | * |
||
67 | * @param int $result Result. |
||
68 | * @param string $description Description. |
||
69 | * @param ResponseHeader $header Header. |
||
70 | */ |
||
71 | 2 | public function __construct( $result, $description, $header ) { |
|
76 | |||
77 | /** |
||
78 | * From JSON. |
||
79 | * |
||
80 | * @param object $object Object. |
||
81 | * @return self |
||
82 | * @throws \JsonSchema\Exception\ValidationException Throws exception when JSON is not valid. |
||
83 | */ |
||
84 | 1 | public static function from_json( $object ) { |
|
111 | |||
112 | /** |
||
113 | * Get result. |
||
114 | * |
||
115 | * @return int |
||
116 | */ |
||
117 | 2 | public function get_result() { |
|
120 | |||
121 | /** |
||
122 | * Get description. |
||
123 | * |
||
124 | * @return string |
||
125 | */ |
||
126 | 1 | public function get_description() { |
|
129 | |||
130 | /** |
||
131 | * Get header. |
||
132 | * |
||
133 | * @return ResponseHeader |
||
134 | */ |
||
135 | 1 | public function get_header() { |
|
138 | |||
139 | /** |
||
140 | * Get error. |
||
141 | * |
||
142 | * @return Error|null |
||
143 | */ |
||
144 | public function get_error() { |
||
145 | return $this->error; |
||
146 | } |
||
147 | |||
148 | /** |
||
149 | * Set error. |
||
150 | * |
||
151 | * @param Error|null $error Error. |
||
152 | * @return void |
||
153 | */ |
||
154 | public function set_error( Error $error = null ) { |
||
157 | } |
||
158 |