Completed Review of Checkout Processes
authorChuck Scott <cscott@gaslightmedia.com>
Wed, 21 Feb 2018 13:53:51 +0000 (08:53 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Wed, 21 Feb 2018 13:53:51 +0000 (08:53 -0500)
Fixed issues with not being able to store results and other fixes in checkoutProcess.php
Added remaining payment methods to summaryStore.html
Updated summary header info for more complete payment status in cartSummary.html
Addedd updateAccountBillingOnly() and create date set in post processing to dataAccount.php

classes/data/dataAccount.php
models/front/registrations/checkout.php
models/front/registrations/checkoutProcess.php
models/front/registrations/list.php
views/front/registrations/cartSummary.html
views/front/registrations/checkout.html
views/front/registrations/list.html
views/front/registrations/summaryStore.html

index 4852678..d17786b 100644 (file)
@@ -594,6 +594,39 @@ class GlmDataRegistrationsAccount extends GlmDataAbstract
 
     }
 
+    /**
+     * Entry Post Processing Call-Back Method
+     *
+     * Perform post-processing for all result entries.
+     *
+     * @param array  $r Array of field result data for a single entry
+     * @param string $a Action being performed (l, i, g, ...)
+     *
+     * @return object Class object
+     *
+     */
+    public function entryPostProcessing( $result_data, $action )
+    {
+
+        // If doing the following actions
+        if (in_array($action, array('i'))) {
+
+            // Set the created date
+            $date = date('Y-m-d');
+            $this->wpdb->update(
+                GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_request_event",
+                array('date_created' => $deate),
+                array('id' => $result_data['id']),
+                array('%s')
+            );
+
+        }
+
+        return $result_data;
+
+    }
+
+
     public function checkOther($r, $a)
     {
 
@@ -638,4 +671,42 @@ class GlmDataRegistrationsAccount extends GlmDataAbstract
         return $r;
 
     }
+
+    /**
+     * Update Account Billing Only
+     *
+     * @param integer $requestId ID of registration request
+     *
+     * @return object Class object
+     */
+    public function updateAccountBillingOnly($accountId = false)
+    {
+
+        $savedFields = $this->fields;
+
+        $this->fields = array(
+            'email'         => $savedFields['email'],
+            'bill_fname'    => $savedFields['bill_fname'],
+            'bill_lname'    => $savedFields['bill_lname'],
+            'bill_org'      => $savedFields['bill_org'],
+            'bill_title'    => $savedFields['bill_title'],
+            'bill_addr1'    => $savedFields['bill_addr1'],
+            'bill_addr2'    => $savedFields['bill_addr2'],
+            'bill_city'     => $savedFields['bill_city'],
+            'bill_state'    => $savedFields['bill_state'],
+            'bill_zip'      => $savedFields['bill_zip'],
+            'bill_country'  => $savedFields['bill_country'],
+            'bill_phone'    => $savedFields['bill_phone'],
+            'bill_fax'      => $savedFields['bill_fax']
+        );
+
+        $requestSimplified = $this->getEntry($accountId);
+
+        $this->fields = $savedFields;
+        $this->postProcRegRequest = $savedPostProcess;
+
+        return $requestSimplified;
+
+    }
+
 }
index 7f7dd4e..70b3021 100644 (file)
@@ -127,9 +127,6 @@ class GlmMembersFront_registrations_checkout extends GlmRegCartSupport
             }
         }
 
