Payment Gateways not Registered
-
Since sometime around the release of version 8.1.0, this plugin no longer works on a site that I manage. The payment gateways do not appear at all on the Settings -> Payments page and the settings pages (within the plugin links) are entirely blank.
After digging through the plugin’s source code and testing the execution of hooks, it appears that
WC_Braintree::load_gateways
is never called after registered withinSV_WC_Payment_Gateway_Plugin::add_hooks
withadd_filter( 'woocommerce_payment_gateways', array( $this, 'load_gateways' ) );
. This may be due to the fact that theWC_Braintree
class is initialized by thewc_braintree
function during thewoocommerce_init
action which may occur after thewoocommerce_payment_gateways
filter is called (I haven’t confirmed this).What I do know is that the following code allows the payment gateways to be registered and resumes full functionality of the plugin (as far as I can tell).
add_filter('woocommerce_payment_gateways', function ($gateways) { return WC_Braintree::instance()->load_gateways($gateways); });
I’ve provided a heavily edited copy of the status report as there are a number of configuration settings which I prefer not to disclose and that I don’t believe are relevant to this issue.
WordPress Environment WC Version: 8.8.3 REST API Version: ? 8.8.3 Action Scheduler Version: ? 3.7.4 Log Directory Writable: ? WP Version: 6.5.2 Language: en_US Server Info: Apache PHP Version: 8.2.18 cURL Version: 7.61.1 SUHOSIN Installed: – Default Timezone is UTC: ? fsockopen/cURL: ? SoapClient: ? DOMDocument: ? GZip: ? Multibyte String: ? Remote Post: ? Remote Get: ? Database WC Database Version: 8.8.3 Secure connection (HTTPS): ? Hide errors from visitors: ? Active Plugins (...) Braintree for WooCommerce Payment Gateway: by WooCommerce – 3.1.5 WooCommerce: by Automattic – 8.8.3
- You must be logged in to reply to this topic.