From e8e0ff6c31404af1e615b3dc7c2b74967d1370fa Mon Sep 17 00:00:00 2001
From: Bert Wynants <bwynants+drupal-git@gmail.com>
Date: Tue, 14 Jun 2011 22:03:01 +0200
Subject: [PATCH] Issue #475576: Policy on invoice

---
 payment/uc_payment/uc_payment.tokens.inc      |    8 ++++++++
 uc_order/templates/uc-order--customer.tpl.php |    3 ++-
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/payment/uc_payment/uc_payment.tokens.inc b/payment/uc_payment/uc_payment.tokens.inc
index be77e38..80f667b 100644
--- a/payment/uc_payment/uc_payment.tokens.inc
+++ b/payment/uc_payment/uc_payment.tokens.inc
@@ -38,6 +38,14 @@ function uc_payment_tokens($type, $tokens, $data = array(), $options = array())
       if (empty($values[$original])) {
         $values[$original] = _uc_payment_method_data($order->payment_method, 'name');
       }
+      
+      //make sure we can access the payment policy in the invoice
+      if (!empty($values[$original])) {
+        $policy = variable_get('uc_'. $order->payment_method .'_policy');
+        if (!empty($policy)) {
+          $values[$original.'_policy'] = $policy;
+        }
+      }
     }
 
     if (isset($tokens['payment-balance'])) {
diff --git a/uc_order/templates/uc-order--customer.tpl.php b/uc_order/templates/uc-order--customer.tpl.php
index 35101e2..e5252e8 100644
--- a/uc_order/templates/uc-order--customer.tpl.php
+++ b/uc_order/templates/uc-order--customer.tpl.php
@@ -103,7 +103,8 @@
                   <b><?php echo t('Payment Method:'); ?></b>
                 </td>
                 <td width="98%">
-                  <?php echo $order_payment_method; ?>
+                  <?php echo $order_payment_method; ?><br />
+                  <?php echo $order_payment_method_policy; ?>
                 </td>
               </tr>
 
-- 
1.7.4.1

