Cleaned up a bunch more and started using WooCommerce Default CC Form.
authorChuck Scott <cscott@gaslightmedia.com>
Fri, 3 Apr 2015 05:04:26 +0000 (01:04 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Fri, 3 Apr 2015 05:04:26 +0000 (01:04 -0400)
22 files changed:
assets/amex.png [new file with mode: 0644]
assets/credit.png [new file with mode: 0644]
assets/dankort.png [new file with mode: 0644]
assets/diners.png [new file with mode: 0644]
assets/discover.png [new file with mode: 0644]
assets/forbru.png [new file with mode: 0644]
assets/google.png [new file with mode: 0644]
assets/jcb.png [new file with mode: 0644]
assets/laser.png [new file with mode: 0644]
assets/maestro.png [new file with mode: 0644]
assets/mastercard.png [new file with mode: 0644]
assets/money.png [new file with mode: 0644]
assets/paypa.png [new file with mode: 0644]
assets/shopify.png [new file with mode: 0644]
assets/solo.png [new file with mode: 0644]
assets/visa.png [new file with mode: 0644]
classes/MesTridentGateway.php
classes/glmMesGateway.php
defines.php
index.php
views/paymentForm.html [deleted file]
views/paymentForm.php [new file with mode: 0644]

diff --git a/assets/amex.png b/assets/amex.png
new file mode 100644 (file)
index 0000000..492d40a
Binary files /dev/null and b/assets/amex.png differ
diff --git a/assets/credit.png b/assets/credit.png
new file mode 100644 (file)
index 0000000..0b8f49a
Binary files /dev/null and b/assets/credit.png differ
diff --git a/assets/dankort.png b/assets/dankort.png
new file mode 100644 (file)
index 0000000..400f57c
Binary files /dev/null and b/assets/dankort.png differ
diff --git a/assets/diners.png b/assets/diners.png
new file mode 100644 (file)
index 0000000..72e1808
Binary files /dev/null and b/assets/diners.png differ
diff --git a/assets/discover.png b/assets/discover.png
new file mode 100644 (file)
index 0000000..7e36dd7
Binary files /dev/null and b/assets/discover.png differ
diff --git a/assets/forbru.png b/assets/forbru.png
new file mode 100644 (file)
index 0000000..2668cdb
Binary files /dev/null and b/assets/forbru.png differ
diff --git a/assets/google.png b/assets/google.png
new file mode 100644 (file)
index 0000000..ab9566b
Binary files /dev/null and b/assets/google.png differ
diff --git a/assets/jcb.png b/assets/jcb.png
new file mode 100644 (file)
index 0000000..9bb0cba
Binary files /dev/null and b/assets/jcb.png differ
diff --git a/assets/laser.png b/assets/laser.png
new file mode 100644 (file)
index 0000000..2f24179
Binary files /dev/null and b/assets/laser.png differ
diff --git a/assets/maestro.png b/assets/maestro.png
new file mode 100644 (file)
index 0000000..38fdb4b
Binary files /dev/null and b/assets/maestro.png differ
diff --git a/assets/mastercard.png b/assets/mastercard.png
new file mode 100644 (file)
index 0000000..af9b1d7
Binary files /dev/null and b/assets/mastercard.png differ
diff --git a/assets/money.png b/assets/money.png
new file mode 100644 (file)
index 0000000..a99814a
Binary files /dev/null and b/assets/money.png differ
diff --git a/assets/paypa.png b/assets/paypa.png
new file mode 100644 (file)
index 0000000..4fad9d8
Binary files /dev/null and b/assets/paypa.png differ
diff --git a/assets/shopify.png b/assets/shopify.png
new file mode 100644 (file)
index 0000000..f40146b
Binary files /dev/null and b/assets/shopify.png differ
diff --git a/assets/solo.png b/assets/solo.png
new file mode 100644 (file)
index 0000000..c236ecc
Binary files /dev/null and b/assets/solo.png differ
diff --git a/assets/visa.png b/assets/visa.png
new file mode 100644 (file)
index 0000000..ffd17c5
Binary files /dev/null and b/assets/visa.png differ
index 1d9bce7..2978140 100644 (file)
@@ -106,6 +106,7 @@ class TpgTransaction
             wc_add_notice('GLM MeS Gateway: TpgTransaction::execute() called', 'success' );
         }
 
