Completed initial framework for WooCommerce Payment Gateway
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 31 Mar 2015 23:16:34 +0000 (19:16 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 31 Mar 2015 23:16:34 +0000 (19:16 -0400)
activate.php
classes/glmMesGateway.php [new file with mode: 0644]
classes/glmMesPluginSupport.php [new file with mode: 0644]
classes/glmPluginSupport.php [deleted file]
controllers/controller.php
deactivate.php
defines.php
index.php
readme.txt
uninstall.php
views/paymentForm.html [new file with mode: 0644]

index 0bc007b..2ff2a6e 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Plugin Name: GLM WooCommerce Merchant e-Solutions Gateway
+ * GLM WooCommerce Merchant e-Solutions Gateway
  * Activate Plugin Tasks
  *
  * PHP version 5.5
@@ -14,8 +14,8 @@
  * @link     http://dev.gaslightmedia.com/
  */
 
-// Load glmPluginSupport class
-require_once (GLM_MES_PLUGIN_PATH . '/classes/glmPluginSupport.php');
+// Load glmMesPluginSupport class
+// require_once (GLM_MES_PLUGIN_PATH . '/classes/glmMesPluginSupport.php');
 
 /*
  * This class performs all necessary additional work when this
@@ -24,7 +24,7 @@ require_once (GLM_MES_PLUGIN_PATH . '/classes/glmPluginSupport.php');
  * Currently the only actions are to add role capability to display and modify
  * prototypes.
  */
-class glmMesPluginActivate extends glmPluginSupport
+class glmMesPluginActivate // extends glmMesPluginSupport
 {
 
     /**
@@ -52,7 +52,6 @@ class glmMesPluginActivate extends glmPluginSupport
      */
     public function __construct ($wpdb, $config)
     {
-
         // Make sure the current user has this capability
         if (! current_user_can('activate_plugins')) {
             $this->addNotice("Interesting, you don't have permission to activate plugins.");
@@ -64,41 +63,8 @@ class glmMesPluginActivate extends glmPluginSupport
 
         // Save plugin configuration object
         $this->config = $config;
-
-    }
-
-    /*
-     * Add a role capability to all current roles
-     *
-     * @param string $capability Name of capability to add
-     * @param string $default Whether capability should be on by default
-     *
-     * @return void
-     * @access private
-     */
-    private function addRoleCapability ($capability, $default)
-    {
-        // Get list of role objects
-        $roleObjects = $GLOBALS['wp_roles']->role_objects;
-
-        // Get list of roles we can edit
-        $roles = get_editable_roles();
-
-        // For each role object
-        foreach ($roleObjects as $key => $role) {
-
-            // Check if the role exists in list of editable roles and capability
-            // does not exist
-            if (isset($roles[$key]) && ! isset($role->capabilities[$capability])) {
-
-                // Add the role
-                $role->add_cap($capability, $default);
-            }
-        }
     }
 
-
-
 }
 
 ?>
\ No newline at end of file
diff --git a/classes/glmMesGateway.php b/classes/glmMesGateway.php
new file mode 100644 (file)
index 0000000..b2e141d
--- /dev/null
@@ -0,0 +1,218 @@
+<?php
+
+/**
+ * GLM WooCommerce Merchant e-Solutions Gateway
+ * Merchant e-Solutions (MES) Gateway Class
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMerchantESolutions
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @release  classes/glmMesGateway.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
+ * @link     http://dev.gaslightmedia.com/
+ */
+
+/*
+ * MES Gateway class
+ *
+ * Extends the WooCommerce base gateway class. See the following URL.
+ * http://docs.woothemes.com/wc-apidocs/class-WC_Payment_Gateway.html
+ *
+ */
+class GlmMesGateway extends WC_Payment_Gateway
+{
+
+    /**
+     * Gateway ID
+     *
+     * @var $id
+     * @access public
+     */
+    public $id = 'merchant_e_solutions';
+    /**
+     * Gateway Icon URL
+     *
+     * @var $icon
+     * @access public
+     */
+    public $icon = false;
+    /**
+     * Show Payment Fields
+     *
+     * @var $has_fields
+     * @access public
+     */
+    public $has_fields = true;
+    /**
+     * Title of this Payment Gateway
+     *
+     * @var $method_title
+     * @access public
+     */
+    public $method_title = 'Merchant e-Solutions';
+    /**
+     * Payment Gateway Description
+     *
+     * @var $method_description
+     * @access public
+     */
+    public $method_description = 'Processes credit card payments through the Merchant e-Solutions Payment Gateway';
+
+
+    public function __construct ()
+    {
+
+        // Add filter for our gateway
+        add_filter( 'woocommerce_payment_gateways', array( $this, 'glmMesAddGateway') );
+
+        // Setup Fields and Settings
+        $this->glmMesInitFormFields();
+        $this->glmMesInitSettings();
+
+        // Get any settings
+        $this->title = $this->get_option('title');
+
+        add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'glmMesProcessAdminOptions' ) );
+
+    }
+
+    // Tell WooCommerce that we exist
+    public function glmMesAddGateway( $methods )
+    {
+        $methods[] = 'GlmMesGateway';
+        return $methods;
+    }
+
+    /*
+     *  Initialize Form Fields
+     *
+     *  Add form fields to the WooCommerce Checkout page for this gateway
+     */
+
+
+    public function glmMesInitFormFields()
+    {
+
+        $this->form_fields = array(
+
+                // Enable gateway chackbox
+                'enabled' => array(
+                        'title' => __( 'Enable/Disable', 'woocommerce' ),
+                        'type' => 'checkbox',
+                        'label' => __( 'Enable Merchant e-Solutions Gateway', 'woocommerce' ),
+                        'default' => 'yes'
+                ),
+
+                // Title displayed to user for this payment method
+                'title' => array(
+                        'title' => __( 'Title', 'woocommerce' ),
+                        'type' => 'text',
+                        'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce' ),
+                        'default' => __( 'Credit Card Payment', 'woocommerce' ),
+                        'desc_tip'      => true,
+                ),
+
+                // Description to customer at checkout
+                'description' => array(
+                        'title' => __( 'Customer Message', 'woocommerce' ),
+                        'type' => 'textarea',
+                        'default' => ''
+                )
+        );
+
+    }
+
+    // Initialize Settings
+    public function glmMesInitSettings()
+    {
+
+    }
+
+    // Init Form Fields
+    public function glmMesProcessAdminOptions()
+    {
+
+    }
+
+    // Process Admin Options
+    public function glmProcessAdminOptions()
+    {
+
+    }
+
+    // Set Payment Fields
+    public function payment_fields()
+    {
+
+        require_once (GLM_MES_PLUGIN_PATH . '/views/paymentForm.html');
+
+    }
+
+    // Validate Payment Fields
+    public function validate_fields()
+    {
+
+    }
+
+    /*
+     * Process order with MES Gateway
+     */
+    public function process_payment( $order_id ) {
+
+        global $woocommerce;
+        $order = new WC_Order( $order_id );
+
+        /*
+         * Process order here
+         *
+         * Returns various status states
+         */
+        $paymentState = 'complete';
+
+        // Take action based on payment state
+        switch ($paymentState) {
+
+            case 'complete':
+
+                // Mark order as complete
+                $order->payment_complete();
+
+                // Return thank you page redirect
+                return array(
+                        'result' => 'success',
+                        'redirect' => $this->get_return_url( $order )
+                );
+
+                break;
+
+            case 'call_for_approval':
+
+                // Mark as on-hold (use if payment delayed)
+                $order->update_status('on-hold', __( 'Awaiting authorization of Credit Card payment. Please call your Credit Card provider.', 'woocommerce' ));
+                return;
+
+                break;
+
+            case 'fail':
+
+                // Tell the user we had a payment failure
+                wc_add_notice( __('Payment error:', 'woothemes') . $error_message, 'error' );
+                return;
+
+                break;
+
+            default:
+
+                // Need to figure this out
+
+                break;
+
+        }
+
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/classes/glmMesPluginSupport.php b/classes/glmMesPluginSupport.php
new file mode 100644 (file)
index 0000000..d38a172
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+
+/**
+ * GLM WooCommerce Merchant e-Solutions Gateway
+ * Plugin support class
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMerchantESolutions
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @release  classes/glmMesPluginSupport.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
+ * @link     http://dev.gaslightmedia.com/
+ */
+
+/*
+ * This class provides some standard methods used by this plugin
+ */
+class GlmMesPluginSupport
+{
+
+
+}
+
+?>
\ No newline at end of file
diff --git a/classes/glmPluginSupport.php b/classes/glmPluginSupport.php
deleted file mode 100644 (file)
index 7be41a5..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-<?php
-
-/**
- * Gaslight Media Members Database
- * Plugin support class
- *
- * PHP version 5.5
- *
- * @category glmWordPressPlugin
- * @package  glmMembersDatabase
- * @author   Chuck Scott <cscott@gaslightmedia.com>
- * @license  http://www.gaslightmedia.com Gaslightmedia
- * @release  glmPluginSupport.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
- * @link     http://dev.gaslightmedia.com/
- */
-
-/*
- * This class provides some standard methods used by this plugin
- */
-class GlmPluginSupport
-{
-
-    /*
-     * Add a message to the 'glmMembersAdminNotices' option for output later.
-     *
-     * Messages that don't have a $type specified are displayed in
-     * the admin WordPress message area.
-     *
-     * Messages that have a $type are for the debug window and are categorized
-     * as follows and in this order in the debug window
-     *  Alert       Placed sequentially in the Alerts list
-     *  Process     Placed sequentially in the process list
-     *  DataBlock   Placed in a colored data block. Requires a $title
-     *
-     * @param string $message
-     * @param string $type
-     * @param string $title
-     *
-     * @return void
-     * @access public
-     */
-    public static function addNotice ($message, $type = false, $title = false)
-    {
-
-        switch($type) {
-
-            case 'Alert';
-                $alerts = get_option('glmMembersAdminNoticeAlerts');
-                $alerts[] = $message;
-                update_option('glmMembersAdminNoticeAlerts', $alerts);
-                break;
-
-            case 'Process';
-                $process = get_option('glmMembersAdminNoticeProcess');
-                $process[] = $message;
-                update_option('glmMembersAdminNoticeProcess', $process);
-                break;
-
-            case 'DataBlock';
-                $dataBlocks = get_option('glmMembersAdminNoticeDataBlocks');
-                $dataBlocks[] = array('data' => $message, 'title' => $title);
-                update_option('glmMembersAdminNoticeDataBlocks', $dataBlocks);
-                break;
-
-            default;
-                $notices = get_option('glmMembersAdminNotices');
-                $notices[] = $message;
-                update_option('glmMembersAdminNotices', $notices);
-                break;
-
-        }
-
-    }
-
-    /*
-     * Check if this is a second call to the activation hook by WordPress to activate this plugin.
-     *
-     * (Yea, I know that's stupid behavior, but there's nothing I can do about it.)
-     * It tells us this is happening by setting the 'action' GET parameter to 'error_scrape',
-     * which is also stupid.
-     *
-     * In this case, we don't want to try again, so output any saved notices from the first pass
-     * and then exit to tell WordPress the plugin didn't install.
-     *
-     * @return void
-     * @access public
-     */
-    public function checkErrorScrape()
-    {
-
-        // Check for 'action' = 'error_scrape', which indicates a second call from WordPress due to an error.
-        if (isset($_GET['action']) && $_GET['action'] == 'error_scrape') {
-
-            // Sleep for a bit to make sure the glmMembersAdminNotices option is set. (seems to need this)
-            sleep(1);
-
-            // if we have pending messages, display those
-            if (get_option('glmMembersAdminNotices')) {
-
-                glmMembersAdminNotices();
-
-            // Otherwise, there must have been some other error.
-            } else {
-
-                echo 'There has been an unknown error installing the Gaslight Media Members Database plugin.';
-
-            }
-
-            // Quit here so Wordpress doesn't mark plugin as activated or deactivated
-            exit;
-
-        }
-
-    }
-
-}
-
-?>
\ No newline at end of file
index fb2aeef..6d91a15 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Plugin Name: GLM WooCommerce Merchant e-Solutions Gateway
+ * GLM WooCommerce Merchant e-Solutions Gateway
  * Controller
  *
  * PHP version 5.5
  * @link     http://dev.gaslightmedia.com/
  */
 
-// Load glmPluginSupport class
-require_once (GLM_MEMBERS_PLUGIN_PATH . '/classes/glmPluginSupport.php');
+// Load glmMesPluginSupport class
+// require_once (GLM_MES_PLUGIN_PATH . '/classes/glmMesPluginSupport.php');
 
 /*
  * This class controls which models are used.
  */
-class glmMesController extends GlmPluginSupport
+class glmMesController // extends GlmMesPluginSupport
 {
 
     /**
@@ -48,9 +48,24 @@ class glmMesController extends GlmPluginSupport
         // Save plugin configuration object
         $this->config = $config;
 
+        add_action( 'plugins_loaded', array( $this, 'initMesGateway') );
 
     }
 
+    /**
+     * Initialize MES Gateway
+     *
+     * @return void
+     * @access public
+     */
+    public function initMesGateway()
+    {
+        require_once (GLM_MES_PLUGIN_PATH . '/classes/glmMesGateway.php');
+        new glmMesGateway();
+
+    }
+
+
     /**
      * Controller
      *
index f2de196..ed8deb3 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Plugin Name: GLM WooCommerce Merchant e-Solutions Gateway
+ * GLM WooCommerce Merchant e-Solutions Gateway
  * Deactivate Plugin Tasks
  *
  * PHP version 5.5
  * @link     http://dev.gaslightmedia.com/
  */
 
-// Load glmPluginSupport class
-require_once (GLM_MES_PLUGIN_PATH . '/classes/glmPluginSupport.php');
+// Load glmMesPluginSupport class
+require_once (GLM_MES_PLUGIN_PATH . '/classes/glmMesPluginSupport.php');
 
 /*
  * This class performs all necessary additional work when this
  * plugin is deactivated.
  */
-class glmMesPluginDeactivate extends glmPluginSupport
+class glmMesPluginDeactivate // extends glmMesPluginSupport
 {
 
     /**
@@ -46,7 +46,6 @@ class glmMesPluginDeactivate extends glmPluginSupport
      */
     public function __construct ($wpdb, $config)
     {
-
         // Make sure the current user has this capability
         if (!current_user_can('activate_plugins')) {
             die();
@@ -57,35 +56,6 @@ class glmMesPluginDeactivate extends glmPluginSupport
 
         // Save plugin configuration object
         $this->config = $config;
-
-    }
-
-    /*
-     * Remove a role capability from all current roles
-     *
-     * @param string $capability
-     *
-     * @return void
-     * @access public
-     */
-    public function removeRoleCapability ($capability)
-    {
-        // Get list of role objects
-        $roleObjects = $GLOBALS['wp_roles']->role_objects;
-
-        // Get list of roles we can edit
-        $roles = get_editable_roles();
-
-        // For each role object
-        foreach ($roleObjects as $key => $role) {
-            // Check if the role exists in list of editable roles and capability
-            // does not exist
-            if (isset($roles[$key]) && isset($role->capabilities[$capability])) {
-
-                // Remove role
-                $role->remove_cap($capability);
-            }
-        }
     }
 }
 
index 0f7233c..454a5ff 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Plugin Name: GLM WooCommerce Merchant e-Solutions Gateway
+ * GLM WooCommerce Merchant e-Solutions Gateway
  *
  * Set standard defined parameters
  */
index 0a4580d..57d5e1d 100644 (file)
--- a/index.php
+++ b/index.php
@@ -59,20 +59,8 @@ if (isset($configData[$hostSection])) {
 }
 
 // Add Debug defines - These can't go into the defines.php file - Guess why.
-define('GLM_MES_PLUGIN_ADMIN_DEBUG', $config['admin_debug']);
-define('GLM_MES_PLUGIN_ADMIN_DEBUG_VERBOSE', $config['admin_debug_verbose']);
-define('GLM_MES_PLUGIN_FRONT_DEBUG', $config['front_debug']);
-define('GLM_MES_PLUGIN_FRONT_DEBUG_VERBOSE', $config['front_debug_verbose']);
-
-// Also get image sizes array from the plugin.ini - uses separate ini section.
-$config['imageSizes'] = $configData['imageSizes'];
-
-// Get additional configuration data
-$stateData = parse_ini_file(GLM_MES_PLUGIN_PATH.'/config/states.ini');
-$config['states'] = $stateData['states'];
-$countryData = parse_ini_file(GLM_MES_PLUGIN_PATH.'/config/countries.ini');
-$config['countries'] = $countryData['countries'];
-
+define('GLM_MES_PLUGIN_DEBUG', $config['debug']);
+define('GLM_MES_PLUGIN_DEBUG_VERBOSE', $config['debug_verbose']);
 
 /**
  * *******************************************************************************
@@ -119,152 +107,8 @@ register_deactivation_hook(__FILE__, 'glmMesPluginDeactivate');
  *
  */
 
-    require_once (GLM_MES_PLUGIN_PATH . '/controllers/controller.php');
-    new glmMesController($wpdb, $config);
-
-
-/*
- * Function to display admin notices.
- *
- * This function is only called using the add_action('admin_notices','...') function
- * in the code below this function.
- *
- * @return void
- * @access public
- */
-function glmMesAdminNotices($windowed = false)
-{
-
-    $output  = '';
-
-    // If windowed for debug, also include HTML header and stylesheet
-    if ($windowed) {
-
-           $output .= '
-            <html>
-                <head>
-                    <link rel="stylesheet" href="'.GLM_MES_PLUGIN_URL.'/css/admin.css">
-                <head>
-                <body>
-                    <a name="top"></a>
-                    <div id="glm-debug-timestamp">'.date('m/d/Y G:i:s A').'</div>
-                    <div id="glm-debug-header">'.GLM_MES_PLUGIN_NAME.' - Debug Data</div>
-           ';
-
-        // Display alerts
-           $alerts = get_option('glmMesAdminNoticeAlerts');
-           if(is_array($alerts)) {
-              $output .= '<div id="glm-debug-alerts" class="glm-error"><h2>Alerts</h2>';
-               foreach($alerts as $a) {
-               $output .= $a.'<br>';
-           }
-           } else {
-               $output .= '<div id="glm-debug-alerts"><h2>Alerts</h2>';
-           }
-        $output .= '</div><hr>';
-        delete_option('glmMesAdminNoticeAlerts');
-
-           // Display process messages
-        $process = get_option('glmMesAdminNoticeProcess');
-        $output .= '<div id="glm-debug-process"><h2>Processing</h2>';
-        if(is_array($process)) {
-            foreach($process as $p) {
-                $output .= $p.'<br>';
-            }
-        }
-        $output .= '</div><hr>';
-        delete_option('glmMesAdminNoticeProcess');
-
-           // Display data blocks table of contents then the data blocks
-        $dataBlocks = get_option('glmMesAdminNoticeDataBlocks');
-        $output .= '<div id="glm-debug-contents"><h2>Data Blocks</h2><ul>';
-        $n = 0;
-        if (is_array($dataBlocks)) {
-            foreach($dataBlocks as $d) {
-                $output .= '<li><a href="#'.++$n.'">'.$d['title'].'</a></li>';
-            }
-        }
-        $output .= '</ul></div><hr>';
-        if (is_array($dataBlocks)) {
-            reset($dataBlocks);
-            $n = 0;
-            foreach($dataBlocks as $d) {
-                $output .= '
-                    <div  style="margin-top: 2em;">
-                        <div style="float: right;"><a href="#top">[Top]</a></div>
-                        <div class="glm-debug-section-title"><a name="'.++$n.'"><h4>'.$d['title'].'</h4></a></div>
-                        <div class="glm-debug-section-body"><pre>'.print_r($d['data'],1).'</pre></div>
-                    </div>
-                ';
-            }
-        }
-        delete_option('glmMesAdminNoticeDataBlocks');
-
-        echo $output.'
-                </body>
-            </html>
-        ';
-
-    // Otherwise we're outputting data to the message block in the WordPress admin area
-    } else {
-
-        // Start with div class to output in standard admin notice block
-        $output .= '<div class="updated"><p>';
-
-        // Get the notice texts
-        $notices = get_option('glmMesAdminNotices');
-
-        if (is_array($notices) && count($notices) > 0) {
-
-            // For each notice retrieved
-            $br = '';
-            foreach($notices as $n) {
-
-                // Add the notice to the output
-                $output .= $br.$n;
-                $br = '<br>';
-            }
-
-        }
-
-        echo $output.'</p></div>';
-
-        // Delete the option containing the notices to indicate they have been sent
-        delete_option('glmMesAdminNotices');
-
-    }
-
-}
-
-/*
- * Check if there's any startup notices in this file. (stuff that happens before we get all setup)
- *
- * If there is, have the message displayed at the top of the wp-admin content area.
- */
-function glmMesStartupNotices() {
-    global $startupNotices;
-    echo '<div class="updated"><h3>'.GLM_MES_PLUGIN_NAME.' Plugin Warning</h3><p>'.$startupNotices.'</p></div>';
-}
-if ($startupNotices != '') {
-    add_action('admin_notices','glmMesStartupNotices');
-}
-
-/*
- * Check if there's any debug information or other notices that need to be displayed
- *
- * If there is, display as a separate window.
- *
- * NOTE: Need to break out notices that should be displayed in the wp-admin content area. To
- * do that I need to modify the glmMesAdminNotices function above and the
- * addNotice() function in the classes/glmPluginSupport.php file. Should have addNotice()
- * function be able to add to another option specifically for doing this.
- */
-$notices = get_option('glmMesAdminNotices');
-if (is_admin() && $notices && !GLM_MES_PLUGIN_ADMIN_DEBUG) {
-
-    // Add action to output the notices
-    add_action('admin_notices','glmMesAdminNotices');
+require_once (GLM_MES_PLUGIN_PATH . '/controllers/controller.php');
+new glmMesController($wpdb, $config);
 
-}
 
 ?>
\ No newline at end of file
index a553734..d7cf95e 100644 (file)
@@ -1,4 +1,4 @@
-=== Gaslight Media Member Database ===
+=== GLM WooCommerce Merchant e-Solutions Gateway ===
 Contributors: cscott@gaslightmedia.com
 Donate link: http://www.gaslightmedia.com
 Tags: Gaslight Media,Plugin,WooCommerce,Merchant e-Solutions,Mes Payment Gateway
index 168bbdd..cd8e9bd 100644 (file)
@@ -1,16 +1,16 @@
 <?php
 
 /**
- * Gaslight Media Members Database Plugin
+ * GLM WooCommerce Merchant e-Solutions Gateway
  * Uninstall Plugin
  *
  * PHP version 5.5
  *
  * @category glmWordPressPlugin
- * @package  glmMembersDatabase
+ * @package  glmMerchantESolutions
  * @author   Chuck Scott <cscott@gaslightmedia.com>
  * @license  http://www.gaslightmedia.com Gaslightmedia
- * @release  admin.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
+ * @release  uninstall.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
  * @link     http://dev.gaslightmedia.com/
  */
 
@@ -22,30 +22,9 @@ if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
     exit();
 
 // Delete options
-delete_option('glmMembersDatbasePluginVersion');
-delete_option('glmMembersDatabaseDbVersion');
-delete_option('glmMembersAdminNotices');
+delete_option('glmMesPluginVersion');
 
 // Same for Multi-site
-delete_site_option('glmMembersDatbasePluginVersion');
-delete_site_option('glmMembersDatabaseDbVersion');
-delete_site_option('glmMembersAdminNotices');
-
-/*
- * Drop database tables
- */
-// Set current database version
-$dbVersion = GLM_MEMBERS_PLUGIN_DB_VERSION;
-
-// Read in Database deletion script - assumes the current db version.
-$sqlFile = GLM_MEMBERS_PLUGIN_DB_SCRIPTS.'/drop_database_V'.$dbVersion.'.sql';
-$sql = file_get_contents($sqlFile);
-
-// Replace {prefix} with table name prefix
-$sql = str_replace('{prefix}', GLM_MEMBERS_PLUGIN_DB_PREFIX, $sql);
-
-// Removing the tables using the script
-global $wpdb;
-$wpdb->query($sql);
+delete_site_option('glmMesPluginVersion');
 
 ?>
\ No newline at end of file
diff --git a/views/paymentForm.html b/views/paymentForm.html
new file mode 100644 (file)
index 0000000..4448b20
--- /dev/null
@@ -0,0 +1,78 @@
+
+    <style type="text/css">
+        #payment ul.payment_methods li label[for='glm_mes_gateway_payment'] img:nth-child(n+2) { 
+            margin-left:1px; 
+        } 
+        .woocommerce #payment ul.payment_methods li .glm_mes_gateway_payment img, .woocommerce-page #payment ul.payment_methods li .glm_mes_gateway_payment img { 
+            margin-left:0; 
+        }
+    </style>
+    <label for="glm_mes_gateway_payment">
+        Credit Card (put images of accepted cards here)    
+    </label>
+    <div class="payment_box glm_mes_gateway_payment" >
+        <p>Safe and Secure Credit Card Payment.</p>
+        <p>TEST MODE ENABLED</p>
+        <select name="wc-intuit-qbms-test-condition">
+            <option value="">Test an Error Condition:</option>
+            <option value="10200_comm">CC Processing Gateway comm error</option>
+            <option value="10201_login">Processing Gateway login error</option>
+            <option value="10301_ccinvalid">Invalid CC account number</option>
+            <option value="10400_insufffunds">Insufficient funds</option>
+            <option value="10401_decline">Transaction declined</option>
+            <option value="10403_acctinvalid">Invalid merchant account</option>
+            <option value="10404_referral">Declined pending voice auth</option>
+            <option value="10406_capture">Capture error</option>
+            <option value="10500_general">General error</option>
+            <option value="10000_avscvdfail">AVS Failure</option>
+        </select>
+        <fieldset>
+            <div class="wc-intuit-qbms-new-payment-method-form js-wc-intuit-qbms-new-payment-method-form" >
+                <p class="form-row form-row-first">
+                    <label for="wc-intuit-qbms-account-number">Credit Card Number <span class="required">*</span></label>
+                    <input type="text" class="input-text js-wc-payment-gateway-account-number" id="wc-intuit-qbms-account-number" name="wc-intuit-qbms-account-number" maxlength="19" autocomplete="off" value="4111111111111111" />
+                </p>
+        
+                <p class="form-row form-row-last">
+                    <label for="wc-intuit-qbms-exp-month">Expiration Date <span class="required">*</span></label>
+                    <select name="wc-intuit-qbms-exp-month" id="wc-intuit-qbms-exp-month" class="js-wc-payment-gateway-card-exp-month" style="width:auto;">
+                        <option value="">Month</option>
+                        <option value="01"  selected='selected'>01</option>
+                        <option value="02" >02</option>
+                        <option value="03" >03</option>
+                        <option value="04" >04</option>
+                        <option value="05" >05</option>
+                        <option value="06" >06</option>
+                        <option value="07" >07</option>
+                        <option value="08" >08</option>
+                        <option value="09" >09</option>
+                        <option value="10" >10</option>
+                        <option value="11" >11</option>
+                        <option value="12" >12</option>
+                    </select>
+                    <select name="wc-intuit-qbms-exp-year" id="wc-intuit-qbms-exp-year" class="js-wc-payment-gateway-card-exp-year" style="width:auto;">
+                        <option value="">Year</option>
+                        <option value="2015" >2015</option>
+                        <option value="2016"  selected='selected'>2016</option>
+                        <option value="2017" >2017</option>
+                        <option value="2018" >2018</option>
+                        <option value="2019" >2019</option>
+                        <option value="2020" >2020</option>
+                        <option value="2021" >2021</option>
+                        <option value="2022" >2022</option>
+                        <option value="2023" >2023</option>
+                        <option value="2024" >2024</option>
+                        <option value="2025" >2025</option>
+                    </select>
+                </p>
+                <div class="clear"></div>
+    
+                <p class="form-row form-row-wide">
+                    <label for="wc-intuit-qbms-csc">Card Security Code <span class="required">*</span></label>
+                    <input type="text" class="input-text js-wc-intuit-qbms-csc js-wc-payment-gateway-csc" id="wc-intuit-qbms-csc" name="wc-intuit-qbms-csc" maxlength="4" style="width:60px" autocomplete="off" value="123" />
+                </p>
+                <div class="clear js-wc-intuit-qbms-csc-clear"></div>
+            </div>
+        </fieldset>
+    </div>
+        
\ No newline at end of file