id = 'custom_gateway'; $this->has_fields = false; $this->method_title = 'Custom Gateway'; $this->method_description = 'Custom Gateway for tests'; $this->pay_button_id = 'custom-pay-button'; // Pay button ID. $this->supports = array( 'products', 'pay_button', // Pay button supporte declared. ); // Load the settings. $this->init_form_fields(); $this->init_settings(); } /** * Initialise Gateway Settings Form Fields. */ public function init_form_fields() { $this->form_fields = array( 'enabled' => array( 'title' => 'Enable/Disable', 'type' => 'checkbox', 'label' => '', 'default' => 'yes', ), ); } } // Register class. add_filter( 'woocommerce_payment_gateways', function( $gateways ) { $gateways[] = 'My_Custom_Gateway'; return $gateways; } ); /** * Sample button implementation. */ add_action( 'wp_footer', function() { echo ''; } ); }, 10 );