← Back
Editing: class.payzeep.php
<?php class Payzeep { public function __construct() { add_action('admin_init', [$this, 'create_zeep_page']); add_action('admin_init', [$this, 'redirect_to_settings']); } public static function activation() { add_option('zeep_plugin_activated', true); add_option('pzee_btn_mode', 'test'); } public static function deactivation() { flush_rewrite_rules(); delete_option('zeep_plugin_activated'); } public function redirect_to_settings() { if (get_option('zeep_plugin_activated')) { delete_option('zeep_plugin_activated'); if (!headers_sent() && !class_exists('WooCommerce')) { wp_redirect(admin_url('options-general.php?page=pzee-settings')); exit; } } } function display_message() { $message = get_option('pzee_footer_message', ''); if (!empty($message)) { echo '<p style="text-align:center; font-weight:bold;">' . esc_html($message) . '</p>'; } } function call_back_params($vars){ $vars[] = 'gateway_page'; return $vars; } function callback_page_display(){ if (get_query_var('gateway_page') == 'pzeep') { status_header(200); nocache_headers(); // Optional theme header/footer get_header(); echo '<div class="wrap">'; echo '<h1>Custom Payment Page</h1>'; echo '<p>This is your custom payment page content or iframe.</p>'; echo '</div>'; get_footer(); exit; } } function create_zeep_page(){ $page_check = get_page_by_path('zeep-redirect'); if (!isset($page_check->ID)) { $page_id = wp_insert_post(array( 'post_title' => 'ZeepWay', 'post_name' => 'zeep-redirect', 'post_content' => '[pzee_payment_redirect]', 'post_status' => 'publish', 'post_type' => 'page' )); update_option('zeep_redirect_id', $page_id); } } } ?>
Save File
Cancel