Skip to content

Commit

Permalink
CRM-20252 Improve text when processing possibly-delayed-payments
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Mar 13, 2017
1 parent 430cf83 commit eaae177
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions CRM/Contribute/Form/Contribution/ThankYou.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function buildQuickForm() {
if ($invoicing) {
$getTaxDetails = FALSE;
$taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings);
foreach ($this->_lineItem as $key => $value) {
foreach ($this->_lineItem as $value) {
foreach ($value as $v) {
if (isset($v['tax_rate'])) {
if ($v['tax_rate'] != '') {
Expand All @@ -131,7 +131,6 @@ public function buildQuickForm() {
$this->assign('totalTaxAmount', $params['tax_amount']);
}
if (!empty($this->_values['honoree_profile_id']) && !empty($params['soft_credit_type_id'])) {
$honorName = NULL;
$softCreditTypes = CRM_Core_OptionGroup::values("soft_credit_type", FALSE);

$this->assign('soft_credit_type', $softCreditTypes[$params['soft_credit_type_id']]);
Expand Down Expand Up @@ -284,6 +283,18 @@ public function buildQuickForm() {
$this->assign('friendURL', $url);
}

// A payment notification update could have come in at any time. Check at the last minute.
$contributionStatusID = civicrm_api3('Contribution', 'getvalue', array('id' => $params['contributionID'], 'return' => 'contribution_status_id'));
if (CRM_Core_PseudoConstant::getName('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $contributionStatusID) === 'Pending'
&& !empty($params['payment_processor_id'])
) {
$isPendingOutcome = TRUE;
}
else {
$isPendingOutcome = FALSE;
}
$this->assign('isPendingOutcome', $isPendingOutcome);

$this->freeze();

// can we blow away the session now to prevent hackery
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Contribute/Form/Contribution/ThankYou.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
{/if}
</div>
{/if}
{elseif $contributeMode EQ 'notify' OR ($contributeMode EQ 'direct' && $is_recur) }
{elseif $isPendingOutcome}
<div>{ts 1=$paymentProcessor.name}Your contribution has been submitted to %1 for processing. Please print this page for your records.{/ts}</div>
{if $is_email_receipt}
<div>
Expand Down

0 comments on commit eaae177

Please sign in to comment.