From 580003188c823d95d1bb56a229706509986dc51a Mon Sep 17 00:00:00 2001 From: "PRESCO\\yifan.shu" Date: Mon, 3 Jul 2023 13:55:34 +0800 Subject: [PATCH] fix the version 8.2 up Dynamic Properties question --- src/PayuniApi.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/PayuniApi.php b/src/PayuniApi.php index 2157f3c..b85d66e 100644 --- a/src/PayuniApi.php +++ b/src/PayuniApi.php @@ -22,7 +22,8 @@ class PayuniApi { - // public $encryptInfo, $merKey, $merIV, $apiUrl, $parameter, $curlUrl; + private $attributes = []; + public $encryptInfo, $merKey, $merIV, $apiUrl, $parameter, $curlUrl; public function __construct(string $key, string $iv, string $type = '') { $this->encryptInfo = ''; @@ -290,4 +291,14 @@ private function HashInfo(string $encryptStr = '') { return strtoupper(hash('sha256', $this->merKey . $encryptStr . $this->merIV)); } + + public function __set(string $name, mixed $value): void + { + $this->attributes[$name] = $value; + } + + public function __get(string $name): mixed + { + return $this->attributes[$name] ?? null; + } }