Index: payment/uc_payment_pack/uc_payment_pack.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ubercart/payment/uc_payment_pack/uc_payment_pack.module,v
retrieving revision 1.6.2.7
diff -U5 -r1.6.2.7 uc_payment_pack.module
--- payment/uc_payment_pack/uc_payment_pack.module	18 Apr 2009 07:29:15 -0000	1.6.2.7
+++ payment/uc_payment_pack/uc_payment_pack.module	28 May 2009 16:28:22 -0000
@@ -297,11 +297,12 @@
                                      variable_get('uc_store_street1', ''),
                                      variable_get('uc_store_street2', ''),
                                      variable_get('uc_store_city', ''),
                                      variable_get('uc_store_zone', ''),
                                      variable_get('uc_store_postal_code', ''),
-                                     variable_get('uc_store_country', 840)));
+                                     variable_get('uc_store_country', 840)))
+                  .'</p><p>'. variable_get('uc_check_policy', '') .'</p>';
       }
       else {
         $review[] = array('title' => t('Mail to'), 'data' =>
                    uc_address_format(variable_get('uc_check_mailing_name', ''),
                                      NULL,
@@ -309,11 +310,12 @@
                                      variable_get('uc_check_mailing_street1', ''),
                                      variable_get('uc_check_mailing_street2', ''),
                                      variable_get('uc_check_mailing_city', ''),
                                      variable_get('uc_check_mailing_zone', ''),
                                      variable_get('uc_check_mailing_postal_code', ''),
-                                     variable_get('uc_check_mailing_country', 840)));
+                                     variable_get('uc_check_mailing_country', 840)))
+                  .'</p><p>'. variable_get('uc_check_policy', '') .'</p>';
       }
       return $review;
 
     case 'order-view':
       if (!variable_get('uc_payment_tracking', TRUE)) {
@@ -336,10 +338,12 @@
       }
       $result = db_query("SELECT clear_date FROM {uc_payment_check} WHERE order_id = %d ", $arg1->order_id);
       if ($check = db_fetch_object($result)) {
         $output = t('Check received') .'<br />'
                 . t('Expected clear date:') .'<br />'. format_date($check->clear_date, 'custom', variable_get('uc_date_format_default', 'm/d/Y'));
+      } else {
+        $output = '<p>'. variable_get('uc_check_policy', '') .'</p>';
       }
       return $output;
 
     case 'settings':
       $form['check_address_info'] = array(
@@ -368,5 +372,32 @@
       );
       return $form;
   }
 }
 
+/**
+ * Implementation of hook_token_list().
+ */
+function uc_payment_pack_token_list($type = 'all') {
+  if ($type == 'order' || $type == 'ubercart' || $type == 'all') {
+    $tokens['order']['order-payment-policy'] = t('The check policy');
+  }
+  return $tokens;
+}
+
+/**
+ * Implementation of hook_token_values().
+ */
+function uc_payment_pack_token_values($type, $object = NULL) {
+  switch ($type) {
+    case 'order':
+        $order = $object;
+        if( _payment_method_data($order->payment_method, 'name')==t("Check")) {
+          $values['order-payment-policy'] = variable_get('uc_check_policy','');
+        } else {
+          $values['order-payment-policy'] = "";
+        }
+      break;
+  }
+
+  return $values;
+}
