data = $data; } public function isSuccess() { return $this->data['returnCode'] == '0000'; } public function get($key, $default = null) { return $this->data[$key] ?? $default; } public function getCode() { return $this->data['returnCode']; } public function getMessage() { return $this->data['returnMsg']; } public function getData(array $fields = null) { $returnData = []; if (is_array($fields)) { foreach ($fields as $field) { $returnData[$field] = $this->data[$field] ?? null; } } else { $returnData = $this->data; } unset($returnData['returnCode']); unset($returnData['returnMsg']); unset($returnData['nonceStr']); unset($returnData['customerCode']); return $returnData; } }