CRM-21311 fix credit card type display on contribution page confirmation and thank...
authoreileen <emcnaughton@wikimedia.org>
Thu, 2 Aug 2018 09:45:41 +0000 (21:45 +1200)
committereileen <emcnaughton@wikimedia.org>
Thu, 2 Aug 2018 11:14:12 +0000 (23:14 +1200)
The Confirm and Thank you pages were not showing the correct
label - they were showing the name which we don't expect people to customise

CRM/Contribute/Form/ContributionBase.php
templates/CRM/Contribute/Form/Contribution/Confirm.tpl

index ec174f47baa4e70501a4b8640ffb976714c02e54..90d6d457c1bf6d2e11436426899cb3f77ec47088 100644 (file)
@@ -610,6 +610,13 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
             CRM_Utils_System::mungeCreditCard(CRM_Utils_Array::value('credit_card_number', $this->_params))
           );
         }
+        elseif ($paymentField === 'credit_card_type') {
+          $this->assign('credit_card_type', CRM_Core_PseudoConstant::getLabel(
+            'CRM_Core_BAO_FinancialTrxn',
+            'card_type_id',
+            CRM_Core_PseudoConstant::getKey('CRM_Core_BAO_FinancialTrxn', 'card_type_id', $this->_params['credit_card_type'])
+          ));
+        }
         else {
           $this->assign($paymentField, $this->_params[$paymentField]);
         }
index 92c95693a57deecd0b3e47f686228aadee359656..7f57d725a877bbdb8434a8eaf7430ed377a986b5 100644 (file)
                 {/if}
             {else}
                 <div class="crm-section no-label credit_card_details-section">
-                  <div class="content">{$credit_card_type}</div>
-                  <div class="content">{$credit_card_number}</div>
+                  <div class="content">{$credit_card_type|escape}</div>
+                  <div class="content">{$credit_card_number|escape}</div>
                   <div class="content">{if $credit_card_exp_date}{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate}{/if}</div>
                   <div class="clear"></div>
                 </div>