-        // Get any already submitted comp code
-        /**** NEED TO DO THIS ****/
-
         $view = 'checkout';
 
         if ($haveCart) {
@@ -137,6 +134,37 @@ class GlmMembersFront_registrations_checkout extends GlmRegCartSupport
             // Try to validate the cart with updated totals
             $this->checkRegistrationRequest($cartId);
 
+            // Check if cart has been successfully checked out or has been marked canceled.
+            if ($this->cart['request']['status']['value'] > 0) {
+
+                $messages[] = "This request has already been submitted!<br>The information below is a summary of your submitted request.";
+
+echo "<pre>".print_r($this->cart,1)."</pre>";
+                // Build check code for display of summary in iframe
+                $summaryCheck = md5($this->cart['request']['id'].GLM_MEMBERS_REGISTRATIONS_PLUGIN_SECRET.$this->cart['request']['account']);
+
+                $view = 'summary';
+
+                // Compile template data
+                $templateData = array(
+                    'haveMessages'  => count($messages),
+                    'messages'      => $messages,
+                    'requestId'     => $this->cart['request']['id'],
+                    'summaryCheck'  => $summaryCheck,
+                    'misc'          => $misc
+                );
+
+                // Return status, any suggested view, and any data to controller
+                return array(
+                    'status'        => true,
+                    'modelRedirect' => false,
+                    'view'          => 'front/registrations/' . $view . '.html',
+                    'data'          => $templateData
+                );
+
+            }
+
+
         }
 
         $regAccountId = $this->cart['request']['account'];
index fb58242..cd163bb 100644 (file)
@@ -106,6 +106,8 @@ class GlmMembersFront_registrations_checkoutProcess extends GlmRegCartSupport
         $ccConfirmation = '';
         $emailError     = false;
         $passwordError  = false;
+        $reqData        = array();
+        $reqFormat      = array();
 
         $Account = new GlmDataRegistrationsAccount($this->wpdb, $this->config);
         $Request = new GlmDataRegistrationsRegRequest($this->wpdb, $this->config);
@@ -135,7 +137,7 @@ class GlmMembersFront_registrations_checkoutProcess extends GlmRegCartSupport
         }
 
         // Check if cart has been successfully checked out or has been marked canceled.
-        if ($this->cart['request']['status']['value'] > 0) {
+        if ($this->cart['request']['status']['name'] != 'CART') {
 
             $messages[] = "This request has already been submitted!<br>The information below is a summary of your submitted request.";
 
@@ -167,11 +169,6 @@ class GlmMembersFront_registrations_checkoutProcess extends GlmRegCartSupport
          * Submission account?
          */
 
-        // Check if we need to collect billing account information or if it's the same as the main contact
-//        if (isset($_REQUEST['billing_same']) && $_REQUEST['billing_same']) {
-//            $billingSame = true;
-//        }
-
         if (count($messages) == 0) {
 
             // If there's a logged in registrations user - Cart should already be with this account
@@ -184,25 +181,13 @@ class GlmMembersFront_registrations_checkoutProcess extends GlmRegCartSupport
 
                 // Try to update the account information and if that works get the data for editing again
                 if ($accountId > 0) {
-/*
-                    $regAccount = $Account->updateEntry($accountId);
-
-                    // If there was a problem, indicate that
-                    if (!$regAccount) {
-                        $messages[] = 'Unable to recall your account information. Please try again later.';
-
-                    // Otherwise get the data again prepaired for editing
-                    } else {
-*/
-                        $regAccount = $Account->editEntry($accountId);
-  //                  }
+                    $regAccount = $Account->updateAccountBillingOnly($accountId);
                 }
 
             // Otherwise this is a guest so try to create the account using the submitted data
             } else {
 
                 // Create the new account
-                $Account = new GlmDataRegistrationsAccount($this->wpdb, $this->config);
                 $regAccount = $Account->insertEntry();
 
                 // If that was successful
@@ -245,20 +230,12 @@ class GlmMembersFront_registrations_checkoutProcess extends GlmRegCartSupport
 
                 }
 
-// echo "Form Result: <pre>".print_r($formResult,1)."</pre>";
-
                 // Save the results in the cart event data
                 $this->cart['events'][$eventKey]['customForm'] = $formResult;
 
             }
         }
 
-// echo "<pre>".print_r($this->cart['events'],1)."</pre>";
-
-
-// wp_die("KILLING WORDPRESS FOR TESTING IN checkoutProcess.php");
-
-
         /*
          * Policies accepted?
          */
@@ -307,47 +284,23 @@ class GlmMembersFront_registrations_checkoutProcess extends GlmRegCartSupport
             $payMethod = ($_REQUEST['payMethod'] - 0);
         }
 
