← Back
Editing: payzeep.php
<?php /* * Plugin Name: Payzeep Payment Gateway * Description: Fast, Safe, and Easy Payments. For Anyone, Anywhere, Any time. * Version: 1.0.0 * Author: Payzeep * Author URI: https://www.payzeep.com/ * License: GPL v2 or later * License URI: https://www.gnu.org/licenses/gpl-2.0.html */ define( 'ZEEP__PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); register_activation_hook(__FILE__, ['Payzeep', 'activation']); // register_deactivation_hook(__FILE__, ['Payzeep_Settings', 'deactivation']); add_action( 'activated_plugin', ['Payzeep_Settings', 'zeep_check_woocommerce_activation'], 10, 2 ); require_once ZEEP__PLUGIN_DIR . 'class.payzeep.php'; require_once ZEEP__PLUGIN_DIR . 'class.payzeep-settings.php'; new Payzeep(); new Payzeep_Settings(); add_action('plugins_loaded', function () { if (!class_exists('WC_Payment_Gateway')) return; // new Payzeep_Woocommerce(); require_once ZEEP__PLUGIN_DIR . 'class.payzeep-woocommerce.php'; add_filter('woocommerce_payment_gateways', function ($methods) { $methods[] = 'Payzeep_Woocommerce'; return $methods; }); }); add_action('woocommerce_blocks_loaded', function () { if (!class_exists('\Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType')) { return; } // // Register a callback to handle cart updates (e.g., applying fees dynamically). // woocommerce_store_api_register_update_callback( // array( // 'namespace' => 'extension-fees', // Custom namespace for the callback. // 'callback' => array( $this, 'update_cart_fees' ), // Method to handle the update. // ) // ); // require_once plugin_dir_path(__FILE__) . 'includes/class-my-custom-gateway-block.php'; require_once ZEEP__PLUGIN_DIR . 'class.payzeep-block.php'; // add_action( // 'woocommerce_blocks_payment_method_type_registration', // function( $registry ) { // $registry->register( new \Payzeep_Blocks() ); // } // ); // Register the custom payment gateway with WooCommerce Blocks. add_action( 'woocommerce_blocks_payment_method_type_registration', function ( Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry ) { // Register the custom payment gateway with the PaymentMethodRegistry. $payment_method_registry->register( new Payzeep_Blocks() ); } ); }); add_action( 'before_woocommerce_init', function () { if( class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) { \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'cart_checkout_blocks', __FILE__, false // true (compatible, default) or false (not compatible) ); } } );
Save File
Cancel