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 <noreply@anthropic.com>
This commit is contained in:
Dat Hoang
2025-11-06 11:31:36 +07:00
committed by GitHub
parent 54142b611c
commit 96bb0fa9ab
+21
View File
@@ -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
*/