• stepman

    (@stepman)


    PHP 8.2+ is issuing deprecation warnings for the dynamic properties declared in WC_Gateway_Borgun. This is easily remedied by declaring the relevant properties in the class:

    class WC_Gateway_Borgun extends WC_Payment_Gateway {
        // [...]
    
        // declare properties to avoid deprecations error
        private $testmode;
        private $merchantid;
        private $paymentgatewayid;
        private $secretkey;
        private $receipttext;
        private $redirecttext;
        private $successurl;
        private $cancelurl;
        private $errorurl;
        private $langpaymentpage;
        private $notification_email;
        private $TotalLineItem;
    
        public function __construct() {
        // [...]

    Alternatively one could use #[\AllowDynamicProperties], but I think in a payment plugin the better approach is to explicitly declare properties.

    Also, Borgun / SaltPay is now of course Teya. Might be nice to update the plugin name / description accordingly to make it easier to find.

  • The topic ‘Deprecation warning for dynamic properties’ is closed to new replies.