From: eileen Date: Thu, 2 Aug 2018 09:45:41 +0000 (+1200) Subject: CRM-21311 fix credit card type display on contribution page confirmation and thank... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=05d2edfd2c1be94577491a4e802d2c0ccb11f5e0;p=civicrm-core.git CRM-21311 fix credit card type display on contribution page confirmation and thank you pages. 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 --- diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index ec174f47ba..90d6d457c1 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -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]); } diff --git a/templates/CRM/Contribute/Form/Contribution/Confirm.tpl b/templates/CRM/Contribute/Form/Contribution/Confirm.tpl index 92c95693a5..7f57d725a8 100644 --- a/templates/CRM/Contribute/Form/Contribution/Confirm.tpl +++ b/templates/CRM/Contribute/Form/Contribution/Confirm.tpl @@ -247,8 +247,8 @@ {/if} {else}
-
{$credit_card_type}
-
{$credit_card_number}
+
{$credit_card_type|escape}
+
{$credit_card_number|escape}
{if $credit_card_exp_date}{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate}{/if}