Мне нужен URL (http://example.com/?check=ok) и возвращаю $ this-> merchant_id, но он не работает в плагине WordPress. Можете ли вы помочь мне, пожалуйста.
class Payment_Gateway extends WC_Payment_Gateway
{
private $merchant_id;
public static function init()
{
add_action('init', array(get_called_class(), 'check_payment'));
}
function __construct()
{
$this->merchant_id = $this->get_option('merchant_id');
}
public static function check_payment()
{
if(isset($_GET['check'])) return $this->merchant_id;
}
}