svn commit: r797331 - /ofbiz/trunk/applications/order/webapp/ordermgr/order/orderpaymentinfo.ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r797331 - /ofbiz/trunk/applications/order/webapp/ordermgr/order/orderpaymentinfo.ftl

mor-2
Author: mor
Date: Fri Jul 24 05:52:11 2009
New Revision: 797331

URL: http://svn.apache.org/viewvc?rev=797331&view=rev
Log:
Minor improvement over last commit.

Modified:
    ofbiz/trunk/applications/order/webapp/ordermgr/order/orderpaymentinfo.ftl

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/order/orderpaymentinfo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderpaymentinfo.ftl?rev=797331&r1=797330&r2=797331&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/order/orderpaymentinfo.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/order/orderpaymentinfo.ftl Fri Jul 24 05:52:11 2009
@@ -16,7 +16,7 @@
 specific language governing permissions and limitations
 under the License.
 -->
-<#macro maskCreditCardNumber cardNumber>
+<#macro maskSensitiveNumber cardNumber>
   <#assign cardNumberDisplay = "">
   <#if cardNumber?has_content>
     <#assign size = cardNumber?length - 4>
@@ -219,8 +219,7 @@
 
                       <#if security.hasEntityPermission("PAY_INFO", "_VIEW", session)>
                         ${creditCard.cardType}
-                        <#assign cardNumber = creditCard.cardNumber?if_exists>
-                        <@maskCreditCardNumber cardNumber=cardNumber/>
+                        <@maskSensitiveNumber cardNumber=creditCard.cardNumber?if_exists/>
                         ${creditCard.expireDate}
                         &nbsp;[<#if oppStatusItem?exists>${oppStatusItem.get("description",locale)}<#else>${orderPaymentPreference.statusId}</#if>]
                       <#else>
@@ -334,22 +333,8 @@
                         ${giftCard.cardNumber?default("N/A")} [${giftCard.pinNumber?default("N/A")}]
                         &nbsp;[<#if oppStatusItem?exists>${oppStatusItem.get("description",locale)}<#else>${orderPaymentPreference.statusId}</#if>]
                       <#else>
-                        <#if giftCard?has_content && giftCard.cardNumber?has_content>
-                          <#assign giftCardNumber = "">
-                          <#assign pcardNumber = giftCard.cardNumber>
-                          <#if pcardNumber?has_content>
-                            <#assign psize = pcardNumber?length - 4>
-                            <#if (psize > 0)>
-                              <#list 0 .. psize-1 as foo>
-                                <#assign giftCardNumber = giftCardNumber + "*">
-                              </#list>
-                              <#assign giftCardNumber = giftCardNumber + pcardNumber[psize .. psize + 3]>
-                            <#else>
-                              <#assign giftCardNumber = pcardNumber>
-                            </#if>
-                          </#if>
-                        </#if>
-                        ${giftCardNumber?default("N/A")}
+                      <@maskSensitiveNumber cardNumber=giftCard.cardNumber?if_exists/>
+                      <#if !cardNumberDisplay?has_content>N/A</#if>
                         &nbsp;[<#if oppStatusItem?exists>${oppStatusItem.get("description",locale)}<#else>${orderPaymentPreference.statusId}</#if>]
                       </#if>
                     <#else>
@@ -463,7 +448,7 @@
                  <#assign creditCard = paymentMethodValueMap.creditCard/>
                  <#if (creditCard?has_content)>
                    <#if security.hasEntityPermission("PAY_INFO", "_VIEW", session)>
-                     ${creditCard.cardType?if_exists} <@maskCreditCardNumber cardNumber=creditCard.cardNumber?if_exists/> ${creditCard.expireDate?if_exists}
+                     ${creditCard.cardType?if_exists} <@maskSensitiveNumber cardNumber=creditCard.cardNumber?if_exists/> ${creditCard.expireDate?if_exists}
                    <#else>
                      ${Static["org.ofbiz.party.contact.ContactHelper"].formatCreditCard(creditCard)}
                    </#if>