From 96bb0fa9ab3388d6748b1ffcd044d7ad4c8a5e42 Mon Sep 17 00:00:00 2001 From: Dat Hoang Date: Thu, 6 Nov 2025 11:31:36 +0700 Subject: [PATCH] Fix PHP 8.2+ deprecation warnings for dynamic property creation (#95) Declare protected properties in WooViet_OnePay_Abstract class to resolve deprecation warnings when creating dynamic properties in PHP 8.2+. Properties declared: - $testmode - $merchant_id - $access_code - $secure_secret - $user - $password - $debug This fix is backward compatible with older PHP versions and resolves the warnings reported in issue #94. Fixes #94 Co-authored-by: Claude --- inc/onepay/abstract-payment.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/inc/onepay/abstract-payment.php b/inc/onepay/abstract-payment.php index 5ced459..26be5aa 100644 --- a/inc/onepay/abstract-payment.php +++ b/inc/onepay/abstract-payment.php @@ -18,6 +18,27 @@ abstract class WooViet_OnePay_Abstract extends WC_Payment_Gateway { /** @var WC_Logger Logger instance */ public static $log = false; + /** @var bool Test mode flag */ + protected $testmode; + + /** @var string OnePay merchant ID */ + protected $merchant_id; + + /** @var string OnePay access code */ + protected $access_code; + + /** @var string OnePay secure secret */ + protected $secure_secret; + + /** @var string OnePay user */ + protected $user; + + /** @var string OnePay password */ + protected $password; + + /** @var bool Debug mode flag */ + protected $debug; + /** * Configure $method_title and $method_description */