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 17, 2017
1 parent 082d9a4 commit 5ba6e58
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
25 changes: 23 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,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
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 5ba6e58

Please sign in to comment.