Skip to content

Commit

Permalink
Ensure pay later variables assigned
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Mar 18, 2022
1 parent 742ef03 commit a72ce55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 3 additions & 5 deletions CRM/Contribute/Form/Contribution/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -1400,12 +1400,10 @@ public function submit($params) {
// Would be nice to someday understand the point of this set.
$this->set('is_pay_later', $params['is_pay_later']);
// assign pay later stuff
$this->_params['is_pay_later'] = CRM_Utils_Array::value('is_pay_later', $params, FALSE);
$this->_params['is_pay_later'] = $params['is_pay_later'];
$this->assign('is_pay_later', $params['is_pay_later']);
if ($params['is_pay_later']) {
$this->assign('pay_later_text', $this->_values['pay_later_text']);
$this->assign('pay_later_receipt', CRM_Utils_Array::value('pay_later_receipt', $this->_values));
}
$this->assign('pay_later_text', $params['is_pay_later'] ? $this->_values['pay_later_text'] : NULL);
$this->assign('pay_later_receipt', ($params['is_pay_later'] && isset($this->_values['pay_later_receipt'])) ? $this->_values['pay_later_receipt'] : NULL);

if ($this->_membershipBlock && $this->_membershipBlock['is_separate_payment'] && !empty($params['separate_amount'])) {
$this->set('amount', $params['separate_amount']);
Expand Down
6 changes: 2 additions & 4 deletions CRM/Event/Form/Registration/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -985,10 +985,8 @@ public function postProcess() {
// assign pay later stuff
$this->_params['is_pay_later'] = CRM_Utils_Array::value('is_pay_later', $params, FALSE);
$this->assign('is_pay_later', $params['is_pay_later']);
if ($params['is_pay_later']) {
$this->assign('pay_later_text', $this->_values['event']['pay_later_text']);
$this->assign('pay_later_receipt', $this->_values['event']['pay_later_receipt']);
}
$this->assign('pay_later_text', $params['is_pay_later'] ? $this->_values['event']['pay_later_text'] : NULL);
$this->assign('pay_later_receipt', $params['is_pay_later'] ? $this->_values['event']['pay_later_receipt']: NULL);

if (!$this->_allowConfirmation) {
// check if the participant is already registered
Expand Down

0 comments on commit a72ce55

Please sign in to comment.