+        $url = '';
         if ($this->isValid()) {
             $url .= "profile_id=" . $this->ProfileId;
             $url .= "&profile_key=" . $this->ProfileKey;
@@ -180,7 +181,7 @@ class TpgTransaction
         $this->ResponseRaw = $response;
         $responseFields = explode("&", $response);
 
-        if (GLM_MES_DEBUG && count($responseField) == 0) {
+        if (GLM_MES_DEBUG && count($responseFields) == 0) {
             wc_add_notice('GLM MeS Gateway: parseResponse()<p>No Response Received!</p>', 'error' );
         }
 
@@ -324,11 +325,9 @@ class TpgPreAuth extends TpgTransaction
 class TpgSale extends TpgTransaction
 {
 
-    function TpgSale ($profileId, $profileKey, $setings)
+    function TpgSale ($profileId, $profileKey)
     {
 
-        $this->settings = $settings;
-
         if (GLM_MES_DEBUG_VERBOSE) {
             wc_add_notice('GLM MeS Gateway: TpgSale() called<p>', 'success' );
         }
index fa3f8cd..c83ad79 100644 (file)
  * Extends the WooCommerce base gateway class. See the following URL.
  * http://docs.woothemes.com/wc-apidocs/class-WC_Payment_Gateway.html
  *
+ * Development Credentials
+ * Merchant Name       Gaslight Media
+ * Profile ID          94100012117800000059
+ * Profile Key         cBCBDBscxFpIRCJzcBqnKFORrBcNJXCt
+ * Request URL         https://cert.merchante-solutions.com/mes-api/tridentApi
+ *
  */
 class GlmMesGateway extends WC_Payment_Gateway
 {
 
    /**
-     * Gateway ID
-     *
-     * @var $id
-     * @access public
-     */
-    public $id = 'merchant_e_solutions';
-   /**
-     * Gateway Title
+     * Cards Accepted
      *
-     * @var $title
+     * @var $visa
+     * @var $mastercard
+     * @var $amex
      * @access public
      */
-    public $title;
-   /**
-     * Gateway Description
+    public $visa = false;
+    public $mastercard = false;
+    public $amex = false;
+    /**
+     * Transaction Mode
      *
-     * @var $description
+     * @var $transaction_mode
      * @access public
      */
-    public $description;
+    public $transaction_mode;
     /**
      * 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';
-    /**
+    public $icon;
+   /**
      * Profile ID
      *
      * @var $profile_id
@@ -87,6 +76,30 @@ class GlmMesGateway extends WC_Payment_Gateway
      * @access public
      */
     public $url;
+    /**
+     * Credit Card Months
+     *
+     * @var $cc_months
+     * @access public
+     */
+    public $cc_months;
+    /**
+     * Credit Card Exp Years
+     *
+     * @var $cc_start_year
+     * @var $cc_end_year
+     * @access public
+     */
+    public $cc_start_year;
+    public $cc_end_year;
+    /**
+     * Cleaned User Input Array
+     *
+     * @var $glm_mes_in
+     * @access public
+     */
+    public $glm_mes_in;
+
 
 
     public function __construct ()
@@ -94,12 +107,38 @@ class GlmMesGateway extends WC_Payment_Gateway
         // Add filter for our gateway
         add_filter( 'woocommerce_payment_gateways', array( $this, 'glmMesAddGateway') );
 
+        $this->id = GLM_MES_ID;
+
+        // Title of gateway and description displayed in WooCommerce Checkout configuration pages
+        $this->method_title = __( GLM_MES_SHORT_NAME, GLM_MES_ID );
+        $this->method_description = __( GLM_MES_DESCRIPTION, GLM_MES_ID );
+
+        // Icon displayed with gateway in checkout page
+        $this -> icon = GLM_MES_ICON;
+
+        // Displays checkout fields for "direct" integration
+        $this->has_fields = true;
+
+        // Supports the default credit card form
+        $this->supports = array( 'default_credit_card_form' );
+
         // Setup Fields and Settings
         $this->init_form_fields();
         $this->init_settings();
 
-        $this -> title = $this -> settings['title'];
-        $this -> description = $this -> settings['description'];
+        // Get the title and description for this checkout method to use in checkout page
+        $this->title = $this->get_option( 'title' );
+        $this->description = $this->get_option( 'description' );
+
+        // Add credit cards available to the description
+        $this->description .= '<h4>Credit Cards Accepted</h4><p>'
+            .($this->settings['visa'] == 'yes' ? '<img src="'.GLM_MES_ASSETS_URL.'/visa.png">' : '')
+            .($this->settings['mastercard'] == 'yes' ? '<img src="'.GLM_MES_ASSETS_URL.'/mastercard.png">' : '')
+            .($this->settings['amex'] == 'yes' ? '<img src="'.GLM_MES_ASSETS_URL.'/amex.png">' : '')
+            .'</p>';
+
+        // Set the transaction mode selected in the WooCommerce Checkout configuration page for this gateway
+        $this -> transaction_mode = $this->settings['transaction_mode'];
 
         // Determine if we're in test or production mode
         switch ($this -> settings['transaction_mode']) {
@@ -167,9 +206,42 @@ class GlmMesGateway extends WC_Payment_Gateway
 
                 // Description to customer at checkout
                 'description' => array(
-                        'title' => __( 'Customer Message', 'woocommerce' ),
+                        'title' => __( 'Description', 'woocommerce' ),
                         'type' => 'textarea',
-                        'default' => ''
+                        'default' => 'A description of this payment method to the user at checkout. Include cards accepted, etc.'
+                ),
+
+                'sep_0' => array(
+                        'title'       => __( 'Credit Cards Accepted', 'woocommerce' ),
+                        'type'        => 'title',
+                        'description' => '',
+                ),
+
+                // Visa
+                'visa' => array(
+                        'title'       => __( '', 'woocommerce' ),
+                        'type'        => 'checkbox',
+                        'label' => __( 'Visa', 'woocommerce' ),
+                        'desc_tip'    => false,
+                        'default' => 'no'
+                ),
+
+                // MasterCard
+                'mastercard' => array(
+                        'title'       => __( '', 'woocommerce' ),
+                        'type'        => 'checkbox',
+                        'label' => __( 'MasterCard', 'woocommerce' ),
+                        'desc_tip'    => false,
+                        'default' => 'no'
+                ),
+
+                // Amex
+                'amex' => array(
+                        'title'       => __( '', 'woocommerce' ),
+                        'type'        => 'checkbox',
+                        'label' => __( 'American Express', 'woocommerce' ),
+                        'desc_tip'    => false,
+                        'default' => 'no'
                 ),
 
                 'sep_1' => array(
@@ -272,39 +344,83 @@ class GlmMesGateway extends WC_Payment_Gateway
 
     }
 
+/*
     // Set Payment Fields
     public function payment_fields()
     {
-        require_once (GLM_MES_PLUGIN_PATH . '/views/paymentForm.html');
+        // Set start and end years for card expiration
+        $this->cc_start_year = date('Y');
+        $this->cc_end_year =  $this->cc_start_year + GLM_MES_EXPIRE_YEARS;
+
+        if (GLM_MES_DEBUG_VERBOSE) {
+            wc_add_notice('GLM MeS Gateway: Parameters available to payment form...<p><pre>'.print_r($this,1).'</pre></p>', 'success' );
+        }
+
+        require_once (GLM_MES_PATH . '/views/paymentForm.php');
     }
 
     // Validate Payment Fields
     public function validate_fields()
     {
 
+//        $this->$glm_mes_in['account_number'] =
+//        $this->sanitize_text_field(  )
     }
+*/
 
     /*
      * Process order with MES Gateway
      */
     public function process_payment( $order_id ) {
 
+        // Get a copy of our order
         global $woocommerce;
-        $order = new WC_Order( $order_id );
+        $custOrder = new WC_Order( $order_id );
+
+        // Get our invoice number
+        $invNumb = str_replace( "#", "", $custOrder->get_order_number() );
+
+        // Clean up the submitted credit card data
+        $ccNumb = str_replace( array(' ', '-' ), '', $_POST[GLM_MES_ID.'-card-number'] );
+        $cc_exp = str_replace( array( '/', ' '), '', $_POST[GLM_MES_ID.'-card-expiry'] );
+        $cc_cvc = ( isset( $_POST[GLM_MES_ID.'-card-cvc'] ) ) ? $_POST[GLM_MES_ID.'-card-cvc'] : '';
+
+        /* Some other things available to us
+         $custOrder->billing_first_name,
+         $custOrder->billing_last_name,
+         $custOrder->billing_address_1,
+         $custOrder->billing_city,
+         $custOrder->billing_state,
+         $custOrder->billing_postcode,
+         $custOrder->billing_country,
+         $custOrder->billing_phone,
+         $custOrder->billing_email,
+         $custOrder->shipping_first_name,
+         $custOrder->shipping_last_name,
+         $custOrder->shipping_company,
+         $custOrder->shipping_address_1,
+         $custOrder->shipping_city,
+         $custOrder->shipping_country,
+         $custOrder->shipping_state,
+         $custOrder->shipping_postcode,
+         $custOrder->user_id,
+         $_SERVER['REMOTE_ADDR'],
+        */
 
         if (GLM_MES_DEBUG_VERBOSE) {
             wc_add_notice('GLM MeS Gateway: process_payment() called', 'success' );
+            wc_add_notice('GLM MeS Gateway: Customer Order Data<p><pre>'.print_r($custOrder,1).'</pre></p>', 'success' );
         }
 
         // Create transaction object
-        require_once (GLM_MES_PLUGIN_CLASS_PATH . '/MesTridentGateway.php');
+        require_once (GLM_MES_CLASS_PATH . '/MesTridentGateway.php');
         $trans = new TpgSale( $this->profile_id, $this->profile_key, $this->settings );
 
         // Set transaction data
-        $trans->setAvsRequest( '123 Main Street', '55555' );
-        $trans->setRequestField('cvv2', '123');
-        $trans->setRequestField('invoice_number','123456');
-        $trans->setTransactionData( "4012888812348882", "1212", "1.00" );
+        $trans->setAvsRequest( $custOrder->billing_address_1, $custOrder->billing_postcode );
+        $trans->setRequestField('cvv2', $cc_cvc);
+        $trans->setRequestField('invoice_number', $invNumb);
+        $trans->setTransactionData( $ccNumb, $cc_exp, $custOrder->order_total );
 
         // Call the MeS Gateway
         $trans->setHost($this->host);
@@ -316,14 +432,15 @@ class GlmMesGateway extends WC_Payment_Gateway
         $trans->execute();
 
         if (GLM_MES_DEBUG_VERBOSE) {
-            wc_add_notice('GLM MeS Gateway: Transaction Response<p>'.$this->ErrorMessage.'<br><pre>'.print_r($tran->ResponseFields,1).'</pre></p>', 'success');
+            wc_add_notice('GLM MeS Gateway: Response Fields<p><pre>'.print_r($tran2->ResponseFields,1).'</pre></p>', 'success');
         }
 
         // Check result
-        if( $tran->isApproved() ) {
+        if( $trans->isApproved() ) {
             $paymentState = 'approved';
         } else {
             $paymentState = 'fail';
+            $errorMsg = $trans->ResponseFields['auth_response_text'];
         }
 
         // Take action based on payment state
@@ -353,7 +470,12 @@ class GlmMesGateway extends WC_Payment_Gateway
             case 'fail':
 
                 // Tell the user we had a payment failure
-                wc_add_notice( __('Payment error:', 'woothemes') . $error_message, 'error' );
+                wc_add_notice( __("<h4>We're sorry, there was a problem with your payment...</h4><p><b>Reason:</b> ".$errorMsg.'</p><p>Please check your credit card information and try again.', 'woothemes') . $error_message, 'error' );
+
+                if (GLM_MES_DEBUG && !GLM_MES_DEBUG_VERBOSE) {
+                    wc_add_notice('GLM MeS Gateway: Response Fields<p><pre>'.print_r($trans->ResponseFields,1).'</pre></p>', 'success');
+                }
+
                 return;
 
                 break;
index c1c0035..53400ec 100644 (file)
@@ -5,15 +5,30 @@
  * Set standard defined parameters
  */
 
-define('GLM_MES_PLUGIN_NAME', 'Gaslight Media WooCommerce Merchant e-Solutions Gateway');
-define('GLM_MES_PLUGIN_DIR', 'glm-woocommerce-merchant-e-solutions-gateway');
+define('GLM_MES_NAME', 'Gaslight Media WooCommerce Merchant e-Solutions Gateway');
+define('GLM_MES_SHORT_NAME', 'GLM Merchant e-Solutions');
+define('GLM_MES_DESCRIPTION', 'A Merchant e-Solutions payment Gateway plug-in for WooCommerce.');
+define('GLM_MES_ID', 'glm-merchant_e_solutions');
 
 // Plugin Versions
-define('GLM_MES_PLUGIN_VERSION', 0.1);
-define('GLM_MES_PLUGIN_DB_VERSION', 0.1);
+define('GLM_MES_VERSION', 0.1);
 
 // Directories
-define('GLM_MES_PLUGIN_PATH', dirname(__FILE__));
-define('GLM_MES_PLUGIN_CLASS_PATH', GLM_MES_PLUGIN_PATH.'/classes');
+define('GLM_MES_DIR', 'glm-woocommerce-merchant-e-solutions-gateway');
+define('GLM_MES_PATH', dirname(__FILE__));
+define('GLM_MES_CLASS_PATH', GLM_MES_PATH.'/classes');
+define('GLM_MES_ASSETS_PATH', GLM_MES_PATH.'/assets');
+
+// URLs
+$pUrl = plugins_url( GLM_MES_DIR );
+define('GLM_MES_URL', $pUrl);
+define('GLM_MES_ASSETS_URL', GLM_MES_URL.'/assets');
+
+// Optional Gateway Icon
+//define('GLM_MES_ICON', GLM_MES_ASSETS_URL.'/{place_icon_filename_here');
+define('GLM_MES_ICON', null);
+
+// Other Settings
+define('GLM_MES_EXPIRE_YEARS', 10);
 
 ?>
\ No newline at end of file
index 34454e6..c12332b 100644 (file)
--- a/index.php
+++ b/index.php
@@ -64,7 +64,7 @@ require_once('defines.php');
 // Activate
 function glmMesPluginActivate ()
 {
-    require_once (GLM_MES_PLUGIN_PATH . '/activate.php');
+    require_once (GLM_MES_PATH . '/activate.php');
     new glmMesPluginActivate();
 }
 register_activation_hook(__FILE__, 'glmMesPluginActivate');
@@ -72,7 +72,7 @@ register_activation_hook(__FILE__, 'glmMesPluginActivate');
 // Deactivate
 function glmMesPluginDeactivate ()
 {
-    require_once (GLM_MES_PLUGIN_PATH . '/deactivate.php');
+    require_once (GLM_MES_PATH . '/deactivate.php');
     $x = new glmMesPluginDeactivate();
     return false;
 }
@@ -95,7 +95,7 @@ add_action( 'plugins_loaded', 'initMesGateway' );
  */
 function initMesGateway()
 {
-    require_once (GLM_MES_PLUGIN_CLASS_PATH . '/glmMesGateway.php');
+    require_once (GLM_MES_CLASS_PATH . '/glmMesGateway.php');
     new glmMesGateway();
 }
 
diff --git a/views/paymentForm.html b/views/paymentForm.html
deleted file mode 100644 (file)
index 4448b20..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-
-    <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
diff --git a/views/paymentForm.php b/views/paymentForm.php
new file mode 100644 (file)
index 0000000..cd42544
--- /dev/null
@@ -0,0 +1,84 @@
+
+    <style type="text/css">
+        .form-row {
+            margin-bottom: 1em !important;
+        }
+        .glm-mes-field {
+            clear: both;
+        }
+        .glm-test-mode {
+            border: 1px solid black;
+            width: 95%;
+            text-align: center;
+            padding: 5px;
+            margin-bottom: 10px;
+            background-color: lightblue;
+        }
+        #glm-mes-section {
+            clear: both;
+        }
+        .glm-mes-card-types {
+            margin: 0px !important;
+        }
+        .glm-mes-card-img {
+            padding-right: .5em !important;
+        }
+        .glm-form-input-text {
+            background: #fff !important;
+        }
+    </style>
+
+<?php
+    if ($this->transaction_mode == 'test') {
+        echo '<div class="glm-test-mode">Operating in Test Mode</div>';
+    }
+?>
+   
+    <div id="glm-mes-section">
+        <p><?php echo $this->customer_message; ?></p>
+        <div class="glm-mes-cc-form" >
+            <p class="form-row">
+                <label>Cards Accepted</label>
+                <div class="glm-mes-card-types">
+                    <?php
+                        if ($this->visa == 'yes')           { echo '<img class="glm-mes-card-img" src="'.GLM_MES_ASSETS_URL.'/visa.png">'; }
+                        if ($this->mastercard == 'yes')     { echo '<img class="glm-mes-card-img" src="'.GLM_MES_ASSETS_URL.'/mastercard.png">'; }
+                        if ($this->amex == 'yes')           { echo '<img class="glm-mes-card-img" src="'.GLM_MES_ASSETS_URL.'/amex.png">'; }        
+                    ?>
+                </div>
+            </p>
+            <p>&nbsp;</p>
+            <p class="form-row">
+                <label for="glm_mes_account-number">Credit Card Number <span class="required">*</span></label>
+                <input type="text" class="input-text glm-form-input-text" id="glm-mes-account-number" name="glm_mes_account_number" maxlength="19" autocomplete="off" value="" />
+            </p>
+            <p class="form-row">
+                <label for="glm-mes-name-on-card">Name on Card <span class="required">*</span></label>
+                <input type="text" class="input-text glm-form-input-text" id="glm-mes-name-on-card" name="glm_mes_name_on_card" maxlength="60" autocomplete="off" value="" />
+            </p>
+            <p class="form-row">
+                <label for="glm-mes-exp-month">Expiration Date <span class="required">*</span></label>
+                <select name="glm_mes_exp_month" id="glm-mes-exp-month" class="" style="width:auto;">
+                    <option value="">Month</option>
+<?php
+    foreach ($this->cc_months as $k=>$v) {
+        echo '<option value="'.$k.'"'.($this->cc_month_month==$k?' selected="selected"':'').'>'.$k.' - '.$v.'</option>';
+    }
+?>                    
+                </select>
+                <select name="glm_mes_exp_year" id="glm-mes-exp-year" class="" style="width:auto;">
+                    <option value="">Year</option>
+<?php
+    for ($y=$this->cc_start_year ; $y<=$this->cc_end_year ; $y++) {
+        echo '<option value="'.$y.'"'.($this->glm_mes_exp_year==$y?' selected="selected"':'').'>'.$y.'</option>';
+    }
+?>                    
+                </select>
+            </p>
+            <p class="form-row">
+                <label for="glm-mes-security-code">Card Security Code <span class="required">*</span></label>
+                <input type="text" class="input-text glm-form-input-text" id="glm-mes-security-code" name="glm-mes-security-code" maxlength="4" style="width:60px" autocomplete="off" value="" />
+            </p>
+        </div>
+    </div>
+        
\ No newline at end of file