Skip to content

Commit

Permalink
Merge pull request #19658 from eileenmcnaughton/member
Browse files Browse the repository at this point in the history
[REF] Move code that relates to receipts when paying by credit card out of the shared function
  • Loading branch information
mattwire authored Feb 26, 2021
2 parents 185657d + 5c6ad1b commit 3a23df8
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions CRM/Member/Form/Membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -917,19 +917,6 @@ public static function emailReceipt($form, &$formValues, $membership) {
$formValues['paidBy'] = $paymentInstrument[$formValues['payment_instrument_id']];
}

if ($form->_mode) {
// @todo move this outside shared code as Batch entry just doesn't
$form->assign('address', CRM_Utils_Address::getFormattedBillingAddressFieldsFromParameters(
$form->_params,
$form->_bltID
));

$valuesForForm = CRM_Contribute_Form_AbstractEditPayment::formatCreditCardDetails($form->_params);
$form->assignVariables($valuesForForm, ['credit_card_exp_date', 'credit_card_type', 'credit_card_number']);
$form->assign('is_pay_later', 0);
$form->assign('isPrimary', 1);
}

$form->assign('module', 'Membership');
$form->assign('contactID', $formValues['contact_id']);

Expand Down Expand Up @@ -1765,6 +1752,18 @@ protected function emailMembershipReceipt($formValues, $membership) {
$customValues = $this->getCustomValuesForReceipt($formValues, $membership);
$this->assign('customValues', $customValues);

if ($this->_mode) {
// @todo move this outside shared code as Batch entry just doesn't
$this->assign('address', CRM_Utils_Address::getFormattedBillingAddressFieldsFromParameters(
$this->_params,
$this->_bltID
));

$valuesForForm = CRM_Contribute_Form_AbstractEditPayment::formatCreditCardDetails($this->_params);
$this->assignVariables($valuesForForm, ['credit_card_exp_date', 'credit_card_type', 'credit_card_number']);
$this->assign('is_pay_later', 0);
$this->assign('isPrimary', 1);
}
return self::emailReceipt($this, $formValues, $membership);
}

Expand Down

0 comments on commit 3a23df8

Please sign in to comment.