Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
 '' . __( 'Settings', 'woo-paystack' ) . '', ); return array_merge( $settings_link, $links ); } /** * Add Paystack Gateway to WooCommerce. * * @param array $methods WooCommerce payment gateways methods. * * @return array */ function tbz_wc_add_paystack_gateway( $methods ) { if ( class_exists( 'WC_Subscriptions_Order' ) && class_exists( 'WC_Payment_Gateway_CC' ) ) { $methods[] = 'WC_Gateway_Paystack_Subscriptions'; } else { $methods[] = 'WC_Gateway_Paystack'; } if ( 'NGN' === get_woocommerce_currency() ) { $settings = get_option( 'woocommerce_paystack_settings', '' ); $custom_gateways = isset( $settings['custom_gateways'] ) ? $settings['custom_gateways'] : ''; switch ( $custom_gateways ) { case '5': $methods[] = 'WC_Gateway_Paystack_One'; $methods[] = 'WC_Gateway_Paystack_Two'; $methods[] = 'WC_Gateway_Paystack_Three'; $methods[] = 'WC_Gateway_Paystack_Four'; $methods[] = 'WC_Gateway_Paystack_Five'; break; case '4': $methods[] = 'WC_Gateway_Paystack_One'; $methods[] = 'WC_Gateway_Paystack_Two'; $methods[] = 'WC_Gateway_Paystack_Three'; $methods[] = 'WC_Gateway_Paystack_Four'; break; case '3': $methods[] = 'WC_Gateway_Paystack_One'; $methods[] = 'WC_Gateway_Paystack_Two'; $methods[] = 'WC_Gateway_Paystack_Three'; break; case '2': $methods[] = 'WC_Gateway_Paystack_One'; $methods[] = 'WC_Gateway_Paystack_Two'; break; case '1': $methods[] = 'WC_Gateway_Paystack_One'; break; default: break; } } return $methods; } /** * Display a notice if WooCommerce is not installed */ function tbz_wc_paystack_wc_missing_notice() { echo '

' . sprintf( __( 'Paystack requires WooCommerce to be installed and active. Click %s to install WooCommerce.', 'woo-paystack' ), 'here' ) . '

'; } /** * Display the test mode notice. **/ function tbz_wc_paystack_testmode_notice() { if ( ! class_exists( Notes::class ) ) { return; } if ( ! class_exists( WC_Data_Store::class ) ) { return; } if ( ! method_exists( Notes::class, 'get_note_by_name' ) ) { return; } $test_mode_note = Notes::get_note_by_name( 'paystack-test-mode' ); if ( false !== $test_mode_note ) { return; } $paystack_settings = get_option( 'woocommerce_paystack_settings' ); $test_mode = $paystack_settings['testmode'] ?? ''; if ( 'yes' !== $test_mode ) { Notes::delete_notes_with_name( 'paystack-test-mode' ); return; } $note = new Note(); $note->set_title( __( 'Paystack test mode enabled', 'woo-paystack' ) ); $note->set_content( __( 'Paystack test mode is currently enabled. Remember to disable it when you want to start accepting live payment on your site.', 'woo-paystack' ) ); $note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL ); $note->set_layout( 'plain' ); $note->set_is_snoozable( false ); $note->set_name( 'paystack-test-mode' ); $note->set_source( 'woo-paystack' ); $note->add_action( 'disable-paystack-test-mode', __( 'Disable Paystack test mode', 'woo-paystack' ), admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=paystack' ) ); $note->save(); } add_action( 'before_woocommerce_init', function () { if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); } } ); /** * Registers WooCommerce Blocks integration. */ function tbz_wc_gateway_paystack_woocommerce_block_support() { if ( class_exists( 'Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType' ) ) { require_once __DIR__ . '/includes/class-wc-gateway-paystack-blocks-support.php'; require_once __DIR__ . '/includes/custom-gateways/class-wc-gateway-custom-paystack-blocks-support.php'; require_once __DIR__ . '/includes/custom-gateways/gateway-one/class-wc-gateway-paystack-one-blocks-support.php'; require_once __DIR__ . '/includes/custom-gateways/gateway-two/class-wc-gateway-paystack-two-blocks-support.php'; require_once __DIR__ . '/includes/custom-gateways/gateway-three/class-wc-gateway-paystack-three-blocks-support.php'; require_once __DIR__ . '/includes/custom-gateways/gateway-four/class-wc-gateway-paystack-four-blocks-support.php'; require_once __DIR__ . '/includes/custom-gateways/gateway-five/class-wc-gateway-paystack-five-blocks-support.php'; add_action( 'woocommerce_blocks_payment_method_type_registration', static function( Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry ) { $payment_method_registry->register( new WC_Gateway_Paystack_Blocks_Support() ); $payment_method_registry->register( new WC_Gateway_Paystack_One_Blocks_Support() ); $payment_method_registry->register( new WC_Gateway_Paystack_Two_Blocks_Support() ); $payment_method_registry->register( new WC_Gateway_Paystack_Three_Blocks_Support() ); $payment_method_registry->register( new WC_Gateway_Paystack_Four_Blocks_Support() ); $payment_method_registry->register( new WC_Gateway_Paystack_Five_Blocks_Support() ); } ); } } add_action( 'woocommerce_blocks_loaded', 'tbz_wc_gateway_paystack_woocommerce_block_support' );