Plugin Directory

Changeset 2415212


Ignore:
Timestamp:
11/09/2020 02:04:55 PM (5 years ago)
Author:
pookidevs
Message:

Stable release with major bug fixes.

Location:
k2-woo-custom-payment-gateway
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • k2-woo-custom-payment-gateway/trunk/K2_Custom_Payment_Gateway.php

    r2368902 r2415212  
    11<?php
    2 /*
     2/**
    33 * Plugin Name: K2 Custom Payment Gateway for WooCommerce
     4 * @package K2Blocks
    45 * Plugin URI: https://pookidevs.com
    56 * Description: Add Custom Payment Gateway on Woocommerce Checkout with custom fields.
    67 * Author: PookiDevs
    78 * Author URI: http://pookidevs.com
    8  * Version: 1.0.0
     9 * Version: 1.1
    910 *
    1011*/
     
    2324}
    2425
     26if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
     27}
     28
     29else{
     30    add_action( 'admin_notices', 'admin_notice_missing_main_plugin' );
     31    return;   
     32}
     33
     34function admin_notice_missing_main_plugin() {
     35    deactivate_plugins( plugin_basename(__FILE__) );
     36    unset($_GET['activate']);
     37            ?>
     38        <div class="notice notice-error">
     39            <p><strong>Plugin deactivated. WooCommerce not installed/activated</strong>.</p>
     40        </div>
     41        <?php
     42}
    2543
    2644// Define Custom Gateway Class & Implement Login
     
    3957            $this->domain = 'custom_payment';
    4058
    41             $this->id                 = 'k2woocustompaymentgateway';
     59            $this->id                 = 'K2WooCustomPaymentGateway';
    4260            $this->icon               = apply_filters('woocommerce_custom_gateway_icon', '');
    4361            $this->has_fields         = false;
     
    5573
    5674            // Actions
    57 
     75           
    5876            add_action( 'wp_enqueue_scripts', array( $this, 'payment_style_scripts' ) );
    5977            add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );
    6078            add_action( 'woocommerce_thankyou_' . $this->id, array( $this, 'thankyou_page' ) );
    61 
    62 
     79           
     80       
    6381
    6482
    6583            // Customer Emails
    6684            add_action( 'woocommerce_email_before_order_table', array( $this, 'email_instructions' ), 10, 3 );
    67 
    68 
    69 
    70 
     85           
     86           
     87           
     88           
    7189            add_action( 'wp_enqueue_scripts', array( $this, 'payment_scripts' ) );
    7290
     
    126144
    127145        }
    128 
     146       
    129147
    130148        /**
     
    155173            );
    156174        }
    157 
    158 
     175       
     176                   
    159177    }
    160178}
     
    166184    global $wpdb;
    167185
    168     if($_POST['payment_method'] != 'k2woocustompaymentgateway')
     186    if($_POST['payment_method'] != 'K2WooCustomPaymentGateway')
    169187        return;
    170188
  • k2-woo-custom-payment-gateway/trunk/Readme.txt

    r2368884 r2415212  
    11=== K2 Custom Payment Gateway for WooCommerce ===
    2 Contributors: syedharis632, shahrukhx04, saadhamid
     2Contributors: syedharis632, shahrukhx04, hmumtaz1, saadhamid
    33Tags: Wordpress, Woocommerce, Essentials
    44Requires at least: 5.2
    5 Tested up to: 5.5
     5Tested up to: 5.5.1
    66Requires PHP: 5.6
    7 Stable tag: 1.0.0
     7Stable tag: 1.1
    88License: GPL2+
    99License URI: https://www.gnu.org/licenses/gpl-2.0.txt
     
    6464= 1.0.0 =
    6565Initial release
    66 
     66= 1.1 =
     67Bug fixes
    6768
    6869== Development ==
Note: See TracChangeset for help on using the changeset viewer.