Skip to content

Commit

Permalink
Merge pull request civicrm#10037 from JMAConsulting/CRM-20331
Browse files Browse the repository at this point in the history
CRM-20331, added code to show card type and pan truncation besides pa…
  • Loading branch information
eileenmcnaughton authored Mar 24, 2017
2 parents 84629e7 + a15fa9e commit 50b2b83
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -4053,7 +4053,7 @@ public static function getPaymentInfo($id, $component, $getTrxnInfo = FALSE, $us
SELECT GROUP_CONCAT(fa.`name`) as financial_account,
ft.total_amount,
ft.payment_instrument_id,
ft.trxn_date, ft.trxn_id, ft.status_id, ft.check_number, con.currency
ft.trxn_date, ft.trxn_id, ft.status_id, ft.check_number, ft.currency, ft.pan_truncation, ft.card_type
FROM civicrm_contribution con
LEFT JOIN civicrm_entity_financial_trxn eft ON (eft.entity_id = con.id AND eft.entity_table = 'civicrm_contribution')
Expand All @@ -4075,6 +4075,14 @@ public static function getPaymentInfo($id, $component, $getTrxnInfo = FALSE, $us
while ($resultDAO->fetch()) {
$paidByLabel = CRM_Core_PseudoConstant::getLabel('CRM_Core_BAO_FinancialTrxn', 'payment_instrument_id', $resultDAO->payment_instrument_id);
$paidByName = CRM_Core_PseudoConstant::getName('CRM_Core_BAO_FinancialTrxn', 'payment_instrument_id', $resultDAO->payment_instrument_id);
if ($resultDAO->card_type) {
$creditCardType = CRM_Core_PseudoConstant::getLabel('CRM_Core_BAO_FinancialTrxn', 'card_type', $resultDAO->card_type);
$pantruncation = '';
if ($resultDAO->pan_truncation) {
$pantruncation = ": {$resultDAO->pan_truncation}";
}
$paidByLabel .= " ({$creditCardType}{$pantruncation})";
}
$val = array(
'total_amount' => $resultDAO->total_amount,
'financial_type' => $resultDAO->financial_account,
Expand Down

0 comments on commit 50b2b83

Please sign in to comment.