-        // Make sure that the selected payment method is available
-        if ($payMethod > 0 && ($management['reg_payment_methods']['bitmap'][$payMethod]['default'])) {
-            $payMethodName = $management['reg_payment_methods']['bitmap'][$payMethod]['name'];
-        } else {
-            $payMethod = false;
-        }
-
-        // Check if Billing data source fields
-        $billPrefix = 'bill_';
-        if (isset($_REQUEST['billing_same']) && $_REQUEST['billing_same']) {
-            $billPrefix = '';
-        }
+        // Add billing information to billing array
         $billing = array(
-            'fname'   => $regAccount['fieldData'][$billPrefix.'fname'],
-            'lname'   => $regAccount['fieldData'][$billPrefix.'lname'],
-            'addr1'   => $regAccount['fieldData'][$billPrefix.'addr1'],
-            'addr2'   => $regAccount['fieldData'][$billPrefix.'addr2'],
-            'city'    => $regAccount['fieldData'][$billPrefix.'city'],
-            'state'   => $regAccount['fieldData'][$billPrefix.'state']['value'],
-            'country' => $regAccount['fieldData'][$billPrefix.'country']['value'],
-            'zip'     => $regAccount['fieldData'][$billPrefix.'zip'],
-            'phone'   => $regAccount['fieldData'][$billPrefix.'phone'],
+            'fname'   => $regAccount['fieldData']['bill_fname'],
+            'lname'   => $regAccount['fieldData']['bill_lname'],
+            'addr1'   => $regAccount['fieldData']['bill_addr1'],
+            'addr2'   => $regAccount['fieldData']['bill_addr2'],
+            'city'    => $regAccount['fieldData']['bill_city'],
+            'state'   => $regAccount['fieldData']['bill_state']['value'],
+            'country' => $regAccount['fieldData']['bill_country']['value'],
+            'zip'     => $regAccount['fieldData']['bill_zip'],
+            'phone'   => $regAccount['fieldData']['bill_phone'],
             'email'   => $regAccount['fieldData']['email']
         );
 
         // Execute selected payment method
         switch ($payMethod) {
 
-            /*
-            submission_status_numb['CART']                  = 0
-            submission_status_numb['COMPLETE']              = 10
-            submission_status_numb['UNPAID']                = 20
-            submission_status_numb['CC_PEND']               = 30
-            submission_status_numb['CC_DECL']               = 40
-            submission_status_numb['PAYMENT_PEND']          = 50
-            submission_status_numb['ON_ARRIVAL']            = 60
-            submission_status_numb['ADMIN_HOLD']            = 70
-            submission_status_numb['FAILED']                = 80
-            submission_status_numb['CANCELED']              = 99
-            */
-
             // No Charge
             case $this->config['payment_method_numb']['NoCharge']:
                 $cartStatus = $this->config['submission_status_numb']['COMPLETE'];
@@ -367,21 +320,37 @@ class GlmMembersFront_registrations_checkoutProcess extends GlmRegCartSupport
             case $this->config['payment_method_numb']['Check']:
 
                 // Get the check input
-                $cardData = array(
-                'cc_name' => filter_input(INPUT_POST, 'cc_name', FILTER_SANITIZE_STRING),       // Name on Check
-                'cc_numb' => filter_input(INPUT_POST, 'cc_numb', FILTER_SANITIZE_NUMBER_INT)    // Check Number
+                $checkData = array(
+                    'cc_name' => filter_input(INPUT_POST, 'cc_name', FILTER_SANITIZE_STRING),       // Name on Check
+                    'cc_numb' => filter_input(INPUT_POST, 'cc_numb', FILTER_SANITIZE_NUMBER_INT)    // Check Number
                 );
 
-                // Check all credit card input
+                // Check all check input
                 if (
-                    $cardData['cc_name'] && $cardData['cc_name'] != '' &&   // Name on Check
-                    $cardData['cc_numb'] && $cardData['cc_numb'] > 0        // Check Number
+                    $checkData['cc_name'] && $checkData['cc_name'] != '' &&   // Name on Check
+                    $checkData['cc_numb'] && $checkData['cc_numb'] > 0        // Check Number
                     ) {
                         $cartStatus = $this->config['submission_status_numb']['COMPLETE'];
                     } else {
                         $messages[] = 'You did not supply all required check information.';
                     }
 
+                // Add check data to storage
+                $reqData = array_merge(
+                    $reqData,
+                    array(
+                        'cc_name' => $checkData['cc_name'],     // Name on Check
+                        'cc_numb' => $checkData['cc_numb']      // Check Number
+                    )
+                );
+                $reqFormat = array_merge(
+                    $reqFormat,
+                    array(
+                        '%s',
+                        '%s'
+                    )
+                );
+
                 break;
 
             // Payment Pending
@@ -473,7 +442,7 @@ class GlmMembersFront_registrations_checkoutProcess extends GlmRegCartSupport
 
                     $payment = array(
                         'name'    => $this->config['settings']['reg_org_name'],  // Name of venue
-                        'charge'  => $this->cart['totalCharges'],                // Total charges this venue
+                        'charge'  => $this->cart['totalCharges'],                // Total charges
                         'cctype'  => $cardData['cc_type'],                       // Card Type
                         'ccname'  => $cardData['cc_name'],                       // Name on Card
                         'ccnumb'  => $cardData['cc_numb'],                       // Card Number
@@ -487,41 +456,61 @@ class GlmMembersFront_registrations_checkoutProcess extends GlmRegCartSupport
 
                     // If successful submission - say we're complete
                     if (is_array($ccResult) && isset($ccResult['status']) && $ccResult['status'] == 1) {
+
                         $cartStatus = $this->config['submission_status_numb']['COMPLETE'];
-                    }
 
-                    // set $ccConfirmation
+                        // Store Credit Card information
+                        $cc_numb_store = '....'.substr($payment['ccnumb'], -4);
+                        $reqData = array_merge(
+                            $reqData,
+                            array(
+                                'cc_type' => $payment['cctype'],
+                                'cc_name' => $payment['ccname'],
+                                'cc_numb' => $cc_numb_store,
+                                'cc_exp'  => $payment['ccexp'],
+                                'cc_conf' => $ccConfirmation,
+                            )
+                        );
+                        $reqFormat = array_merge(
+                            $reqFormat,
+                            array(
+                                '%d',
+                                '%s',
+                                '%s',
+                                '%s',
+                                '%s',
+                            )
+                        );
+
+                    }
 
                 }
 
                 break;
 
             // Pay Pal
-            case $this->config['payment_method_numb']['PayPal']:
-                break;
+//            case $this->config['payment_method_numb']['PayPal']:
+//                break;
 
             // Payment Method unknown
             default:
-//                $payMethod = false;
+                $payMethod = false;
+                $messages[] = "I'm sorry, we couldn't tell which payment method you wanted to use. Please select one under \"Payment Information\" below.";
                 break;
 
         }
