diff --git a/CRM/Contribute/Form/Contribution/ThankYou.php b/CRM/Contribute/Form/Contribution/ThankYou.php index c211ce0d10fc..62dee7c0509b 100644 --- a/CRM/Contribute/Form/Contribution/ThankYou.php +++ b/CRM/Contribute/Form/Contribution/ThankYou.php @@ -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'] != '') { @@ -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']]); @@ -284,6 +283,28 @@ public function buildQuickForm() { $this->assign('friendURL', $url); } + $isPendingOutcome = TRUE; + try { + // A payment notification update could have come in at any time. Check at the last minute. + $contributionStatusID = civicrm_api3('Contribution', 'getvalue', array( + 'id' => CRM_Utils_Array::value('contributionID', $params), + 'return' => 'contribution_status_id', + 'invoice_id' => CRM_Utils_Array::value('invoiceID', $params), + )); + if (CRM_Core_PseudoConstant::getName('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $contributionStatusID) === 'Pending' + && !empty($params['payment_processor_id']) + ) { + $isPendingOutcome = TRUE; + } + else { + $isPendingOutcome = FALSE; + } + } + catch (CiviCRM_API3_Exception $e) { + + } + $this->assign('isPendingOutcome', $isPendingOutcome); + $this->freeze(); // can we blow away the session now to prevent hackery diff --git a/templates/CRM/Contribute/Form/Contribution/ThankYou.tpl b/templates/CRM/Contribute/Form/Contribution/ThankYou.tpl index a03341619a8b..2a09fe159fe8 100644 --- a/templates/CRM/Contribute/Form/Contribution/ThankYou.tpl +++ b/templates/CRM/Contribute/Form/Contribution/ThankYou.tpl @@ -62,7 +62,7 @@ {/if} {/if} - {elseif $contributeMode EQ 'notify' OR ($contributeMode EQ 'direct' && $is_recur) } + {elseif $isPendingOutcome}
{ts 1=$paymentProcessor.name}Your contribution has been submitted to %1 for processing. Please print this page for your records.{/ts}
{if $is_email_receipt}