/**
* Declare compatibility with Block-based Checkout
*/
add_action( 'woocommerce_blocks_loaded', 'register_custom_gateway_block_support' );
function register_custom_gateway_block_support() {
if ( ! class_exists( 'Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType' ) ) {
return;
}
// This class tells the Checkout Block to look for your PHP gateway
class WC_Gateway_Custom_Link_Blocks extends \Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType {
protected $name = 'pay_online_link'; // Must match the ID in your gateway class
public function initialize() {
$this->settings = get_option( 'woocommerce_pay_online_link_settings', array() );
}
public function is_active() {
return ! empty( $this->settings['enabled'] ) && 'yes' === $this->settings['enabled'];
}
public function get_payment_method_script_handles() {
return array(); // We aren't loading external JS for a simple link gateway
}
public function get_payment_method_data() {
return array(
'title' => $this->get_setting( 'title', 'Pay Online Through Payment Links' ),
'description' => $this->get_setting( 'description', 'We will send a link to your email.' ),
'supports' => array( 'products' )
);
}
}
// Register the block integration
add_action( 'woocommerce_blocks_payment_method_type_registration', function( $payment_method_registry ) {
$payment_method_registry->register( new WC_Gateway_Custom_Link_Blocks() );
});
}
Wishlist - King Vape Abu Dhabi
Product Contains nicotine and Nicotine is an addictive chemical