-exit;
 
         /*
          * Update the reg_request reccord: account id, billing, payment, status, etc...
          */
 
-        $reqData = array();
-        $reqFormat = array();
         $now = date('Y-m-d H:i:s', time());
 
         // Account ID
         $reqData['account'] = $accountId;
         $reqFormat[] = '%d';
 
-        // Billing data
-
+        // Add billing data to requesst update arrays
         $reqData = array_merge(
             $reqData,
             array(
@@ -557,8 +546,8 @@ exit;
             )
         );
 
-        // If COMPLETE, save date, pay method, status, total
-        if ($cartStatus == $this->config['submission_status_numb']['COMPLETE'] && $billing['addr2'] != '*** DO NOT CLEAR ***') {
+        // Save date, pay method, status, total
+        if (count($messages) == '' && $billing['addr2'] != '*** DO NOT CLEAR ***') {
 
             $reqData = array_merge(
                 $reqData,
@@ -566,7 +555,7 @@ exit;
                     'date_submitted'  => $now,
                     'pay_method'      => $payMethod,
                     'status'          => $cartStatus,
-                    'total'           => $payment['charge'],
+                    'total'           => $this->cart['totalCharges'],
                     'total_discounts' => $this->cart['totalDiscounts'],
                     'registrants'     => $this->cart['totalRegistrants']
                 )
@@ -601,38 +590,6 @@ exit;
         $reqData['user_trace_info'] = serialize($trace);
         $reqFormat[]                = '%s';
 
-        // Credit Card information
-        $cc_numb_store = '';
-        if (is_array($payment)) {
-
-            $cc_numb_store = '....'.substr($payment['ccnumb'], -4);
-
-            $reqData = array_merge(
-                $reqData,
-                array(
-                    'cc_type' => $payment['cctype'],
-                    'cc_name' => $payment['ccname'],
-                    'cc_numb' => $cc_numb_store,
-                    'cc_exp'  => $payment['ccexp'],
-                    'cc_conf' => $ccConfirmation,
-                )
-            );
-            $reqFormat = array_merge(
-                $reqFormat,
-                array(
-                    '%s',
-                    '%s',
-                    '%s',
-                    '%s',
-                    '%s',
-                )
-            );
-
-            $reqData['cc_type'] = $payment['cctype'];
-            $reqFormat[] = '%s';
-
-        }
-
         $reqFormat[] = '%s';
 
         // Store the data
@@ -706,7 +663,10 @@ exit;
             'status'         => $this->config['submission_status'],
             'misc'           => $misc
         );
+
         $summary = $this->generateHTML($summaryData, 'front/registrations/summaryStore.html');
+
+        // Store this summary in the request reccord
         $updated = $this->wpdb->update(
             GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX.'reg_request',
             array(
@@ -714,10 +674,14 @@ exit;
             ),
             array( 'id' => $requestId ),
             array('%s')
-            );
+        );
+        if ($updated != 1 && $billing['addr2'] != '*** DO NOT CLEAR ***') {
+            $messages[] = 'Cart Summary did not store. This is a technical issue that means our systems could not store a summmary of what you submitted.';
+        }
 
