-
-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Payment.sendconfirmation api - add further tpl variables. #13610
Changes from all commits
b5a442e
a7b9128
00ef9b0
565920d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -216,6 +216,7 @@ public static function getConfirmationTemplateParameters($entities) { | |
'contactDisplayName' => $entities['contact']['display_name'], | ||
'totalAmount' => $entities['payment']['total'], | ||
'amountOwed' => $entities['payment']['balance'], | ||
'totalPaid' => $entities['payment']['paid'], | ||
'paymentAmount' => $entities['payment']['total_amount'], | ||
'checkNumber' => CRM_Utils_Array::value('check_number', $entities['payment']), | ||
'receive_date' => $entities['payment']['trxn_date'], | ||
|
@@ -224,6 +225,10 @@ public static function getConfirmationTemplateParameters($entities) { | |
'location' => CRM_Utils_Array::value('location', $entities), | ||
'event' => CRM_Utils_Array::value('event', $entities), | ||
'component' => (!empty($entities['event']) ? 'event' : 'contribution'), | ||
'isRefund' => $entities['payment']['total_amount'] < 0, | ||
'isAmountzero' => $entities['payment']['total_amount'] === 0, | ||
'refundAmount' => ($entities['payment']['total_amount'] < 0 ? $entities['payment']['total_amount'] : NULL), | ||
'paymentsComplete' => ($entities['payment']['balance'] == 0), | ||
]; | ||
|
||
return self::filterUntestedTemplateVariables($templateVariables); | ||
|
@@ -253,22 +258,23 @@ public static function filterUntestedTemplateVariables($params) { | |
'paidBy', | ||
'isShowLocation', | ||
'location', | ||
]; | ||
// Need to do these before switching the form over... | ||
$todoParams = [ | ||
'isRefund', | ||
'totalPaid', | ||
'isAmountzero', | ||
'refundAmount', | ||
'totalPaid', | ||
'paymentsComplete', | ||
]; | ||
// These are assigned by the payment form - they still 'get through' from the | ||
// form for now without being in here but we should ideally load | ||
// and assign. Note we should update the tpl to use {if $billingName} | ||
// and ditch contributeMode - although it might need to be deprecated rather than removed. | ||
$todoParams = [ | ||
'contributeMode', | ||
'isAmountzero', | ||
'billingName', | ||
'address', | ||
'credit_card_type', | ||
'credit_card_number', | ||
'credit_card_exp_date', | ||
'eventEmail', | ||
'$event.participant_role', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @eileenmcnaughton should we remove these two event parameters (as an indicator)? I didn't found any occurrence in form where its been assigned There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @monishdeb so that was my list of things to add to meet the tpl's requirements but when I reviewed the tpl I decided they were derived parameters (with the tpl) not assigned parameters There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok I see |
||
]; | ||
$filteredParams = []; | ||
foreach ($testedTemplateVariables as $templateVariable) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:-)