-        // Update inventory totals and send notifications
+        // Update inventory totals and send notifications unless this is a test submission
         if ($billing['addr2'] != '*** DO NOT CLEAR ***') {
+
             $this->checkoutUpdateInventoryAndNotify($summary);
         }
 
@@ -737,7 +701,6 @@ exit;
             unset($_SESSION['glm_reg_cart_id']);
         }
 
-
         $view = 'summary';
 
         // Build check code for display of summary in iframe
@@ -745,6 +708,8 @@ exit;
 
         // Compile template data
         $templateData = array(
+            'haveMessages'   => count($messages),
+            'messages'       => $messages,
             'guestAccount'   => $guestAccount,
             'requestId'      => $requestId,
             'summaryCheck'   => $summaryCheck,
index 33b4d81..109948e 100644 (file)
@@ -63,6 +63,7 @@
 
     public function modelAction($actionData = false)
     {
+
         $start          = 1;
         $limit          = 20;
         $where          = '';
index bc1e5cd..7753208 100644 (file)
@@ -1,4 +1,3 @@
-{debug}
 {if $summaryType=="adminRequest"}
     {assign var="summaryColumnsItem" value="small-7 "}
     {assign var="summaryColumnsCharge" value="small-5 "}
@@ -38,7 +37,7 @@
                 <div class="small-8 column reg-cart-class-name">
                     <span>{$terms.reg_term_registration_cap} {$terms.reg_term_level_cap}:</span> {$class.class_name}
                 </div>
-                <div class="small-4 column text-right reg-cart-class-name glm-bold glm-reg-cart-charges-col">
+                <div class="small-3 column text-right reg-cart-class-name glm-bold glm-reg-cart-charges-col">
                     {if $rate.rateBaseCharge > 0}{$rate.base_rate_money}{/if}
                 </div>
             </div>
index 2c87310..d260b7a 100644 (file)
 
 {if $checkoutPageText}
     <div id="checkout-page-text" class="glm-row">
-        {$checkoutPageText}
-    </div>
-{/if}
+        <p>{$checkoutPageText}</p>
+
+    {if $haveMessages}
+        <div class="glm-registrations-messages glm-reg-warning" class="glm-row">
+            <i>Please Note:</i>
+            <ul>
+    {foreach $messages as $m}
+                <li>{$m}</li>
+    {/foreach}
+            </ul>
+        </div>
+    {/if}
+
 
-{if $haveMessages}
-    <div class="glm-registrations-messages glm-reg-warning" class="glm-row">
-        <i>Please Note:</i>
-        <ul>
-{foreach $messages as $m}
-            <li>{$m}</li>
-{/foreach}
-        </ul>
     </div>
 {/if}
 
+
 {if $haveCart}
     <form id="checkoutForm" href="{$regUrl}" method="post" class="glm-row">
         <input type="hidden" name="page" value="checkoutProcess">
                         </div>
                         <div class="glm-reg-row glm-reg-bill-field">
                             <div class="glm-reg-checkout-field-label glm-small-12 glm-large-3 glm-columns glm-reg-nowrap{if $regAccount.fieldRequired.bill_fax} glm-reg-required{/if}">FAX{if $regAccount.fieldRequired.bill_fax} *{/if}</div>
-                            <div class="glm-reg-checkout-field-data glm-small-12 glm-large-9 glm-columns{if $regAccount.fieldFail.bill_fax} glm-reg-fail{/if}"><input type="text" name="bill_fax" value="{$regAccount.fieldData.bill_fax}"{if $regAccount.fieldRequired.fax} required{/if}></div>
+                            <div class="glm-reg-checkout-field-data glm-small-12 glm-large-9 glm-columns{if $regAccount.fieldFail.bill_fax} glm-reg-fail{/if}"><input type="text" name="bill_fax" value="{$regAccount.fieldData.bill_fax}"{if $regAccount.fieldRequired.bill_fax} required{/if}></div>
                         </div>
+                        <div class="glm-reg-row glm-reg-bill-field">
+                            <p class="glm-reg-required">Please provide your E-Mail address. Without this we will be unable to contact you reqarding updates to this registration request.</p>
+                        </div>
+                        <div class="glm-reg-row glm-reg-bill-field">
+                            <div class="glm-reg-checkout-field-label glm-small-12 glm-large-3 glm-columns glm-reg-nowrap{if $regAccount.fieldRequired.email} glm-reg-required{/if}">E-Mail Address{if $regAccount.fieldRequired.email} *{/if}</div>
+                            <div class="glm-reg-checkout-field-data glm-small-12 glm-large-9 glm-columns{if $regAccount.fieldFail.email} glm-reg-fail{/if}"><input type="text" name="email" value="{$regAccount.fieldData.email}"{if $regAccount.fieldRequired.email} required{/if}></div>
+                        </div>
+                        
                     </div>
                 </div>
                 <div class="glm-small-12 glm-large-6 glm-columns glm-reg-cart-summary">
               <div class="glm-row">
                   <div class="glm-large-6 glm-small-12 glm-columns">
                       <h4>Payment Information</h4>
-                          <div style="white-space: nowrap;">
+                          <div id="payMethodSelectors" data-paymethod="" style="white-space: nowrap;">
     {foreach $payMethods as $payMethod}
 
         {$pmName = array_search($payMethod.value, $payMethodsNumb)}
-        {$pmNumb = $payMethodsNumb.{$pmName}}
+        {$pmNumb = $payMethodsNumb.{$pmName}} {$pmNumb}
                               <input id="payMethodButton_{$pmNumb}" type="radio" name="payMethod" value="{$pmNumb}" class="payMethodSelector"{if $defaultPayMethod==$pmNumb} checked="checked"{/if}>&nbsp;&nbsp;{$payMethods.{$pmNumb}.name}&nbsp;&nbsp;&nbsp;&nbsp;
     {/foreach}
                           </div>
 <script type="text/javascript">
     jQuery(function($){
 
+        var payMethodNumb = false;
+        
         // When payment method selection changes
         $('.payMethodSelector').on('change', function() {
 
             // Get the value from the selected Payment Method
-            var payMethodNumb = $(this).val();
+            payMethodNumb = $(this).val();
             payMethodSelection(payMethodNumb);
             
         });
             // Start with all payment method sections hidden
             $('.payMethodInput').attr('disabled', true);
 
-            payMethodSelection({$defaultPayMethod});
+            // Get currently checked payment method - works after browser back button - Should never be needed, but just in case          
+            var payMethodNumb = $("input[name='payMethod']:checked").val()
+            if (payMethodNumb == '') {
+                payMethodNumb = {$defaultPayMethod}+0;
+            }
+                
+            payMethodSelection(payMethodNumb);
 
         });
 
index 94e9201..a9788b1 100644 (file)
@@ -7,7 +7,7 @@
               <li>Checkout</li>
             </ul>
         </div>
-    </div>
+</div>
 <div id="glm-reg-list" class="glm-reg-row">
     {if $reg_bulletin}
     <div id="reg_bulletin">
index 2ef7b63..1b83725 100644 (file)
@@ -98,6 +98,7 @@
                             <tr><th colspan="2">Submission</th></tr>
                         </thead>
                         <tbody>
+                   {if $account.fname || $account.lname}
                             <tr>
                                 <th valign="top">Requested By:</th>
                                 <td>
                                     {$account.city}, {$account.state.name} {$account.zip} {$account.country.value}<br>
                                 </td>
                             </tr>
+                    {/if}
                     {if $account.phone}
                             <tr><th>Phone:</th><td>{$account.phone}</td></tr>
                     {/if}
                     {/if}
                         </tbody>
                     </table>
-                    {if $request.pay_method.value == $payMethodsNumb.CreditCard}
+                    
                     <table class="info-table" width="100%">
-                        <thead>
-                            <tr><th colspan="2">Payment</th></tr>
-                        </thead>
                         <tbody>
+                    {if $request.pay_method.value == $payMethodsNumb.CreditCard}
                             <tr><th>Payment Method:</th><td>{$request.pay_method.name}</td></tr>
                             <tr><th>Credit Card:</th><td>{$request.cc_type.name}</td></tr>
                             <tr><th>Name on Card:</th><td>{$request.cc_name}</td></tr>
                             <tr><th>Confirmation Code:</th><td>{$request.cc_conf}</td></tr>
                             <tr><th>Total Charged:</th><td>{$request.total}</td></tr>
                     {/if}
-                                  
+                    {if $request.pay_method.value == $payMethodsNumb.Check}
+                            <tr><th>Payment Method:</th><td>{$request.pay_method.name}</td></tr>
+                            <tr><th>Name on Check:</th><td>{$request.cc_name}</td></tr>
+                            <tr><th>Check Number:</th><td>{$request.cc_numb}</td></tr>
+                            <tr><th>Total Paid:</th><td>{$request.total}</td></tr>
+                    {/if}
+                    {if $request.pay_method.value == $payMethodsNumb.Cash}
+                            <tr><th>Payment Method:</th><td>{$request.pay_method.name}</td></tr>
+                            <tr><th>Total Paid:</th><td>{$request.total}</td></tr>
+                    {/if}
+                    {if $request.pay_method.value == $payMethodsNumb.OnArrival}
+                            <tr><th>Payment Method:</th><td>{$request.pay_method.name}</td></tr>
+                            <tr><th>To be paid on arrival:</th><td>{$request.total}</td></tr>
+                    {/if}
+                    {if $request.pay_method.value == $payMethodsNumb.Pending}
+                            <tr><th>Payment Method:</th><td>{$request.pay_method.name}</td></tr>
+                            <tr><th>Amount Pending:</th><td>{$request.total}</td></tr>
+                    {/if}
                         </tbody>
                     </table>
                 </td>